]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
16 years agotg3: sparse cleanup
Eric Dumazet [Fri, 25 Apr 2008 06:33:06 +0000 (23:33 -0700)]
tg3: sparse cleanup

Fix the following sparse warning :

drivers/net/tg3.c:4025:3: warning: context imbalance in 'tg3_restart_hw'
- unexpected unlock

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoforcedeth: realtek phy crossover detection
Ayaz Abdulla [Wed, 23 Apr 2008 18:37:30 +0000 (14:37 -0400)]
forcedeth: realtek phy crossover detection

This patch fixes an issue seen with the realtek 8201 phy. This phy has a
problem with crossover detection and it needs to be disabled. The
problem only arises on certain switches. Therefore, a module parameter
has been added to allow enabling crossover detection if needed. The
default will be set to disabled.

Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoibm_newemac: Increase MDIO timeouts
Benjamin Herrenschmidt [Wed, 23 Apr 2008 05:17:14 +0000 (15:17 +1000)]
ibm_newemac: Increase MDIO timeouts

This patch doubles the MDIO timeouts in EMAC as there are field
cases where they are two short to communicate with some PHYs.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agogianfar: Fix skb allocation strategy
Andy Fleming [Tue, 22 Apr 2008 22:18:29 +0000 (17:18 -0500)]
gianfar: Fix skb allocation strategy

gianfar was unable to handle failed skb allocation for rx buffers, so
we were spinning until it succeeded.  Actually, it was worse--we were
spinning for a long time, and then silently failing.  Instead, we take
Stephen Hemminger's suggestion to try the allocation earlier, and drop the
packet if it failed.

We also make a couple of tweaks to how buffer descriptors are set up.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agonetxen: reduce stack usage of netxen_nic_flash_print
Harvey Harrison [Tue, 22 Apr 2008 18:48:35 +0000 (11:48 -0700)]
netxen: reduce stack usage of netxen_nic_flash_print

Don't need to keep a struct netxen_new_user_info on the stack
when we only are interested in printing the serial_num.  Change
to only reading the serial_num.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosmc911x: test after postfix decrement fails in smc911x_{reset,drop_pkt}
Roel Kluin [Fri, 18 Apr 2008 20:50:48 +0000 (13:50 -0700)]
smc911x: test after postfix decrement fails in smc911x_{reset,drop_pkt}

When timeout reaches 0 the postfix decrement still subtracts, so the test
fails.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agonet drivers: fix platform driver hotplug/coldplug
Kay Sievers [Fri, 18 Apr 2008 20:50:44 +0000 (13:50 -0700)]
net drivers: fix platform driver hotplug/coldplug

Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform modalias is
prefixed with "platform:".  Add MODULE_ALIAS() to the hotpluggable network
platform drivers, to re-enable auto loading.

NOTE: didn't change drivers/net/fs_enet/fs_enet-main.c "old binding" support.
That looks problematic in the first place (it even uses the ancient "struct
device_driver" binding scheme for platform_bus!) and I suspect it will vanish
soonish when arch/powerpc rules the world.  Also, drivers/net/ne.c would have
needed more thought to sort out.

[akpm@linux-foundation.org: fix sgiseeq.c]
[dbrownell@users.sourceforge.net: more drivers, registration fixes]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Vitaly Bordug <vitb@kernel.crashing.org>
Cc: Dale Farnsworth <dale@farnsworth.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Andrew Victor <andrew@sanpeople.com>
Cc: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoforcedeth: new backoff implementation
Ayaz Abdulla [Fri, 18 Apr 2008 20:50:43 +0000 (13:50 -0700)]
forcedeth: new backoff implementation

This patch adds support for a new backoff algorithm for half duplex supported
in newer hardware.  The old method is will be designated as legacy mode.

Re-seeding random values for the backoff algorithms are performed when a
transmit has failed due to a maximum retry count (1 to 15, where max is
considered the wraparound case of 0).

Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoehea: make things static
Andrew Morton [Fri, 18 Apr 2008 20:50:39 +0000 (13:50 -0700)]
ehea: make things static

ehea_flush_sq() and ehea_purge_sq() should be static.

Cc: Jeff Garzik <jeff@garzik.org>
Cc: Thomas Klein <osstklei@de.ibm.com>
Cc: Thomas Klein <tklein@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agophylib: Add support for board-level PHY fixups
Andy Fleming [Fri, 18 Apr 2008 22:29:54 +0000 (17:29 -0500)]
phylib: Add support for board-level PHY fixups

Sometimes the specific interaction between the platform and the PHY
requires special handling.  For instance, to change where the PHY's
clock input is, or to add a delay to account for latency issues in the
data path.  We add a mechanism for registering a callback with the PHY
Lib to be called on matching PHYs when they are brought up, or reset.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[netdrvr] atlx: code movement: move atl1 parameter parsing
Chris Snook [Sat, 19 Apr 2008 01:51:53 +0000 (21:51 -0400)]
[netdrvr] atlx: code movement: move atl1 parameter parsing

Move some code from atlx.c to atl1.c to prevent build conflict with
the upcoming atl2 code.  No changes, just movement.

Signed-off-by: Chris Snook <csnook@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoatlx: remove flash vendor parameter
Chris Snook [Sat, 19 Apr 2008 01:47:41 +0000 (21:47 -0400)]
atlx: remove flash vendor parameter

There's no good reason to manually set the flash vendor in a module
parameter, outside of an Atheros hardware lab.  Remove it, so nobody
accidentally bricks their board using it incorrectly.

Signed-off-by: Chris Snook <csnook@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agokorina: misc cleanup
Francois Romieu [Sun, 20 Apr 2008 16:06:13 +0000 (18:06 +0200)]
korina: misc cleanup

- useless initialization (korina_ope / korina_restart)
- use a single variable for the status code in korina_probe
  and propagate the error status code from below
- useless checks in korina_remove : the variables are
  necessarily set when korina_probe succeeds

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agokorina: fix misplaced return statement
Francois Romieu [Sun, 20 Apr 2008 16:05:31 +0000 (18:05 +0200)]
korina: fix misplaced return statement

The driver takes the error unwind path without condition.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoWAN: Fix confusing insmod error code for C101 too.
Krzysztof Halasa [Sun, 20 Apr 2008 17:10:56 +0000 (19:10 +0200)]
WAN: Fix confusing insmod error code for C101 too.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoRemoving dead code in drivers/net/wan/hdlc_fr.c
Cédric Augonnet [Sun, 20 Apr 2008 17:15:51 +0000 (19:15 +0200)]
Removing dead code in drivers/net/wan/hdlc_fr.c

The local variable "prefix" is never used anymore, and the content of
this string appears a bit later, directly in a call to "alloc_netdev"
after doing exactly the same if/else test. So there seems to be no
point keeping those 4 lines anymore.

Signed-off-by: Cédric Augonnet <cedric.augonnet@ens-lyon.org>
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agotehuti: check register size
Francois Romieu [Sun, 20 Apr 2008 17:32:34 +0000 (19:32 +0200)]
tehuti: check register size

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[netdrvr] typhoon: typhoon_resume - remove call to start_queue
Grant Grundler [Mon, 21 Apr 2008 04:44:15 +0000 (22:44 -0600)]
[netdrvr] typhoon: typhoon_resume - remove call to start_queue

While trying to fix http://bugzilla.kernel.org/show_bug.cgi?id=8952
I looked at a few other drivers to figure out what drivers _should_
be doing for suspend/resume. I noticed typhoon driver is likely doing
more than it needs to.  Patch below is untested since I don't have the HW.

Suspend/resume code across NIC drivers is fairly inconsistent.
And I couldn't find any documentation on what the canonical sequence
NICs need to do for suspend or resume.  Is there any?

Barring contrary advice, I'm going model the tulip suspend/resume
fixes after tg3.c since a number of "modern" (< 5 years old) laptops
have that and I'm silly enough to assume it works.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoibm_newemac: PowerPC 440EP/440GR EMAC PHY clock workaround
Valentine Barshak [Tue, 22 Apr 2008 00:46:48 +0000 (10:46 +1000)]
ibm_newemac: PowerPC 440EP/440GR EMAC PHY clock workaround

This patch adds ibm_newemac PHY clock workaround for 440EP/440GR EMAC
attached to a PHY which doesn't generate RX clock if there is no link.
The code is based on the previous ibm_emac driver stuff. The 440EP/440GR
allows controlling each EMAC clock separately as opposed to global clock
selection for 440GX.

BenH: Made that #ifdef CONFIG_PPC_DCR_NATIVE for now as dcri_* stuff doesn't
exist for MMIO type DCRs like Cell. Some future rework & improvements of the
DCR infrastructure will make that cleaner but for now, this makes it work.

Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoibm_newemac: PowerPC 440GX EMAC PHY clock workaround
Valentine Barshak [Tue, 22 Apr 2008 00:46:46 +0000 (10:46 +1000)]
ibm_newemac: PowerPC 440GX EMAC PHY clock workaround

The PowerPC 440GX Taishan board fails to reset EMAC3 (reset timeout
error) if there's no link. Because of that it fails to find PHY
chip. The older ibm_emac driver had a workaround for that: the
EMAC_CLK_INTERNAL/EMAC_CLK_EXTERNAL macros, which toggle the Ethernet
Clock Select bit in the SDR0_MFR register. This patch does the same for
"ibm,emac-440gx" compatible chips. The workaround forces clock on -all-
EMACs, so we select clock under global emac_phy_map_lock.

BenH: Made that #ifdef CONFIG_PPC_DCR_NATIVE for now as dcri_* stuff
doesn't exist for MMIO type DCRs like Cell. Some future rework &
improvements of the DCR infrastructure will make that cleaner but
for now, this makes it work.

Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoibm_newemac Use status property for unused/unwired EMACs
Josh Boyer [Tue, 22 Apr 2008 00:46:44 +0000 (10:46 +1000)]
ibm_newemac Use status property for unused/unwired EMACs

Convert ibm_newemac to use the of_device_is_available function when checking
for unused/unwired EMACs.  We leave the current check for an "unused" property
to maintain backwards compatibility for older device trees.  Newer device
trees should simply use the standard "status" property in the EMAC node.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoibm_newemac: Fix section mismatch warnings
Josh Boyer [Tue, 22 Apr 2008 00:46:43 +0000 (10:46 +1000)]
ibm_newemac: Fix section mismatch warnings

This patch fixes several section mismatch warnings in the
ibm_newemac driver similar to:

WARNING: vmlinux.o(.devinit.text+0x3a04): Section mismatch in reference from the function emac_probe() to the function .devexit.text:tah_detach()
The function __devinit emac_probe() references
a function __devexit tah_detach().

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoibm_newemac: Add support for 460EX/GT-type MAL rx-channel handling
Stefan Roese [Tue, 22 Apr 2008 00:46:42 +0000 (10:46 +1000)]
ibm_newemac: Add support for 460EX/GT-type MAL rx-channel handling

On some 4xx PPC's (e.g. 460EX/GT), the rx channel number is a multiple
of 8 (e.g. 8 for EMAC1, 16 for EMAC2), but enabling in MAL_RXCASR needs
the divided by 8 value for the bitmask.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoibm_newemac: Fix problem with jumbo frame support and EMAC V4.patch
Stefan Roese [Tue, 22 Apr 2008 00:46:42 +0000 (10:46 +1000)]
ibm_newemac: Fix problem with jumbo frame support and EMAC V4.patch

This fixes the jumbo frame support on EMAC V4 systems. Now the correct
bit is set depending on the EMAC version configured.

Tested on Kilauea (405EX) and Canyonlands (460EX).

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoe1000e: Increment version to 0.2.1
Jesse Brandeburg [Wed, 23 Apr 2008 18:09:39 +0000 (11:09 -0700)]
e1000e: Increment version to 0.2.1

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoigb: save and restore pcie/msi state to support EEH recovery
Auke Kok [Wed, 23 Apr 2008 18:09:34 +0000 (11:09 -0700)]
igb: save and restore pcie/msi state to support EEH recovery

To enable EEH support for pci-express network adapters, pcie/msi state
needs to be saved and restored for that adapter.

[after similar patches for ixgbe and e1000e from Wendy Xiong]

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Cc: Wendy Xiong <wendyx@us.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoe1000e: save and restore pcie/msi state to support EEH recovery
Wendy Xiong [Wed, 23 Apr 2008 18:09:29 +0000 (11:09 -0700)]
e1000e: save and restore pcie/msi state to support EEH recovery

To enable EEH support for pci-express network adapters, pcie/msi state
needs to be saved and restored for that adapter.

Tested this EEH patch with 2ports and 4ports pci-express e1000e
adapters.

Signed-off-by: Wendy Xiong <wendyx@us.ibm.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoixgbe: save and restore pcie/msi state to support EEH recovery
Wendy Xiong [Wed, 23 Apr 2008 18:09:24 +0000 (11:09 -0700)]
ixgbe: save and restore pcie/msi state to support EEH recovery

To enable EEH support for pci-express network adapters, pcie/msi state
needs to be saved and restored for that adapter.

Tested this EEH patch with Intel 10G pci-express ixgbe adapter.

Signed-off-by: Wendy Xiong <wendyx@us.ibm.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoe1000e: lower ring minimum size to 64
Auke Kok [Wed, 23 Apr 2008 18:09:19 +0000 (11:09 -0700)]
e1000e: lower ring minimum size to 64

The lower limit of 80 descriptors in the ring is only valid for
one older 8254x chipset. All e1000e devices can use as low as
64 descriptors.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoe1000e: Fix HW Error on es2lan, ARP capture issue by BMC
David Graham [Wed, 23 Apr 2008 18:09:14 +0000 (11:09 -0700)]
e1000e: Fix HW Error on es2lan, ARP capture issue by BMC

Several components to this complex fix. The es2lan cards occasionally
gave a "HW Error" especially when forcing speed. Some users also
reported that the BMC stole ARP packets.

The fixes include setting the proper SW_FW bits to tell the BMC
that we're active and not do any un-initialization at all, so the
setup routine is largely changed.

Signed-off-by: David Graham <david.graham@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoe1000e: Add interrupt moderation run-time ethtool interface
Auke Kok [Wed, 23 Apr 2008 18:09:08 +0000 (11:09 -0700)]
e1000e: Add interrupt moderation run-time ethtool interface

The ethtool -c / -C interface can now be used to modify the
irq moderation algorithm. This change does not require an
adapter reset and can thus be used at all times. The adapter
only supports changing/reading rx-usecs which has special
values for 0, 1 and 3:

0 - no irq moderation whatsoever
1 - normal moderation favoring regular mixed traffic (default)
3 - best attempt at low latency possible at cost of CPU

For values between 10 and 10000 the rx-usecs defines "the minimum
time between successive irqs" in usec, unlike the module parameter.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoe1000e: cleanup several stats issues
Bruce Allan [Wed, 23 Apr 2008 18:09:00 +0000 (11:09 -0700)]
e1000e: cleanup several stats issues

Several stats registers are completely unused and we just waste pci
bus time reading them. We also omit using the high 32 bits of the GORC/
GOTC counters. We can just read clear them and only read the low registers.

Mii-tool can also break es2lan if it executes a MII PHY register
ioctl while the device is in autonegotiation. Unfortunately it seems
that several applications and installations still perform this ioctl
call periodically and especially in this crucial startup time. We
can fool the ioctl by providing fail safe information that mimics
the "down" link state and only perform the dangerous PHY reads once
after link comes up to fill in the real values. As long as link
stays up the information will not change.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoS2io: Removed rx_lock and put_lock
Sreenivasa Honnur [Wed, 23 Apr 2008 17:31:33 +0000 (13:31 -0400)]
S2io: Removed rx_lock and put_lock

- Removed rx_lock and put_lock as the buffer replenishment and
  receive completion is handled serially.

Signed-off-by: Surjit Reang <surjit.reang@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoS2io: Removed receive buffer replenishment tasklet
Sreenivasa Honnur [Wed, 23 Apr 2008 17:29:42 +0000 (13:29 -0400)]
S2io: Removed receive buffer replenishment tasklet

- Removed receive buffer replenishment tasklet s2io_tasklet and instead
  allocating the receive buffers in either the interrupt handler (no napi)
  or the napi handler (napi enabled).

Signed-off-by: Surjit Reang <surjit.reang@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoS2io: Version update for memory leak fix during free_tx_buffers
Sreenivasa Honnur [Wed, 23 Apr 2008 17:28:58 +0000 (13:28 -0400)]
S2io: Version update for memory leak fix during free_tx_buffers

- Updated version number.

Signed-off-by: Santosh Rastapur <santosh.rastapur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoS2io: Fix memory leak during free_tx_buffers
Sreenivasa Honnur [Wed, 23 Apr 2008 17:28:08 +0000 (13:28 -0400)]
S2io: Fix memory leak during free_tx_buffers

- Fix the memory leak during free_tx_buffers.

Signed-off-by: Santosh Rastapur <santosh.rastapur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoucc_geth: Fix sneaky merge conflict regarding bus_id
Andy Fleming [Wed, 23 Apr 2008 21:56:17 +0000 (16:56 -0500)]
ucc_geth: Fix sneaky merge conflict regarding bus_id

The patch that changed mdio_bus to a string didn't conflict strongly enough
with the patch that added fixed PHY support to UCC.  Gather it back into
the fold.

Fixes this error:
...
 CC      drivers/net/ucc_geth.o
 'ucc_geth_probe':
 /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/net/ucc_geth.c:3935: error:
 incompatible types in assignment
 make[3]: *** [drivers/net/ucc_geth.o] Error 1

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agopata_bf54x: decrease count first.
Roel Kluin [Fri, 25 Apr 2008 03:37:54 +0000 (11:37 +0800)]
pata_bf54x: decrease count first.

When count reaches 0 the postfix decrement still subtracts (to -1),
so bfin_reset_controller() returns as if the busy flag was cleared
while it was not.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Acked-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosata_mv: re-enable hotplug, update TODO list
Mark Lord [Sat, 19 Apr 2008 18:54:41 +0000 (14:54 -0400)]
sata_mv: re-enable hotplug, update TODO list

Re-enable hotplug, now that the interrupt/error handling are mostly sane.
Also update the TODO list at the top.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosata_mv: leave SError bits untouched in mv_err_intr
Mark Lord [Sat, 19 Apr 2008 19:07:49 +0000 (15:07 -0400)]
sata_mv: leave SError bits untouched in mv_err_intr

Here it is again, minus the checkpatch.pl complaint:

Rework mv_err_intr() to leave the SError bits as-is,
so that libata-eh has a chance to see/use them.

We originally thought that clearing them here was necessary
before writing back to edma_err_cause (per the Marvell datasheets),
but we will end up reseting the chip regardless in those cases.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosata_mv: more interrupt handling rework
Mark Lord [Sat, 19 Apr 2008 18:53:07 +0000 (14:53 -0400)]
sata_mv: more interrupt handling rework

Continue fixing the interrupt handling logic.

Get rid of mv_intr_pio(), by using ata_sff_host_intr() for PIO..

Add a mv_unexpected_intr() catch-all for "impossible" scenarios,
where we get an interrupt that shouldn't have happened
(never seen in testing, but just in case..).

Rearrange the logic so that we always process completed
response queue entries before looking for other events,
This avoids having to re-issue commands that had already succeeded.

As part of this, we split out some duplicated functionality
into a new function, mv_get_active_qc().

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosata_mv: tidy host controller interrupt handling
Mark Lord [Sat, 19 Apr 2008 19:07:18 +0000 (15:07 -0400)]
sata_mv: tidy host controller interrupt handling

Tidy up host controller interrupt handling, by moving the weirdo
bit shifting from mv_interrupt() to mv_host_intr().

This lets us take advantage of the MV_PORT_TO_SHIFT_AND_HARDPORT() macro
from an earlier patch to greatly simplify the port numbering logic.

Also, defer reading the hc_irq_cause (one per hc) until it is
actually proven to be needed.  This may save a microsecond or
so per interrupt, on average (a later patchset will further reduce
unnecessary register reads throughout the driver).

Apart from that, we still leave the actual IRQ handling logic alone.
Subsequent patches in this series will address that.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosata_mv: simplify request/response queue handling
Mark Lord [Sat, 19 Apr 2008 19:06:40 +0000 (15:06 -0400)]
sata_mv: simplify request/response queue handling

Try and simplify handling of the request/response queues.

Maintain the cached copies of queue indexes in a fully-masked state,
rather than having each use of them have to do the masking.

Split off handling of a single crpb response into a separate function,
to reduce complexity in the main mv_process_crpb_entries() routine.

Ignore the rarely-valid error bits from the crpb status field,
as we already handle that information in mv_err_intr().

For now, preserve the rest of the original logic.
A later patch will deal with fixing that separately.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosata_mv: simplify freeze/thaw bit-shift calculations
Mark Lord [Sat, 19 Apr 2008 19:05:50 +0000 (15:05 -0400)]
sata_mv: simplify freeze/thaw bit-shift calculations

Introduce the MV_PORT_TO_SHIFT_AND_HARDPORT() macro,
to centralize/simplify various scattered bits of logic
for calculating bit shifts and the like.

Some of the places that do this get it wrong, too,
so consolidating the algorithm at one place will help
keep the code correct.

For now, we use the new macro in mv_eh_{freeze,thaw}.
A subsequent patch will re-use this in the interrupt handlers

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosata_mv mask all interrupt coalescing bits
Mark Lord [Sat, 19 Apr 2008 18:44:42 +0000 (14:44 -0400)]
sata_mv mask all interrupt coalescing bits

Ignore *all* interrupt coalescing bits on all controllers,
not just some of each.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosata_mv more cosmetics
Mark Lord [Sat, 19 Apr 2008 18:43:42 +0000 (14:43 -0400)]
sata_mv more cosmetics

More cosmetic cleanups prior to the interrupt/error handling logic changes.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoata_piix: add Asus Eee 701 controller to short cable list
Dan McGee [Mon, 21 Apr 2008 03:03:27 +0000 (22:03 -0500)]
ata_piix: add Asus Eee 701 controller to short cable list

The drive is directly soldered to the controller, so there is no cable at
all. Remove the 40-wire assumption so the drive can operate at max speed.

Before patch:
$ dd if=/dev/sda of=/dev/null bs=2M count=64 iflag=direct
134217728 bytes (134 MB) copied, 5.29612 s, 25.3 MB/s

After patch:
$ dd if=/dev/sda of=/dev/null bs=2M count=64 iflag=direct
134217728 bytes (134 MB) copied, 3.94955 s, 34.0 MB/s

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agolibata-eh set tf flags in NCQ EH result_tf
Mark Lord [Thu, 24 Apr 2008 02:36:25 +0000 (22:36 -0400)]
libata-eh set tf flags in NCQ EH result_tf

Fix mis-reporting of NCQ errors by ensuring that result_tf->flags
is properly initialized in libata-eh.  This allows ata_gen_ata_sense()
to report the failed block number correctly to SCSI after a media error
during NCQ.

This patch may also be a candidate for backporting to earlier kernels.
Without this fix, SCSI will fail I/O on the entire request rather
than just the bad sector.  That can be bad for a request that was
merged from many independent read reads from different tasks.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomake sata_set_spd_needed() static
Adrian Bunk [Mon, 21 Apr 2008 08:51:17 +0000 (11:51 +0300)]
make sata_set_spd_needed() static

sata_set_spd_needed() can now become static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomake sata_print_link_status() static
Adrian Bunk [Mon, 21 Apr 2008 08:51:11 +0000 (11:51 +0300)]
make sata_print_link_status() static

sata_print_link_status() can now become static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agolibata-acpi.c: remove unneeded #if's
Adrian Bunk [Mon, 21 Apr 2008 22:50:35 +0000 (01:50 +0300)]
libata-acpi.c: remove unneeded #if's

These #if's are unneeded since they:
- did anyway not handle the CONFIG_ACPI_DOCK_MODULE case correctly and
- this is already handled in include/acpi/acpi_drivers.h and
- it's now correctly handled in kconfig.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosata_nv: make hardreset return -EAGAIN on success
Tejun Heo [Wed, 23 Apr 2008 03:14:05 +0000 (12:14 +0900)]
sata_nv: make hardreset return -EAGAIN on success

sata_nv hardreset can't classify but was left out while unifying
follow-up SRST request mechanism[1].  This caused detection failures
on those controllers.  Fix it.

Reported and bisected by Roland Dreier, Petr Vandrovec and Marc
Dionne.  Thanks guys.

[1] 305d2a1ab137d11d573319c315748a87060fe82d

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Roland Dreier <rdreier@cisco.com>
Cc: Petr Vandrovec <vandrove@vc.cvut.cz>
Cc: Marc Dionne <marc.c.dionne@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoahci: retry enabling AHCI a few times before spitting out WARN_ON()
Tejun Heo [Wed, 23 Apr 2008 11:52:58 +0000 (20:52 +0900)]
ahci: retry enabling AHCI a few times before spitting out WARN_ON()

Some chips need AHCI_EN set more than once to actually set it.  Try a
few times before giving up and spitting out WARN_ON().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Peer Chen <pchen@nvidia.com>
Cc: Volker Armin Hemmann <volker.armin.hemmann@tu-clausthal.de>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agolibata: make WARN_ON conditions in ata_sff_hsm_move() more strict
Tejun Heo [Wed, 23 Apr 2008 11:48:36 +0000 (20:48 +0900)]
libata: make WARN_ON conditions in ata_sff_hsm_move() more strict

WARN_ON()'s in ata_hsm_move() was too liberal and got triggerred when
it shouldn't (e.g. hotplug events at the right moment).  As the HSM
only deals with device errors and state machine violations, make it
check only against them.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Mark Lord <liml@rtr.ca>
Cc: Albert Lee <albertcc@tw.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoATA/IDE: fix platform driver hotplug/coldplug
Kay Sievers [Fri, 18 Apr 2008 20:41:57 +0000 (13:41 -0700)]
ATA/IDE: fix platform driver hotplug/coldplug

Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform modalias
is prefixed with "platform:".  Add MODULE_ALIAS() to the hotpluggable
ATA and IDE platform drivers, to re-enable auto loading.

NOTE: both ata/pata_platform.c and ide/legacy/ide_platform.c claim
to provide "the" platform_pata driver, and there's no build-time
mutual exclusion mechanism.  This means that configs which enable
both drivers will make some trouble when hotplugging...

[dbrownell@users.sourceforge.net: more drivers, registration fixes]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Tejun Heo <htejun@gmail.com>
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoipv6 RAW: Disallow IPPROTO_IPV6-level IPV6_CHECKSUM socket option on ICMPv6 sockets.
YOSHIFUJI Hideaki [Fri, 25 Apr 2008 04:30:38 +0000 (21:30 -0700)]
ipv6 RAW: Disallow IPPROTO_IPV6-level IPV6_CHECKSUM socket option on ICMPv6 sockets.

RFC3542 tells that IPV6_CHECKSUM socket option in the IPPROTO_IPV6
level is not allowed on ICMPv6 sockets.  IPPROTO_RAW level
IPV6_CHECKSUM socket option (a Linux extension) is still allowed.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agousb: don't update devnum for wusb devices
David Vrabel [Tue, 8 Apr 2008 20:24:46 +0000 (13:24 -0700)]
usb: don't update devnum for wusb devices

For WUSB devices, usb_dev.devnum is a device index and not the real
device address (which is managed by wusbcore).  Therefore, only set
devnum once (in choose_address()) and never change it.

Signed-off-by: David Vrabel <david.vrabel@csr.com>
Cc: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agowusb: make ep0_reinit available for modules
Inaky Perez-Gonzalez [Tue, 8 Apr 2008 20:24:46 +0000 (13:24 -0700)]
wusb: make ep0_reinit available for modules

We need to be able to call ep0_reinit() [renamed to usb_ep0_reinit()]
from the WUSB security code. The reason is that when we authenticate
the device, it's address changes (from having bit 7 set to having it
cleared). Thus, we need to signal the USB stack to reinitialize EP0,
so the status with the previous address kept at the HCD layer is
cleared and properly reinitialized.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agowusb: devices dont use a set address
Inaky Perez-Gonzalez [Tue, 8 Apr 2008 20:24:46 +0000 (13:24 -0700)]
wusb: devices dont use a set address

A WUSB device gets his address during the connection phase; later on,
during the authenthication phase (driven from user space) we assign
the final address. So we need to skip in hub_port_init() the actual
setting of the address for WUSB devices.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agowusb: teach choose_address() about wireless devices
Inaky Perez-Gonzalez [Tue, 8 Apr 2008 20:24:46 +0000 (13:24 -0700)]
wusb: teach choose_address() about wireless devices

Modify choose_address() so it knows about our special scheme of
addressing WUSB devices (1:1 w/ port number).

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agowusb: add link wusb-usb device
Inaky Perez-Gonzalez [Tue, 8 Apr 2008 20:24:46 +0000 (13:24 -0700)]
wusb: add link wusb-usb device

We need to tie the WUSB and USB devices; the USB stack doesn't need to
know the details about the WUSB device, but needs to have a link to
it. This is needed so that the notify call back for Remove Device can
tie both and undo the device setup (sysfs files).

We connect the devices together at the Add Device notifier callback
(the wusb_dev references the usb_dev and stores it, the usb_dev
references the wusb_dev and stores it); then we do create the WUSB
sysfs files at the usb_dev sysfs directory. At Remove Device, we undo
that (thus we need the usb_dev reference).

Cross reference to functions in the WUSB substack:
wusb_dev_{add,rm}_ncb().

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agowusb: add authenticathed bit to usb_dev
Inaky Perez-Gonzalez [Tue, 8 Apr 2008 20:24:46 +0000 (13:24 -0700)]
wusb: add authenticathed bit to usb_dev

This bit indicates the system that the WUSB device has been crypto
authenticated and thus can operate as normal.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove unnecessary type casting of urb->context
Ming Lei [Sun, 24 Feb 2008 10:41:47 +0000 (18:41 +0800)]
USB: remove unnecessary type casting of urb->context

urb->context code cleanup

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb serial: more fixes and groundwork for tty changes
Alan Cox [Tue, 8 Apr 2008 16:16:06 +0000 (17:16 +0100)]
usb serial: more fixes and groundwork for tty changes

 - If a termios change fails due to lack of memory we should copy the
   old settings back over as the device has not changed
 - Note various locking problems
 - kl5kusb105 had various remaining tty flag handling problems
 - Make safe_serial use tty_insert_flip_string not open coded loops
 - set termios speed properly in usb_serial

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: replace remaining __FUNCTION__ occurrences
Harvey Harrison [Tue, 4 Mar 2008 00:08:34 +0000 (16:08 -0800)]
USB: replace remaining __FUNCTION__ occurrences

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: usbfs: export the URB_NO_INTERRUPT flag to userspace
Alan Stern [Thu, 17 Apr 2008 14:18:11 +0000 (10:18 -0400)]
USB: usbfs: export the URB_NO_INTERRUPT flag to userspace

This patch (as1079) cleans up the way URB_* flags are exported in
usbfs.

The URB_NO_INTERRUPT flag is now exported (this is the
only behavioral change).

USBDEVFS_URB_* macros are added for URB_NO_FSBR,
URB_ZERO_PACKET, and URB_NO_INTERRUPT, making explicit the
fact that the kernel accepts them.

The flag matching takes into account that the URB_* values
may change as the kernel evolves, whereas the USBDEVFS_URB_*
values must remain fixed since they are a user API.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix compile problems in ehci-hcd
Alan Stern [Fri, 18 Apr 2008 15:11:26 +0000 (11:11 -0400)]
USB: fix compile problems in ehci-hcd

This patch (as1072) fixes some recently-introduced compile problems
that show up in ehci-hcd when CONFIG_PM is turned off.

PORT_WAKE_BITS needs to be defined always.

ehci_port_power() is called during initialization by all the
EHCI variants other than the PCI version, in which it is
"defined but not used".  So add a call to it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ehci: qh_completions cleanup and bugfix
David Brownell [Sat, 12 Apr 2008 15:32:05 +0000 (08:32 -0700)]
USB: ehci: qh_completions cleanup and bugfix

Simplify processing of completed qtds, and correct handling of short
reads, by removing two state variables:

 - "qtd_status" wasn't needed.  The current URB's status is either
   OK (-EINPROGRESS) or some fault status.  Once a fault appears,
   the queue halts and any later QTDs are immediately removed, so
   no temporary status is needed.  (Or for typical short reads,
   it's not treated as a fault, so no queue halt is needed.)

 - "do_status" was erroneous.  Because of how the queue is set up,
   short control reads can (and should!) be treated like full size
   reads, and cleaned up the usual way.  The status stage will be
   executed transparently, and usbcore handles the choice of whether
   to report this status as unexected.

The "do_status" problem caused a rather perplexing timing-dependent
problem with usbtest case 10.  Sometimes it would make the controller
skip a dozen transactions while (wrongly) trying to clean up after a
short transfer.  Fortunately, removing a dcache contention issue made
this become trivial to reproduce (on one test rig), so enough clues
finally presented themselves ... I think this has been around for a
very long time, but was worsened by recent urb->status changes.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: cdc-acm: signedness fix
David Brownell [Sun, 13 Apr 2008 21:00:44 +0000 (14:00 -0700)]
USB: cdc-acm: signedness fix

Fix bogus assignment of "unsigned char *" to "char *":  preserve
unsignedness.  These values are used directly as descriptor lengths
when iterating through the buffer, so this *could* cause oddness
that potentially includes oopsing.  (IMO not likely, except as
part of a malicious device...)

Fix the bogus warning in CDC ACM which highlighted this problem
(by showing a negative descriptor type).  It uses the undesirable
legacy err() for something that's not even an error; switch to
use dev_dbg, and show descriptor types in hex notation to match
the convention for such codes.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add documentation about callbacks
Oliver Neukum [Wed, 16 Apr 2008 13:46:37 +0000 (15:46 +0200)]
USB: add documentation about callbacks

Add Documentation about callbacks in USB.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: don't explicitly reenable root-hub status interrupts
Alan Stern [Mon, 14 Apr 2008 16:17:56 +0000 (12:17 -0400)]
USB: don't explicitly reenable root-hub status interrupts

This patch (as1069b) changes the way OHCI root-hub status-change
interrupts are enabled.  Currently a special HCD method,
hub_irq_enable(), is called when the hub driver is finished using a
root hub.  This approach turns out to be subject to races, resulting
in unnecessary polling.

The patch does away with the method entirely.  Instead, the driver
automatically enables the RHSC interrupt when no more status changes
are present.  This scheme is safe with controllers using
level-triggered semantics for their interrupt flags.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: OHCI: turn off RD when remote wakeup is disabled
Alan Stern [Mon, 14 Apr 2008 16:17:49 +0000 (12:17 -0400)]
USB: OHCI: turn off RD when remote wakeup is disabled

This patch (as1068b) disables the RD interrupt flag when an OHCI root
hub is suspended with remote wakeup disabled.  Although the spec
clearly states that this flag permits the controller to issue an
interrupt when a resume request from downstream is detected and not
when a local status change occurs, some controllers mistakenly use it
for both types of event.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: HCDs use the do_remote_wakeup flag
Alan Stern [Mon, 14 Apr 2008 16:17:10 +0000 (12:17 -0400)]
USB: HCDs use the do_remote_wakeup flag

When a USB device is suspended, whether or not it is enabled for
remote wakeup depends on the device_may_wakeup() setting.  The setting
is then saved in the do_remote_wakeup flag.

Later on, however, the device_may_wakeup() value can change because of
user activity.  So when testing whether a suspended device is or
should be enabled for remote wakeup, we should always test
do_remote_wakeup instead of device_may_wakeup().  This patch (as1076)
makes that change for root hubs in several places.

The patch also adjusts uhci-hcd so that when an autostopped controller
is suspended, the remote wakeup setting agrees with the value recorded
in the root hub's do_remote_wakeup flag.

And the patch adjusts ehci-hcd so that wakeup events on selectively
suspended ports (i.e., the bus itself isn't suspended) don't turn on
the PME# wakeup signal.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: g_file_storage: ignore bulk-out data after invalid CBW
Alan Stern [Mon, 14 Apr 2008 15:45:29 +0000 (11:45 -0400)]
USB: g_file_storage: ignore bulk-out data after invalid CBW

This patch (as1061) makes g_file_storage more compliant with the
Bulk-Only Transport specification.  After an invalid CBW is received,
the gadget must ignore any further bulk-OUT data until it is reset.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: serial: remove endpoints setting checks from core and header
Greg Kroah-Hartman [Wed, 16 Apr 2008 16:17:38 +0000 (09:17 -0700)]
USB: serial: remove endpoints setting checks from core and header

Remove the unused check for num_interrupt and friends as well as remove
them from the header file because no usb-serial drivers no longer
reference them.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: serial: remove unneeded number endpoints settings
Greg Kroah-Hartman [Wed, 16 Apr 2008 16:17:38 +0000 (09:17 -0700)]
USB: serial: remove unneeded number endpoints settings

The usb-serial core no longer checks these fields so remove them from
all of the individual drivers.  They will be removed from the usb-serial
core in a patch later in the series.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: option.c: correct DTR behaviour
Chris Collins [Thu, 10 Apr 2008 08:15:53 +0000 (10:15 +0200)]
USB: option.c: correct DTR behaviour

Setting DTR et al. should work for all interfaces
if you actually pass the interface number. :-P

This should help with devices that have important pseudo-serial ports
that aren't on the first interface in the device.

Signed-off-by: Chris Collins <chris@ursys.com.au>
Signed-off-by: Matthias Urlichs <matthias@urlichs.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add Documentation about usb_anchor
Oliver Neukum [Wed, 9 Apr 2008 13:37:34 +0000 (15:37 +0200)]
USB: add Documentation about usb_anchor

This adds documentation about the new usb anchor infrastructure.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ehci: qh/qtd cleanup comments
David Brownell [Thu, 10 Apr 2008 21:21:06 +0000 (14:21 -0700)]
USB: ehci: qh/qtd cleanup comments

Provide better comments about qh_completions() and QTD handling.
That code can be *VERY* confusing, since it's evolved over a few
years to cope with both hardware races and silicon quirks.

Remove two unlikely() annotations that match the GCC defaults
(and are thus pointless); add an "else" to highlight code flow.

This patch doesn't change driver behavior.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: log an error message when USB enumeration fails
Alan Stern [Thu, 10 Apr 2008 16:45:34 +0000 (12:45 -0400)]
USB: log an error message when USB enumeration fails

This patch (as1077) logs an error message whenever the kernel is
unable to enumerate a new USB device.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: update comments about usb driver's header
Oliver Neukum [Thu, 10 Apr 2008 13:15:37 +0000 (15:15 +0200)]
USB: update comments about usb driver's header

Comments here are so outdated that they are plain wrong. We cannot expect
people to write correct drivers if the headers have incorrect comments.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Remove superfluous "depends on USB_SERIAL" from Kconfig.
Robert P. J. Day [Sun, 6 Apr 2008 12:00:30 +0000 (08:00 -0400)]
USB: Remove superfluous "depends on USB_SERIAL" from Kconfig.

Given that most of drivers/usb/serial/Kconfig is wrapped inside:

  if USB_SERIAL
  ...
  endif # USB_SERIAL

remove the consequently redundant dependencies on USB_SERIAL.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add extension of anchor API, usb_unlink_anchored_urbs
Oliver Neukum [Thu, 10 Apr 2008 12:07:37 +0000 (14:07 +0200)]
USB: add extension of anchor API, usb_unlink_anchored_urbs

This adds the ability to trigger asynchronous unlinks of anchored URBs. This
is needed for error handling in the comntext of completion handlers, which
cannot sleep.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: r8a66597-hcd: Add support for SH7366 USB host
Yoshihiro Shimoda [Thu, 10 Apr 2008 12:05:58 +0000 (21:05 +0900)]
USB: r8a66597-hcd: Add support for SH7366 USB host

R8A66597 is similar to SH7366 USB 2.0 Host/Function module. It can
support SH7366 USB host by changing several R8A66597 code.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: r8a66597-hcd: fix usb device connection timing
Yoshihiro Shimoda [Thu, 10 Apr 2008 12:05:55 +0000 (21:05 +0900)]
USB: r8a66597-hcd: fix usb device connection timing

Fix the problem that enumeration of a USB device was slow.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: r8a66597-hcd: fix interrupt transfer interval
Yoshihiro Shimoda [Thu, 10 Apr 2008 12:05:47 +0000 (21:05 +0900)]
USB: r8a66597-hcd: fix interrupt transfer interval

This driver ignored the value of bInterval and revised the problem
that performed interrupt transfer.

ASIX USB Ethernet adapter comes to work with this host controller
by applying this patch.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: oti6858: fix TCFLSH ioctl handling
Paulius Zaleckas [Thu, 10 Apr 2008 11:20:08 +0000 (14:20 +0300)]
USB: oti6858: fix TCFLSH ioctl handling

Removes unimplemented TCFLSH handling from oti6858, because it was
preventing TCFLSH handling by upper layer (line discipline) drivers (see
drivers/char/tty_io.c line 3450).

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ehci shutdown refactored
Sarah Sharp [Tue, 8 Apr 2008 21:30:18 +0000 (14:30 -0700)]
USB: ehci shutdown refactored

This patch refactors some shutdown code so it can be shared between
ehci_stop() and ehci_shutdown().

This also fixes a couple potential bugs:
 - ehci_shutdown() was not locking ehci->lock before halting the HC.
 - ehci_shutdown() didn't disable the watchdog and IAA timers.
 - ehci_stop() was resetting the host controller when it may have been
   running, which the EHCI spec says "may result in undefined behavior".

ehci_stop() was calling port_power() to turn off the ports, which waited
20ms after applying the port change.  The msleep was for the case where
the HC might take 20ms to turn the ports on; since we're shutting them
off, we can avoid the msleep and just use ehci_turn_off_ports().

ehci_stop() doesn't need to clear the intr_enable register or revert
ownership of the companion controllers to the BIOS, because the host
controller reset should have done that.  There might be a buggy host
controller that doesn't follow the reset rules, but for now we assume
it's redundant code and remove it.

[ A subsequent patch will cancel the timers later ... this version
carries forward existing bugs where timers could get re-armed
after they're canceled. ]

Signed-off-by: Sarah Sharp <sarah.a.sharp@intel.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: at91_udc can prefetch data
David Brownell [Mon, 7 Apr 2008 06:32:55 +0000 (23:32 -0700)]
USB: at91_udc can prefetch data

The at91sam9 chip are ARMv5 so they support preload instructions.
Use preloading to load the FIFO a bit faster.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: dummy-hcd: use dynamic allocation for platform_devices
Alan Stern [Mon, 7 Apr 2008 19:03:25 +0000 (15:03 -0400)]
USB: dummy-hcd: use dynamic allocation for platform_devices

This patch (as1075) changes dummy-hcd to dynamically allocate its
platform_device structures, using the core platform_device_alloc()
interface.  This is what it should have done all along, because the
dynamically-allocated structures have a release method in the driver
core and are therefore immune to being released after the module has
been unloaded.

Thanks to Richard Purdie for pointing out the need for this change.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: gadget section fixes
David Brownell [Sat, 5 Apr 2008 21:17:14 +0000 (14:17 -0700)]
USB: gadget section fixes

Restore some section annotations:  they were switched to "__devinit"
while they should have been "__init", because of bogus warnings.  The
warnings are now fixed, so the runtime footprint of various drivers
can now shrink a bit.  On ARMv5, it's about 600 bytes except for the
Ethernet gadget, where it can save a bit more.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: rework sysfs removal of interface files
Alan Stern [Sat, 5 Apr 2008 03:46:59 +0000 (23:46 -0400)]
USB: rework sysfs removal of interface files

Removing an interface's sysfs files before unregistering the interface
doesn't work properly, because usb_unbind_interface() will reinstall
altsetting 0 and thereby create new sysfs files.  This patch (as1074)
removes the files after the unregistration is finished.  It's not
quite as clean, but at least it works.

Also, there's no need to check if an interface has been registered
before removing its sysfs files.  If it hasn't been registered then
the files won't have been created, so usb_remove_sysfs_intf_files()
will simply do nothing.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: replace remaining __PRETTY_FUNCTION__ occurrences
Harvey Harrison [Fri, 4 Apr 2008 21:28:01 +0000 (14:28 -0700)]
usb: replace remaining __PRETTY_FUNCTION__ occurrences

The kernel is written in C, not C++, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: OHCI: host-controller resumes leave root hub suspended
Alan Stern [Thu, 3 Apr 2008 22:03:17 +0000 (18:03 -0400)]
USB: OHCI: host-controller resumes leave root hub suspended

Drivers in the ohci-hcd family should perform certain tasks whenever
their controller device is resumed.  These include checking for loss
of power during suspend, turning on port power, and enabling interrupt
requests.

Until now these jobs have been carried out when the root hub is
resumed, not when the controller is.  Many drivers work around the
resulting awkwardness by automatically resuming their root hub
whenever the controller is resumed.  But this is wasteful and
unnecessary.

To simplify the situation, this patch (as1066) adds a new core
routine, ohci_finish_controller_resume(), which can be used by all the
OHCI-variant drivers.  They can call the new routine instead of
resuming their root hubs.  And ohci-pci.c can call it instead of using
its own special-purpose handler.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: clarify usage of hcd->suspend/resume methods
Alan Stern [Thu, 3 Apr 2008 22:03:06 +0000 (18:03 -0400)]
USB: clarify usage of hcd->suspend/resume methods

The .suspend and .resume method pointers in struct usb_hcd have not
been fully understood by host-controller driver writers.  They are
meant for use with PCI controllers; other platform-specific drivers
generally should not refer to them.

To try and clarify matters, this patch (as1065) renames those methods
to .pci_suspend and .pci_resume.  It eliminates corresponding dead code
and bogus references in the ohci-ssb and u132-hcd drivers.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: root hubs don't lie about their number of TTs
Alan Stern [Thu, 3 Apr 2008 22:02:56 +0000 (18:02 -0400)]
USB: root hubs don't lie about their number of TTs

Currently EHCI root hubs enumerate with a bDeviceProtocol code
indicating that they possess a Transaction Translator.  However the
vast majority of controllers do not; they rely on a companion
controller to handle full- and low-speed communications.  This patch
(as1064) changes the root-hub device descriptor to match the actual
situation.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: convert away from urb->status in xpad driver
Oliver Neukum [Thu, 3 Apr 2008 19:40:59 +0000 (21:40 +0200)]
USB: convert away from urb->status in xpad driver

USB is moving to transfering status as a parameter. To ease the transition
urb->status is to be touched only once in a function. The xpad driver has
been overlooked. Dmitry wants this to go through the USB tree.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: OHCI: fix bug in controller resume
Alan Stern [Thu, 3 Apr 2008 15:35:26 +0000 (11:35 -0400)]
USB: OHCI: fix bug in controller resume

This patch (as1063) fixes a bug in the way ohci-hcd resumes its
controllers.  It leaves the Master Interrupt Enable bit turned off.

If the root hub is resumed immediately this won't matter.  But if the
root hub is suspended (say because no devices are plugged in), it won't
ever wake up by itself.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: David Brownell <david-b@pacbell.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: gadget: dummy_hcd.c: fix nested switch statements
Ingo van Lil [Fri, 28 Mar 2008 21:50:26 +0000 (14:50 -0700)]
USB: gadget: dummy_hcd.c: fix nested switch statements

Fix a messed up combination of two nested switch statements in
drivers/usb/gadget/dummy_hcd.c.

According to the USB spec (section 5.8.3) the maximum packet size for bulk
endpoints can be 512 for high-speed devices and 8, 16, 32 or 64 for full-speed
devices.  Low-speed devices must not have bulk endpoints.

Signed-off-by: Ingo van Lil <inguin@gmx.de>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: mem leak fixes for AMD 5536 UDC high/full speed USB device controller driver
Jesper Juhl [Fri, 28 Mar 2008 21:50:27 +0000 (14:50 -0700)]
USB: mem leak fixes for AMD 5536 UDC high/full speed USB device controller driver

In drivers/usb/gadget/amd5536udc.c::udc_pci_probe(), sizeof(struct udc)
storage is allocated for 'dev'.

There are many exit points from the function where 'dev' is not free'd but has
also not yet been used for anything.  The following patch free's 'dev' at the
return points where it has not yet been used.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>