Linas Vepstas [Tue, 10 Oct 2006 21:21:10 +0000 (16:21 -0500)]
[PATCH] powerpc/cell spidernet DMA direction fix
The ring buffer descriptors are DMA-accessed bidirectionally,
but are not declared in this way. Fix this.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: James K Lewis <jklewis@us.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Linas Vepstas [Tue, 10 Oct 2006 21:19:34 +0000 (16:19 -0500)]
[PATCH] powerpc/cell spidernet variable name change
Cosmetic patch: give the variable holding the numer of descriptors
a more descriptive name, so to avoid confusion.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: James K Lewis <jklewis@us.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Linas Vepstas [Tue, 10 Oct 2006 21:18:18 +0000 (16:18 -0500)]
[PATCH] powerpc/cell spidernet reduce DMA kicking
The current code attempts to start the TX dma every time a packet
is queued. This is too conservative, and wastes CPU time. This
patch changes behaviour to call the kick-dma function less often,
only when the tx queue is at risk of emptying.
This reduces cpu usage, improves performance.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: James K Lewis <jklewis@us.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Linas Vepstas [Tue, 10 Oct 2006 21:15:29 +0000 (16:15 -0500)]
[PATCH] powerpc/cell spidernet
Remove a dummy register read that is not needed.
This reduces CPU usage notably during transmit.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: James K Lewis <jklewis@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Linas Vepstas [Tue, 10 Oct 2006 21:14:29 +0000 (16:14 -0500)]
[PATCH] powerpc/cell spidernet refine locking
The transmit side of the spider ethernet driver currently
places locks around some very large chunks of code. This
results in a fair amount of lock contention is some cases.
This patch makes the locks much more fine-grained, protecting
only the cirtical sections. One lock is used to protect
three locations: the queue head and tail pointers, and the
queue low-watermark location.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: James K Lewis <jklewis@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Linas Vepstas [Tue, 10 Oct 2006 21:13:05 +0000 (16:13 -0500)]
[PATCH] powerpc/cell spidernet NAPI polling info.
This patch moves transmit queue cleanup code out of the
interrupt context, and into the NAPI polling routine.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Cc: James K Lewis <jklewis@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Implement basic low-watermark support for the transmit queue.
Hardware low-watermarks allow a properly configured kernel
to continously stream data to a device and not have to handle
any interrupts at all in doing so. Correct zero-interrupt
operation can be actually observed for this driver, when the
socket buffer is made large enough.
The basic idea of a low-watermark interrupt is as follows.
The device driver queues up a bunch of packets for the hardware
to transmit, and then kicks the hardware to get it started.
As the hardware drains the queue of pending, untransmitted
packets, the device driver will want to know when the queue
is almost empty, so that it can queue some more packets.
If the queue drains down to the low waterark, then an interrupt
will be generated. However, if the kernel/driver continues
to add enough packets to keep the queue partially filled,
no interrupt will actually be generated, and the hardware
can continue streaming packets indefinitely in this mode.
The impelmentation is done by setting the DESCR_TXDESFLG flag
in one of the packets. When the hardware sees this flag, it will
interrupt the device driver. Because this flag is on a fixed
packet, rather than at fixed location in the queue, the
code below needs to move the flag as more packets are
queued up. This implementation attempts to keep the flag
at about 1/4 from "empty".
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: James K Lewis <jklewis@us.ibm.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Linas Vepstas [Tue, 10 Oct 2006 21:09:40 +0000 (16:09 -0500)]
[PATCH] powerpc/cell spidernet incorrect offset
Bugfix -- the rx chain is in memory after the tx chain --
the offset being used was wrong, resulting in memory corruption
when the size of the rx and tx rings weren't exactly the same.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: James K Lewis <jklewis@us.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Turn off mis-interpretation of the queue-empty interrupt
status bit as an error.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: James K Lewis <jklewis@us.ibm.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
The print message associated with the descriptor chain end interrupt
prints a bogs value. Fix that.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: James K Lewis <jklewis@us.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Linas Vepstas [Tue, 10 Oct 2006 21:05:00 +0000 (16:05 -0500)]
[PATCH] powerpc/cell spidernet bogus rx interrupt bit
The current receive interrupt mask sets a bogus bit that doesn't even
belong to the definition of this register. Remove it.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: James K Lewis <jklewis@us.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Linas Vepstas [Tue, 10 Oct 2006 21:04:00 +0000 (16:04 -0500)]
[PATCH] Spidernet stop queue when queue is full.
This patch adds a call to netif_stop_queue() when there is
no more room for more packets on the transmit queue.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: James K Lewis <jklewis@us.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Linas Vepstas [Tue, 10 Oct 2006 21:02:54 +0000 (16:02 -0500)]
[PATCH] Spidernet fix register field definitions
This patch fixes the names of a few fields in the DMA control
register. There is no functional change.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: James K Lewis <jklewis@us.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: James K Lewis <jklewis@us.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Linas Vepstas [Tue, 10 Oct 2006 21:01:00 +0000 (16:01 -0500)]
[PATCH] powerpc/cell spidernet zlen min packet length
Polite device drivers pad short packets to 60 bytes,
so that mean-spirited users don't accidentally DOS
some other OS that can't handle short packets.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: James K Lewis <jklewis@us.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Linas Vepstas [Tue, 10 Oct 2006 21:00:04 +0000 (16:00 -0500)]
[PATCH] powerpc/cell spidernet force-end fix
Bugfix: when cleaning up the transmit queue upon device close,
be sure to walk the entire queue.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: James K Lewis <jklewis@us.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Linas Vepstas [Tue, 10 Oct 2006 20:59:02 +0000 (15:59 -0500)]
[PATCH] Spidernet module parm permissions
The module param permsissions should bw read-only, not writable.
From: James K Lewis <jklewis@us.ibm.com> Signed-off-by: James K Lewis <jklewis@us.ibm.com> Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This patch increases the Burst Address alignment from 64 to 1024 in the
Spidernet driver. This improves transmit performance for large packets.
From: James K Lewis <jklewis@us.ibm.com> Signed-off-by: James K Lewis <jklewis@us.ibm.com> Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Linas Vepstas [Tue, 10 Oct 2006 20:56:04 +0000 (15:56 -0500)]
[PATCH] powerpc/cell spidernet ethtool -i version number info.
This patch adds version information as reported by
ethtool -i to the Spidernet driver.
From: James K Lewis <jklewis@us.ibm.com> Signed-off-by: James K Lewis <jklewis@us.ibm.com> Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Andrew Morton [Tue, 10 Oct 2006 21:33:30 +0000 (14:33 -0700)]
[PATCH] ibmveth irq fix
drivers/net/ibmveth.c:939: error: too many arguments to function `ibmveth_interrupt'
Cc: Jeff Garzik <jeff@garzik.org> Cc: Anton Blanchard <anton@samba.org> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Michael Buesch [Tue, 10 Oct 2006 21:33:26 +0000 (14:33 -0700)]
[PATCH] b44: fix eeprom endianess issue
This fixes eeprom read on big-endian architectures.
readw returns the data in CPU order. With cpu_to_le16 we convert it to little
endian, because "ptr" is a pointer to a _byte_ arrray. See the cast above. A
byte array is little endian.
The bug is:
Reading u16 values with readw, casting them into an u8 array and accessing
this u8 array as an u8 (byte) array. The correct fix is to swap the
CPU-ordering value returned by readw into little endian, as the u8 array is
little endian.
This compiles to nothing on little endian hardware (so it does not change b44
code on LE hardware), but _fixes_ code on BE hardware.
Signed-off-by: Michael Buesch <mb@bu3sch.de> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Deepak Saxena [Tue, 10 Oct 2006 21:33:22 +0000 (14:33 -0700)]
[PATCH] Update smc91x driver with ARM Versatile board info
We need to specify a Versatile-specific SMC_IRQ_FLAGS value or the new
generic IRQ layer will complain thusly:
No IRQF_TRIGGER set_type function for IRQ 25 (<NULL>)
Signed-off-by: Deepak Saxena <dsaxena@plexity.net> Cc: Jeff Garzik <jeff@garzik.org> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Nicolas Pitre <nico@cam.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Linus Torvalds [Wed, 11 Oct 2006 00:14:44 +0000 (17:14 -0700)]
ACPI: Allow setting SCI_EN bit in PM1_CONTROL register
This is needed by at least the Mac Mini's, which (incorrectly) come back
from suspend with SCI_EN clear.
Thanks to Frédéric Riss for hunting this down.
Acked-by: Frédéric Riss <frederic.riss@gmail.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: Len Brown <len.brown@intel.com> Cc: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Garzik [Tue, 10 Oct 2006 06:58:14 +0000 (02:58 -0400)]
[PATCH] firmware/dcdbas: fix bug in error cleanup
The error path path mistakenly called sysfs_create_group() rather than
sysfs_remove_group(). They take the same arguments, so it's easy to
cut-n-paste such a bug.
Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Garzik [Tue, 10 Oct 2006 05:40:55 +0000 (01:40 -0400)]
[PATCH] irda: donauboe fixes, cleanups
- fix: toshoboe_invalid_dev() was recently removed, but not all callers
were updated, causing the obvious linker error. Remove caller,
because the check (like the one removed) isn't used.
- fix: propagate request_irq() return value
- cleanup: remove void* casts
- cleanup: remove impossible ASSERTs
Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alexey Dobriyan [Wed, 28 Dec 2005 19:27:10 +0000 (22:27 +0300)]
[PATCH] Finish annotations of struct vlan_ethhdr
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roland Dreier [Tue, 10 Oct 2006 19:50:38 +0000 (12:50 -0700)]
RDMA/amso1100: Fix build with debugging off
Since pr_debug() has changed from a macro to an inline function when
DEBUG is not defined, its arguments now need to be defined even when
debugging is off. Therefore to_event_str() and to_qp_state_str() need
to be moved out of #ifdef DEBUG. The compiler will throw the
definitions away if DEBUG is not defined, but it needs to be able to
see that the functions exist.
Sean Hefty [Wed, 4 Oct 2006 18:37:25 +0000 (11:37 -0700)]
IB/cm: Send DREP in response to unmatched DREQ
Currently a DREP is only sent in response to a DREQ if a connection
has been found matching the DREQ, and it is in the proper state. Once
a DREP is sent, the local connection moves into timewait. Duplicate
DREQs received while in this state result in re-sending the DREP.
However, it's likely that the local connection will enter and exit
timewait before the remote side times out a lost DREP and resends a DREQ.
To handle this, we send a DREP in response to a DREQ, even if a local
connection is not found. This avoids maintaining disconnected
id's in timewait states for excessively long times, just to handle a
lost DREP.
Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Sean Hefty [Wed, 4 Oct 2006 18:29:59 +0000 (11:29 -0700)]
IB/cm: Fix timewait crash after module unload
If the ib_cm module is unloaded while id's are still in timewait, the
CM will destroy the work queue used to process timewait. Once the
id's exit timewait, their timers will fire, leading to a crash trying
to access the destroyed work queue.
We need to track id's that are in timewait, and cancel their deferred
work on module unload.
Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
IB/srp: Enable multiple connections to the same target
Enable multiple concurrent connections to the same SRP target:
1) Use port GUID instead of node GUID in the initiator port
identifier. This allows connections to be made from multiple HCA
ports at the same time.
2) Let the user specify the identifier extention when adding the
device. This allows userspace to make multiple connections even
from the same port, if it wants too.
Without this, only one connection can be made from any given HCA, even
if it has multiple ports, because we don't use multi-channel mode, so
targets will only allow one connection from a given initiator port ID.
Signed-off-by: Ishai Rabinovitz <ishai@mellanox.co.il> Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Ishai Rabinovitz [Tue, 10 Oct 2006 16:51:14 +0000 (09:51 -0700)]
IB/srp: Remove redundant memset()
scsi_host_alloc() already allocates with kzalloc(), so the struct Scsi_Host
is zeroed out, including the private data portion. Remove the redundant
memset that zeros this out again in the SRP initiator.
Signed-off-by: Ishai Rabinovitz <ishai@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Tom Tucker [Tue, 3 Oct 2006 14:46:41 +0000 (09:46 -0500)]
RDMA/amso1100: Add spinlocks to serialize ib_post_send/ib_post_recv
The AMSO driver was not thread-safe in the post WR code and had
code that would sleep if the WR post FIFO was full. Since these
functions can be called on interrupt level I changed the sleep to a
udelay.
Signed-off-by: Tom Tucker <tom@opengridcomputing.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
The windfarm code uses a struct device_driver instead of
platform_driver, which can cause crashes if any of the callbacks are
called (like on module removal). This fixes it.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
i2c-powermac was written & merged right after Russell King's changes
adding platform_driver... which I missed. Thus it still used struct
device, causing crashes when hitting sleep/wakeup callbacks (it happened
to work by luck so far, until early/late callbacks got added). This
causes crashes on sleep/wakeup on PowerBooks with 2.6.19. The patch
fixes it by using a proper platform_driver.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Paul Mackerras [Tue, 10 Oct 2006 03:51:00 +0000 (13:51 +1000)]
[POWERPC] Fix secondary CPU startup on old "powersurge" SMP powermacs
On the old "powersurge" SMP powermacs, the second CPU is started up
by sending it an IPI, which has the side effect of stopping the
timebase clock (so the secondary CPU's timebase can be synchronized
with the primary's). The routine that did this used udelay, which
will hang forever when the timebase is stopped, since udelay now spins
until the timebase reaches a certain value.
The end result is that the kernel would hang when bringing up the
second CPU. This fixes it by using a simple loop which just does a
fixed number of iterations to generate the delay. These old systems
were all clocked at around 200 MHz or so, so a fixed number of
iterations is acceptable.
The IDE driver will pick up the PCI IRQ for both channels on Maple
despite the fact that it's in legacy mode. This works around it by
"hiding" the PCI IRQ of the AMD8111 IDE controller when it's configured
in legacy mode on the Maple platform, thus causing the driver to call
pci_get_legacy_ide_irq() which will return the correct interrupts for
both channels.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
The Maple support code was missing code for U4/CPC945 PCIe. This adds
it, enabling it to work on tigerwood boards, and possibly also js21
using SLOF. Also disable an obsolete firmware workaround.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>