Commit Graph

20735 Commits

Author SHA1 Message Date
Rafal Jaworowski
dc65d002dd Initial FDT infrastructure elements for ARM.
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2010-06-13 13:12:52 +00:00
Rafal Jaworowski
10e8667600 Provide identify method for the fdtbus(4).
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2010-06-13 12:58:31 +00:00
Navdeep Parhar
27d1c65e8e cxgb(4): add knob to get packet timestamps from the hardware.
The T3 ASIC can provide an incoming packet's timestamp instead of its RSS hash.
The timestamp is just a counter running off the card's clock.  With a 175MHz
clock an increment represents ~5.7ns and the 32 bit value wraps around in ~25s.

# sysctl -d dev.cxgbc.0.pkt_timestamp
dev.cxgbc.0.pkt_timestamp: provide packet timestamp instead of connection hash

# sysctl -d dev.cxgbc.0.core_clock
dev.cxgbc.0.core_clock: core clock frequency (in KHz)
# sysctl dev.cxgbc.0.core_clock
dev.cxgbc.0.core_clock: 175000
2010-06-12 22:33:04 +00:00
Navdeep Parhar
06eace6376 make format string a string literal.
Reported by:	clang
2010-06-12 22:24:39 +00:00
Jack F Vogel
e6ec2d1fa6 Put back the lost bus_describe_intr() calls. 2010-06-11 21:35:19 +00:00
Jack F Vogel
91c0189dc0 Change the mbuf memory calls back to NOWAIT as a
problem has been seen in one case with doing the
M_WAITOK
2010-06-11 20:59:29 +00:00
Jack F Vogel
2e6bd30b46 Add a couple fixes from Michael Tuexen.
Remove unneeded rxtx handler, make que handler generic.
Do not allocate header mbufs in rx ring if not doing hdr split.
Release the lock in rxeof call to stack.

MFC for 8.1 asap
2010-06-11 20:54:27 +00:00
Jung-uk Kim
7b2d603ef0 Fix one more case where a string is passed via format argument instead.
Found by:	clang
2010-06-11 20:08:20 +00:00
Jung-uk Kim
2e1bf57ca8 Simplify a function for getting brightness levels. 2010-06-11 19:58:41 +00:00
Jung-uk Kim
30363a9a9e Remove unused assignment.
Found by:	clang static analyzer
Found by:	Coverity Prevent[tm] (CID 4537, 4538, 4539)
2010-06-11 19:53:42 +00:00
Andriy Gapon
1bdfff2252 fix a few cases where a string is passed via format argument instead of
via %s

Most of the cases looked harmless, but this is done for the sake of
correctness.  In one case it even allowed to drop an intermediate buffer.

Found by:	clang
MFC after:	2 week
2010-06-11 19:27:21 +00:00
Jack F Vogel
0301599d3d Remove a disable_queue from the beginning of the
interrupt handler, automask handles it.
Also, add in msix vector descriptions.

MFC for 8.1 asap
2010-06-11 19:03:59 +00:00
John Baldwin
3aa6d94e0c Update several places that iterate over CPUs to use CPU_FOREACH(). 2010-06-11 18:46:34 +00:00
Jung-uk Kim
80fba82198 Fix a possible dereference of null pointer.
Found by:	clang static analyzer
Found by:	Coverity Prevent[tm] (CID 3423)
2010-06-11 18:19:23 +00:00
Matt Jacob
8340692f44 Don't pass a buffer directly as a printflike format string.
Found by: clang
MFC after:	1 month
2010-06-10 19:38:07 +00:00
Xin LI
ddaa454e6a Apply driver update from LSI. Many thanks to LSI for continuing to
support FreeBSD.

  1) Timeout ioctl command timeouts.
       Do not reset the controller if ioctl command completed
       successfully.
  2) Remove G66_WORKAROUND code (this bug never shipped).
  3) Remove unnecessary interrupt lock (intr_lock).
  4) Timeout firmware handshake for PChip reset (don't wait forever).
  5) Handle interrupts inline.
  6) Unmask command interrupt ONLY when adding a command to the pending
     queue.
  7) Mask command interrupt ONLY after removing the last command from
     the pending queue.
  8) Remove TW_OSLI_DEFERRED_INTR_USED code.
  9) Replace controller "state" with separate data fields to avoid races:

       TW_CLI_CTLR_STATE_ACTIVE                     ctlr->active
       TW_CLI_CTLR_STATE_INTR_ENABLED               ctlr->interrupts_enabled
       TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY          ctlr->internal_req_busy
       TW_CLI_CTLR_STATE_GET_MORE_AENS              ctlr->get_more_aens
       TW_CLI_CTLR_STATE_RESET_IN_PROGRESS          ctlr->reset_in_progress
       TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS   ctlr->reset_phase1_in_progress

 10) Fix "req" leak in twa_action() when simq is frozen and req is NOT
     null.
 11) Replace softc "state" with separate data fields to avoid races:
       TW_OSLI_CTLR_STATE_OPEN                      sc->open
       TW_OSLI_CTLR_STATE_SIMQ_FROZEN               sc->simq_frozen
 12) Fix reference to TW_OSLI_REQ_FLAGS_IN_PROGRESS in
     tw_osl_complete_passthru()
 13) Use correct CAM status values.
       Change CAM_REQ_CMP_ERR to CAM_REQ_INVALID.
       Remove use of CAM_RELEASE_SIMQ for physical data addresses.
 14) Do not freeze/ release the simq with non I/O commands.
       When it is appropriate to temporarily freeze the simq with an I/O
       command use:
         xpt_freeze_simq(sim, 1);
         ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
       otherwise use:
         xpt_freeze_simq(sim, 1);
         xpt_release_simq(sim, 1);

Submitted by:	Tom Couch <tom.couch lsi.com>
PR:		kern/147695
MFC after:	3 days
2010-06-09 21:40:38 +00:00
Alexander Motin
c4219fc1b0 Add set of codec IDs.
PR:		kern/147466
2010-06-09 05:49:02 +00:00
John Baldwin
374d9c4d18 The lock associated with the /dev/apm knote is already held, so use
KNOTE_LOCKED() instead of KNOTE_UNLOCKED().

Reported by:	mav
MFC after:	3 days
2010-06-08 21:27:05 +00:00
Pyun YongHyeon
77982948d1 Remove unused macros.
Reviewed by:	bde
2010-06-08 17:28:28 +00:00
Alexander Motin
a47eae85b4 Disable NCQ and PMP support for VIA VT8251 AHCI. It was reported to be
unreliable under load. Linux does the same.
2010-06-08 10:03:08 +00:00
Kenneth D. Merry
931eeffaa2 A number of netfront fixes and stability improvements:
- Re-enable TSO.  This was broken previously due to CSUM_TSO clearing the
   CSUM_TCP flag, so our checksum flags were incorrectly set going to the
   netback driver.  That was fixed in r206844 in tcp_output.c, so we can
   turn TSO back on here.

 - Fix the way transmit slots are calculated, so that we can't overfill
   the ring.

 - Avoid sending packets with more fragments/segments than netback can
   handle.  The Linux netback code can only handle packets of
   MAX_SKB_FRAGS, which turns out to be 18 on machines with 4K pages.  We
   can easily generate packets with 32 or so fragments with TSO turned on.
   Right now the solution is just to drop the packets (since netback
   doesn't seem to handle it gracefully), but we should come up with a way
   to allow a driver to tell the TCP stack the maximum number of fragments
   it can handle in a single packet.

 - Fix the way the consumer is tracked in the receive path.  It could get
   out of sync fairly easily.

 - Use standard Xen ring macros to make it clearer how netfront is using
   the rings.

 - Get rid of Linux-ish negative errno return values.

 - Added more documentation to the driver.

 - Refactored code to make it easier to read.

 - Some other minor fixes.

Reviewed by:	gibbs

Reviewed by:	gibbs
Sponsored by:	Spectra Logic
MFC after:	7 days
2010-06-08 03:13:26 +00:00
Matt Jacob
95f7dfb2fa Fix XPT_GET_TRAN_SETTING for FC which has been broken for while so that
it will figure out the correct target to handle index and be able to find
things like WWPN, etc.

MFC after:	2 weeks
2010-06-07 17:39:36 +00:00
Navdeep Parhar
3a2c6562f3 cxgb(4): add an 'nfilters' tunable that lets the user place an upper
limit on the number of hardware filters (and thus the amount of TCAM
reserved for filtering).
2010-06-07 08:23:16 +00:00
Nathan Whitehorn
351129c7bb Some revisions of the Serverworks K2 SATA controller have a data
corruption bug where if an ATA command is issued before DMA is started,
data will become available to the controller before it knows what to do
with it. This results in either data corruption or a controller crash.

This patch remedies the problem by adopting the workaround employed
by Linux and Darwin: starting the DMA engine prior to sending the ATA
command.

Observer on:	Xserve G5
Reviewed by:	mav
MFC after:	1 week
2010-06-06 14:09:48 +00:00
Pyun YongHyeon
e0b7b101ce Fix a bug introduced in r199011. When bge(4) reuses loaded RX
buffers it should also reinitialize RX descriptors otherwise some
stale data could be passed to controller. This could end up with
mbuf double free or unexpected NULL pointer dereference in upper
stack. To fix the issue, save loaded buffer's length and
reinitialize RX descriptors with the saved value whenever bge(4)
reuses the loaded RX buffers.
While I'm here, increase the number of RX buffers to 512 from 256.
This simplifies RX buffer handling as well as giving more RX
buffers. Controller supports just fixed number of RX buffers
(i.e. 512) and bge(4) used to rely on hope that our CPU is fast
enough to keep up with the controller. With this change, bge(4)
will use 1MB for RX buffers but I don't think it would cause
problems in these days.

Reported by:	marcel
Tested by:	marcel
2010-06-05 23:29:24 +00:00
Fabien Thomas
8b85d75511 Convert pm_runcount to int to correctly check for negative value.
Remove uncessary check for error.

Found with:	Coverity Prevent(tm)
MFC after:	1 month
2010-06-05 23:05:08 +00:00
Matt Jacob
54b2e8ad07 Be more specific about which CDB length we're going to use. Not really a likely
bug but we might as well be clearer.

Found with:	Coverity Prevent(tm)
CID:		3981

MFC after:	2 weeks
2010-06-05 20:37:40 +00:00
Nathan Whitehorn
fed318596c Add two new flags (IIC_M_NOSTOP and IIC_M_NOSTART) to struct iic_msg to
allow consumers of iicbus_transfer() to send messages with repeated starts.

Reviewed by:	imp
2010-06-05 17:48:26 +00:00
Nathan Whitehorn
33520e90b2 Correct the comment. We now use level low instead of edge high for this
interrupt.
2010-06-05 16:27:15 +00:00
Nathan Whitehorn
ff6f4d01f1 Partially revert r208162 while waiting for review on a more comprehensive
fix. On Apple OpenPICs, the low/high bit of the interrupt sense is only
respected for interrupt 0. We currently erroneously program all OpenPIC
interrupts level high instead of level low by default, which only matters
for some G5 systems where the SATA controllers use IRQ 0.

This change is a quick fix that will be reverted once the effect of
changing the default interrupt sense on embedded systems is known.

MFC after:	3 days
2010-06-05 16:25:25 +00:00
Konstantin Belousov
04c49e68de Use the fpu_kern_enter() interface to properly separate usermode FPU
context from in-kernel execution of padlock instructions and to handle
spurious FPUDNA exceptions that sometime are raised when doing padlock
calculations.

Globally mark crypto(9) kthread as using FPU.

Reviewed by:	pjd
Hardware provided by:	Sentex Communications
Tested by:	  pho
PR:    amd64/135014
MFC after:    1 month
2010-06-05 16:00:53 +00:00
Alexander Motin
20b964467e Fix possible use after free.
Found with:   Coverity Prevent(tm)
CID:          4634
2010-06-05 08:58:03 +00:00
Alexander Motin
c25d9e1d96 Fix use after free on error.
Found with:   Coverity Prevent(tm)
CID:          4722
2010-06-05 08:44:40 +00:00
Alexander Motin
de29bf5e98 Plug memory leak to silent Coverity. Error is still not really handled.
Found with:   Coverity Prevent(tm)
CID:          4137
2010-06-05 08:21:18 +00:00
Alexander Motin
8d659f349e Plug memory leak to silent Coverity. Error is still not really handled.
Found with:   Coverity Prevent(tm)
CID:          4196
2010-06-05 08:16:21 +00:00
Alexander Motin
b136465250 Fix attach errors handling.
Found with:   Coverity Prevent(tm)
CID:          3477
2010-06-05 08:14:19 +00:00
Alexander Motin
dc5a530b04 Plug memory leak to silent Coverity. Error is still not really handled.
Found with:   Coverity Prevent(tm)
CID:          4130
2010-06-05 08:07:54 +00:00
Alexander Motin
c4d8fe61a1 Fix attach errors handling.
Found with:   Coverity Prevent(tm)
CID:          3424
2010-06-05 08:02:19 +00:00
Matt Jacob
0a100e5b0b Make the internal target > SPC2 (so REPORT LUNS can be tested).
Give the NIL inquiry data real values other than just plain 0x7f
in the first byte.

MFC after:	2 weeks
2010-06-05 00:56:15 +00:00
Matt Jacob
4962e51b0c I was getting panics in sleepq_add for the second sleep in isp_kthread.
I don't know why- but it occurred to me in looking at the second sleep
is that all I want is a pause- not an actual sleep. So do that instead.

MFC after:	2 weeks
2010-06-05 00:55:21 +00:00
Pyun YongHyeon
9def357406 Don't blindly set IFF_DRV_OACTIVE when sge_encap() fails. If there
is no queued frame, IFF_DRV_OACTIVE would never be cleared.

Submitted by:	Nikolay Denev < ndenev <> gmail at com >
MFC after:	4 days
2010-06-04 17:11:33 +00:00
Alexander Motin
6ee9deb145 Fix PCH chipset IDs. They are 0x3bxx, not 0x3axx.
Pointy hat to:	me
2010-06-04 07:35:59 +00:00
Marius Strobl
b1abfe6c7c Avoid possible NULL-dereferences.
Found with:	Coverity Prevent(tm)
CID:		3428
MFC after:	3 days
2010-06-03 12:09:02 +00:00
Jack F Vogel
2d8f84cbea Fixes for panic experienced in test at Intel, when
doing bidirectional stress traffic on 82598.

Also a couple bug fixes from Michael Tuexen, thank you!!

Add a workaround into the header so that 8 REL can use
the driver (adds local copy of ALTQ fix).

MFC: in a few days
2010-06-03 00:00:45 +00:00
Matt Jacob
a035b0afa0 Various minor and not so minor fixes suggested by Coverity.
In at least one case, it's amazing that target mode worked at all.

Found by: Coverity.
MFC after:	2 weeks
2010-06-02 23:31:27 +00:00
Rafal Jaworowski
b618dad3c2 FDT (simplebus) compatible attachment for uart(4).
This will be a single uart(4) attachment code shared by all FDT-enabled
platforms.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2010-06-02 17:20:00 +00:00
Rafal Jaworowski
58158742f2 Import the common Flattened Device Tree infrastructure.
o fdtbus(4) - the main abstract bus driver for all FDT-compliant systems. This
  is a direct replacement for the many incompatible bus drivers grouping
  integrated peripherals on embedded platforms (like obio(4), ocpbus(4) etc.)

o simplebus(4) - bus driver representing ePAPR style 'simple-bus' node, which
  is an umbrella device for most of the integrated peripherals on a typical
  system-on-chip device.

o Other components (common routines library, PCI node processing helper
  functions)

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2010-06-02 17:17:45 +00:00
Jung-uk Kim
e115a49ff3 Remove unnecessary pointer type castings, shift operations and dead code. 2010-06-01 21:15:05 +00:00
Rui Paulo
20c785f94f Rewrite ar9285SetBoardValues() to match what ath9k does and fix out of
bounds reads.

MFC after:	3 days
2010-06-01 15:47:57 +00:00
Rui Paulo
4f49ef4382 Bring in a couple of fixes from the Linux ath9k related to chip hangs.
While there, try to make the register write pattern look like what's
done by ath9k.

MFC after:	3 days
2010-06-01 15:33:10 +00:00