Commit graph

40625 commits

Author SHA1 Message Date
Josh Boyer be63c09afe 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>
2008-04-25 02:08:07 -04:00
Josh Boyer 51d4a1cc2e 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>
2008-04-25 02:08:06 -04:00
Stefan Roese afd1dee896 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>
2008-04-25 02:08:06 -04:00
Stefan Roese f34ebab68a 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>
2008-04-25 02:08:05 -04:00
Jesse Brandeburg f014e97ec6 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>
2008-04-25 02:08:05 -04:00
Auke Kok c682fc238a 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>
2008-04-25 02:08:04 -04:00
Wendy Xiong aad3273964 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>
2008-04-25 02:08:04 -04:00
Wendy Xiong fb3b27bc00 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>
2008-04-25 02:07:13 -04:00
Auke Kok 7b1be1987c 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>
2008-04-25 02:07:13 -04:00
David Graham 2d9498f369 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>
2008-04-25 02:07:12 -04:00
Auke Kok de5b3077da 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>
2008-04-25 02:07:12 -04:00
Bruce Allan 7c25769f88 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>
2008-04-25 02:07:11 -04:00
Sreenivasa Honnur c9fcbf4774 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>
2008-04-25 02:07:11 -04:00
Sreenivasa Honnur 99993af698 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>
2008-04-25 02:07:10 -04:00
Sreenivasa Honnur 10371b5e6b 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>
2008-04-25 02:07:10 -04:00
Sreenivasa Honnur b35b3b49fc 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>
2008-04-25 02:07:09 -04:00
Andy Fleming f38d1008b0 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>
2008-04-25 02:07:09 -04:00
Roel Kluin f9d4249172 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>
2008-04-25 01:26:28 -04:00
Mark Lord 85afb93457 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>
2008-04-25 01:26:22 -04:00
Mark Lord 8d07379d25 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>
2008-04-25 01:26:14 -04:00
Mark Lord 8f767f8a02 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>
2008-04-25 01:26:06 -04:00
Mark Lord a3718c1f23 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>
2008-04-25 01:25:57 -04:00
Mark Lord fcfb1f77ce 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>
2008-04-25 01:25:48 -04:00
Mark Lord 1cfd19aeb8 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>
2008-04-25 01:25:36 -04:00
Mark Lord f9f7fe014f 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>
2008-04-25 01:11:41 -04:00
Mark Lord 352fab701c 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>
2008-04-25 01:11:40 -04:00
Dan McGee 01ce2601e4 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>
2008-04-25 01:11:39 -04:00
Mark Lord a6116c9e60 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>
2008-04-25 01:11:37 -04:00
Adrian Bunk 1dc55e8761 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>
2008-04-25 00:46:11 -04:00
Adrian Bunk 6bdb4fc9f9 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>
2008-04-25 00:46:09 -04:00
Adrian Bunk 66a9099e02 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>
2008-04-25 00:45:52 -04:00
Tejun Heo a0b9f4bc1e 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] 305d2a1ab1

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>
2008-04-25 00:45:48 -04:00
Tejun Heo 15fe982e42 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>
2008-04-25 00:45:13 -04:00
Tejun Heo 411cb3869a 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>
2008-04-25 00:45:09 -04:00
Kay Sievers 458622fcdc ATA/IDE: fix platform driver hotplug/coldplug
Since 43cc71eed1, 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>
2008-04-25 00:45:04 -04:00
David Vrabel 4953d141dc 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>
2008-04-24 21:16:59 -07:00
Inaky Perez-Gonzalez fc721f5194 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>
2008-04-24 21:16:59 -07:00
Inaky Perez-Gonzalez 6c529cdca9 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>
2008-04-24 21:16:58 -07:00
Inaky Perez-Gonzalez 8af548dc8e 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>
2008-04-24 21:16:58 -07:00
Ming Lei cdc9779228 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>
2008-04-24 21:16:55 -07:00
Alan Cox a5b6f60c5a 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>
2008-04-24 21:16:55 -07:00
Harvey Harrison 441b62c1ed 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>
2008-04-24 21:16:55 -07:00
Alan Stern 14722ef4ac 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>
2008-04-24 21:16:54 -07:00
Alan Stern aff6d18f95 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>
2008-04-24 21:16:54 -07:00
David Brownell 4f6676274f 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>
2008-04-24 21:16:53 -07:00
David Brownell c6dbf554bc 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>
2008-04-24 21:16:53 -07:00
Alan Stern e872154921 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>
2008-04-24 21:16:53 -07:00
Alan Stern 5f47493cdf 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>
2008-04-24 21:16:53 -07:00
Alan Stern 58a97ffeb2 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>
2008-04-24 21:16:53 -07:00
Alan Stern b950bdbc67 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>
2008-04-24 21:16:52 -07:00
Greg Kroah-Hartman 9aebfd6bda 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>
2008-04-24 21:16:52 -07:00
Greg Kroah-Hartman 0ba4034e20 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>
2008-04-24 21:16:52 -07:00
Chris Collins 5f760040bc 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>
2008-04-24 21:16:51 -07:00
David Brownell a082b5c788 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>
2008-04-24 21:16:50 -07:00
Alan Stern 6427f79953 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>
2008-04-24 21:16:50 -07:00
Robert P. J. Day 51c159e7a8 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>
2008-04-24 21:16:50 -07:00
Oliver Neukum eda769593b 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>
2008-04-24 21:16:50 -07:00
Yoshihiro Shimoda 9424ea2965 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>
2008-04-24 21:16:49 -07:00
Yoshihiro Shimoda 29fab0cd89 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>
2008-04-24 21:16:49 -07:00
Yoshihiro Shimoda 6d8791076c 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>
2008-04-24 21:16:49 -07:00
Paulius Zaleckas 97af0a911b 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>
2008-04-24 21:16:49 -07:00
Sarah Sharp 21da84a893 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>
2008-04-24 21:16:49 -07:00
David Brownell 3cf2723432 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>
2008-04-24 21:16:49 -07:00
Alan Stern a89a2cd396 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>
2008-04-24 21:16:49 -07:00
David Brownell 0e530b4578 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>
2008-04-24 21:16:48 -07:00
Alan Stern 61a5c65789 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>
2008-04-24 21:16:48 -07:00
Harvey Harrison 96e12fced3 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>
2008-04-24 21:16:48 -07:00
Alan Stern 43bbb7e015 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>
2008-04-24 21:16:48 -07:00
Alan Stern 7be7d74187 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>
2008-04-24 21:16:48 -07:00
Alan Stern 7329e211b9 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>
2008-04-24 21:16:48 -07:00
Oliver Neukum 6fc88f53aa 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>
2008-04-24 21:16:47 -07:00
Alan Stern 0d22f65515 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>
2008-04-24 21:16:47 -07:00
Ingo van Lil 9063ff44f0 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>
2008-04-24 21:16:47 -07:00
Jesper Juhl 73d79aaba9 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>
2008-04-24 21:16:47 -07:00
Alan Stern 148d9fe4c9 USB: usb-storage: use adaptive DMA mask
This patch (as1060) makes usb-storage set the DMA alignment mask for
SCSI slaves to match the maxpacket size of the bulk-IN endpoint,
rather than always setting it to 511.  For full-speed devices that
mask is too restrictive, and wireless USB devices can have maxpacket
sizes larger than 512.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:46 -07:00
Craig W. Nadler cc901bbb2e USB: g_printer bugfixes
G_PRINTER: Bug fix for blocking reads and a fix for a memory leak.

This fixes bugs in blocking IO calls. When the poll() entry point
is called receive transfers will be setup if they have not already
been. Another bug fix is that the poll() entry point now checks the
current receive buffer for data when reporting if any data had been
received. A memory leak was fixed that could have occurred when a
USB reset happened.

Signed-off-by: Craig W. Nadler <craig@nadler.us>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:45 -07:00
Jesper Juhl 119fc8c9ac USB: test for NULL return from platform_get_resource() in ohci_hcd_sm501_drv_remove()
platform_get_resource() may return null, so although it seems it will never
do so here unless there's a bug elsewhere, it does no harm to be defensive
and test.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:45 -07:00
Ming Lei 44a29fd715 USB: fix comments of 2 functions in hcd.c
Remove useless @type note for rh_string() and @r note for usb_hcd_irq()
since this two parameters were removed.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:45 -07:00
Daniel Walker 50d8ca9b56 usb: u132-hcd driver: semaphore to mutex
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:45 -07:00
Daniel Walker b40f8d3980 usb: u132-hcd driver style clean up
I was converting a semaphore in this file to a mutex when I noticed that
this file has some fairly rampant style problems. Practically every line
has spaces instead of tabs .. Once I cleared that up, checkpatch.pl showed
a number of other problem.. I think this file might be a good one to review
for new style checks that could be added..

Below are the only two remaining which I didn't remove. 

#5083: FILE: drivers/usb/host/u132-hcd.c:2907:
+               error:

WARNING: labels should not be indented
#5087: FILE: drivers/usb/host/u132-hcd.c:2911:
+               stall:

These labels are actually inside a switch statement, and they are right
under "default:". "default:" appears to be exempt and these other label
should be too, or default shouldn't be exempt.

I also deleted a few lines due to single statements inside { } , 

if (is_error()) {
	return;
}

becomes,

if (is_error())
	return;

with one line deleted.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:44 -07:00
Greg Kroah-Hartman 619a6f1d14 USB: add usb-serial spcp8x5 driver
Original version of the driver done by Linxb, changes by Harald, and
lots of cleanups by me in order to get it into a mergable state.

Cc: Linxb <xubin.lin@worldplus.com.cn>
Cc: Harald Klein <hari@vt100.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:44 -07:00
Kevin Lloyd 7106967ecc usb/usb-serial-sierra-add-new-dev-group
This patch is for the sierra driver and adds support for a new group of
devices that have a new USB configuration.
This targets kernel 2.6.25-rc7

Signed-off-by: Kevin Lloyd <klloyd@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:44 -07:00
Kevin Lloyd 69a90f8189 USB: Serial: Sierra: C597 fix
This patch is for the sierra driver and fixes a Compass 597 bug that
allows users to access the SD-Card.

This targets kernel 2.6.25-rc7

Signed-off-by: Kevin Lloyd <klloyd@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:44 -07:00
Kevin Lloyd f3564de4f5 USB: Serial: Sierra: Clean up
This patch cleans up some of the sierra driver code. Please package this
with the other patches in this group as I would like the driver version
to reflect their changes as well.

Signed-off-by: Kevin Lloyd <klloyd@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:44 -07:00
David Engraf e4cf3aa8f9 USB: increase cdc-acm write throughput
the following patch uses 16 write urbs and a writsize of wMaxPacketSize
* 20.  With this patch I get the maximum througput from my linux system
with 20MB/sec read and 15 MB/sec write (full speed 1 MB/sec both)

I also deleted the flag URB_NO_FSBR for the writeurbs, because this
makes my full speed devices significant slower.

Signed-off-by: David Engraf <david.engraf@netcom.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:44 -07:00
David Engraf 28d1dfadd3 USB: cdc-acm tell tty layer not to split things up.
It ensures that the tty level do not split
the send buffer into 2KB blocks.


Signed-off-by: David Engraf <david.engraf@netcom.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:44 -07:00
Pete Zaitcev 454459b02e usbmon: restore mmap
Paolo asked to enable the mmap. I kept it off because I'm do not
entirely understand how it workse these days after ->nopage etc.
But it seems like working somewhat at least.

Signed-Off-By: Pete Zaitcev <zaitcev@gmail.com>
Cc: Paolo Abeni <paolo.abeni@email.it>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:43 -07:00
Robert P. J. Day d43a05fdc2 USB: Fix "cut and paste" booboo in usbmon Makefile.
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:43 -07:00
Robert P. J. Day 9ec249a658 USB: Remove EXPERIMENTAL designation from USB_EHCI_ROOT_HUB_TT.
According to David Brownell, this feature doesn't require an
experimental designation any longer.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:43 -07:00
Robert P. J. Day b67199967c USB: Remove EXPERIMENTAL from dynamic USB minor allocation.
Since this USB feature seems non-experimental, remove that dependency.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:43 -07:00
Robert P. J. Day 528e4c12a7 USB: Remove EXPERIMENTAL designation from USB MDC800 support.
Since support for the USB Mustek MDC800 Digital Camera has apparently
been around since the beginning of the git repository, it's safe to
assume it's no longer experimental.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:43 -07:00
Robert P. J. Day 1b75dc4de9 USB: Remove EXPERIMENTAL designation from USB serial/ Kconfig entries
Since nothing under the USB serial/ directory seems to be obviously
experimental, remove the EXPERIMENTAL dependency from all of those
Kconfig entries.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:43 -07:00
Robert P. J. Day bce62c263a USB: Remove EXPERIMENTAL designation from USB misc/ Kconfig entries
Since nothing under the USB misc/ seems to be obviously experimental,
remove the EXPERIMENTAL dependency from those Kconfig entries.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:43 -07:00
Robert P. J. Day afd0e0f2d4 USB: Remove EXPERIMENTAL tags from some USB gadget Kconfig entries.
Based on a recent discussion on the Linux USB mailing list, remove the
designation of EXPERIMENTAL from some USB gadget entries, and tag some
of them as DEVELOPMENT.

just for fun, i added a bit of help for gadgetfs, explaining the
race condition.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
2008-04-24 21:16:42 -07:00
Robert P. J. Day 726627f341 USB: Remove EXPERIMENTAL designation from USB storage Kconfig entries.
Since there seems to be little reason to mark the current USB storage
features as "EXPERIMENTAL," remove that dependency.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:42 -07:00
matthieu castet d277064e7e USB: mass storage: emulation of sat scsi_pass_thru with ATACB
I have got a cypress usb-ide bridge and I would like to tune or monitor
my disk with tools like hdparm, hddtemp or smartctl.

My controller support a way to send raw ATA command to the disk with
something call atacb (see
http://download.cypress.com.edgesuite.net/design_resources/datasheets/contents/cy7c68300c_8.pdf).

Atacb support can be added for each application, but there is some disadvantages :
- all application need to be patched
- A race is possible if there other accesses, because the emulation can
be split in 2 atacb scsi transactions. One for sending the command, one
for reading the register (if ck_cond is set). 

I have implemented the emulation in usb-storage with a special proto_handler,
and an unsual entry.

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:42 -07:00
Andrew Morton ff66e3ce35 drivers/usb/core/devio.c: suppress warning with 64k PAGE_SIZE
drivers/usb/core/devio.c: In function 'proc_control':
drivers/usb/core/devio.c:657: warning: comparison is always false due to limited range of data type

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:41 -07:00
Alan Cox 8873aaa6e5 USB: cypress_m8: Speed handling
The recent changes to this driver cleaned it up a lot, follow that up
by sorting the speed side of things out as well

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:41 -07:00
David Brownell 25b70a8665 USB: ehci: paranoia, reject large control transfers
Some EHCI fault paths with large control transfers aren't coded.  Avoid
problems by rejecting transfers that may need two qTDs (16+ KB).  This is
mostly paranoia; even 4 KB transfers are rare, and most HCDs use lower
limits (so it's unlikely anyone would ever try such a thing).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:41 -07:00
Alan Stern 70a1c9e086 USB: remove dev->power.power_state
power.power_state is scheduled for removal.  This patch (as1053)
removes all uses of that field from drivers/usb.  Almost all of them
were write-only, the most significant exceptions being sl811-hcd.c and
u132-hcd.c.

Part of this patch was written by Pavel Machek.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:41 -07:00
Matthias Geissert e1879b19b0 USB: ipaq: fix devices having more than one endpoint
The ipaq module  supports devices with one endpoint only. Some devices,
e.g. Yakumo Delta 300, have more than one endpoint.

This patch fixes support for devices having up to 2 endpoints which used
to work on older kernel versions.

Signed-off-by: Matthias Geissert <matthias.geissert@web.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:40 -07:00
David Brownell d1b1842c39 USB: ehci: remove obsolete workaround for bogus IRQs
It was pointed out that we found and fixed the cause of the "bogus"
fatal IRQ reports some time ago ... this patch removes the code
which was working around that bug ("status" got clobbered), and a
comment which needlessly confused folk reading this code.

This also includes a minor cleanup to the code which fixed that bug.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:40 -07:00
Robin Getz 22552b286b USB: partial USB embedded host support
This provides better support for USB "Embedded Host" functionality, which
is a subset of the USB OTG options:

 * External hub support can be disabled;

 * USB peripherals not whitelisted in "otg_whitelist.h" will be rejected
   during enumeration.

These options can allow some savings in software and support.

Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:40 -07:00
Ray Lee b56394bf32 USB: io_ti.c: remove unneeded null tty check
The Coverity checker (and Adrian Bunk) spotted an inconsistent NULL check of
port->tty (it's blindly dereferenced later without the check).

Alan Cox confirmed the check can go.

Signed-off-by: Ray Lee <ray-lk@madrabbit.org>
Cc: Adrian Bunk <bunk@kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:40 -07:00
Julia Lawall dfa5ec79d2 USB: use DIV_ROUND_UP
The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
(d)) but is perhaps more readable.

An extract of the semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@haskernel@
@@

#include <linux/kernel.h>

@depends on haskernel@
expression n,d;
@@

(
- (n + d - 1) / d
+ DIV_ROUND_UP(n,d)
|
- (n + (d - 1)) / d
+ DIV_ROUND_UP(n,d)
)

@depends on haskernel@
expression n,d;
@@

- DIV_ROUND_UP((n),d)
+ DIV_ROUND_UP(n,d)

@depends on haskernel@
expression n,d;
@@

- DIV_ROUND_UP(n,(d))
+ DIV_ROUND_UP(n,d)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:39 -07:00
Alan Cox 3d71fe0bb2 USB: io_ti: lock mcr and msr shadows properly
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:39 -07:00
Alan Cox 04ca89d494 USB: ti_usb_3410_5052: Extend locking to msr and shadow mcr
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:39 -07:00
Alan Cox a40d8540f4 USB: kobil_sct: Get rid of unneeded priv->line_state
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:39 -07:00
Alan Cox 7b1fc8bc6d USB: iuu_phoenix: lock priv->tiostatus properly
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:39 -07:00
Alan Cox e298449401 USB: serial: Note mos7480 and option don't lock modem status
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:39 -07:00
Alan Cox 9b0f2582d5 USB: ftdi_sio: Note missing locking
The ftdi_sio driver has no internal locking on the dtr/rts state. Flag
that up for someone to fix.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:38 -07:00
Alan Cox 2097890c43 USB: usb-serial: Prepare for BKL push down
Take the lock in usb-serial instead. As it relies on the BKL internally
we can't push it any deeper yet.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:38 -07:00
Karsten Wiese 3d01f0fe6b USB: minor ehci xITD simplifications
Remove two (or one) conditional tests in per-urb isochronous
transfer setup code paths.

Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:38 -07:00
matthias@kaehlcke.net fadec78bd9 USB: auerswald: Convert ccp->mutex in a mutex
The semaphore ccp->mutex is used as mutex, convert it to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Cc: Wolfgang Mües <wolfgang@iksw-muees.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:38 -07:00
matthias@kaehlcke.net 8a0f46b92f USB: auerswald: Convert ccp->readmutex in a mutex
The semaphore ccp->readmutex is used as mutex, convert it to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Cc: Wolfgang Mües <wolfgang@iksw-muees.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:38 -07:00
matthias@kaehlcke.net b994d7f70a USB: auerswald: Convert stats_sem in a mutex
The semaphore cp->mutex is used as mutex, convert it to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Cc: Wolfgang Mües <wolfgang@iksw-muees.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:38 -07:00
Mike Isely 92983c2121 USB: cypress_m8: Limit baud rate to <=4800 for USB low speed devices
The cypress app note for the M8 states that for the USB low speed
version of the part, throughput is effectively limited to 800
bytes/sec.  So if we were to try a faster baud rate in such cases then
we risk overrun errors on receive.  Best to just identify this case
and limit the rate to 4800 baud or less (by ignoring any request to
set a faster rate).  The old baud rate setting code was somewhat
fragile; this change also hopefully makes it easier in the future to
better checking / limiting.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:38 -07:00
Mike Isely 6768306c3d USB: cypress_m8: Get rid of pointless NULL check
Remove a NULL check in cypress_m8; the check is useless in this
context because it is referenced earlier in the same code path thus
the kernel would be oops'ed before reaching this point anyway.  (And
it's really pointless here anyway; if this pointer somehow is NULL the
driver is going to have serious problems in many other places.)

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:37 -07:00
Mike Isely 3d6aa32065 USB: cypress_m8: Don't issue GET_CONFIG for certain devices
Earthmate LT-20 devices (both "old" and "new" versions) can't tolerate
a GET_CONFIG command.  The original Earthmate has no trouble with
this.  Presumably other non-Earthmate devices are still OK as well.
This change disables the use of GET_CONFIG for cases where it is known
not to work.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:37 -07:00
Mike Isely 3416eaa1f8 USB: cypress_m8: Packet format is separate from characteristic size
cypress_m8: Packet format is separate from characteristic size

The Cypress app note states that when using an 8 byte packet buffer
size that the packet format is modified (to be more compact).  However
I have since discovered that newer DeLorme Earthmate LT-20 devices
(those that are low speed USB with 8 byte packet size) STILL use the
format that is really supposed to correspond to 32 byte packets.
Further confusing things is the subsequent discovery that there are
actually two different types of LT-20 - older LT-20's use 32 byte
packets which is probably why this issue wasn't originally
encountered.  The solution here is to flag the packet format
separately from the buffer size.  Then at initialization time,
identify the correct combination and set it up.  This is a critical
fix for anyone with a newer LT-20.  Older devices and non-Earthmate
devices should remain unaffected by this change.  (If other devices
behave in this, uh, unexpected manner, it's now just a simple 1 line
change to fix them as well (change the pkt_fmt member for that
device).  Default behavior with this patch is still to drive the
format as per the app-note; of course for Earthmate devices this is
overridden.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:37 -07:00
Mike Isely 93075544d6 USB: cypress_m8: Feature buffer fixes
cypress_m8: Feature buffer fixes

From: Mike Isely <isely@pobox.com>

Don't hardcode the feature buffer size; use sizeof() instead.  That
way we can easily specify the size in a single spot.  Speaking of the
feature buffer size, the Cypress app note (and further testing with a
DeLorme Earthmate) suggests that this size should be 5 not 8 bytes.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:36 -07:00
Andrew Morton 9544e833f9 USB: io_ti.c: remove pointless eye-candy in debug statements
These strings always come up as false positives whenever I'm doing
git-conflict fixups (ie: about 1000 times/day).

I don't think the zillion "<" and ">" characters are very useful and removing
them makes my life that little bit easier.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:36 -07:00
Savin Zlobec 4208978ec4 USB: gadget: Hangup tty on g_serial disconnect
On USB cable disconnect g_serial doesn't hangup the port tty,
which results in an endless read on the tty device. With the
following patch the read and select behave correctly when
the cable is unplugged.

Tested on at91rm9200

Signed-off-by: Savin Zlobec <savin@epiko.si>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:35 -07:00
Karsten Wiese c765d4cad9 USB: EHCI: Refactor "if (handshake()) state = HC_STATE_HALT"
Refactor the EHCI "if (handshake()) state = HC_STATE_HALT" idiom,
which appears 4 times, by replacing it with calls to a new function
called handshake_on_error_set_halt().  Saves a few bytes too.

Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:35 -07:00
Paul Mundt 96f9bc373c USB: m66592-udc: reduce size of data structure.
Poking around with pahole, we see that m66592 handily shoves a u16 in
between larger types on 2 separate occasions leaving us with 2 2-byte
holes:

struct m66592 {
	...

	/* size: 1196, cachelines: 38 */
	/* sum members: 1192, holes: 2, sum holes: 4 */
	/* last cacheline: 12 bytes */
};	/* definitions: 1 */

Pairing them gets back 4-bytes:

struct m66592 {
	...

	/* size: 1192, cachelines: 38 */
	/* last cacheline: 8 bytes */
};	/* definitions: 1 */

Unfortunately it's not enough to save a cacheline with this massive
structure, but every byte helps.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:35 -07:00
David Brownell 135db0485c USB: ehci minor SOC bus glue fixes
Various minor fixes to some SOC bus glue for EHCI:

 - Remove a bogus copyright (by "me"!) which someone added to the FSL
   driver, and an irrelevant comment.

 - Un-break MODULE_ALIAS() directives after platform_bus hotplugging
   acquired a backwards-incompatible change.  (Which didn't fix ANY
   of the in-tree drivers it prevented from hotplugging -- sigh.)

 - Remove some bogus assignments of platform_bus_type; that's done by
   the platform_bus code.

 - Add some FIXMEs for drivers with that pointless two-level idiom for
   probe() and remove() routines.  ("Obfuscation" is a non-goal.)
   That should help avoid future bus glue which copies that idiom.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:35 -07:00
David Brownell caa9ef672a USB: ehci tolerates some buggy devices
This teaches EHCI how to to work around bugs in certain high speed
devices, by accomodating "bulk" packets that exceed the 512 byte
constant value required by the USB 2.0 specification.  (Have a
look at section 5.8.3, paragraphs 1 and 3.)

It also makes the descriptor parsing code warn when it encounters
such bugs.  (We've had reports of maybe two or three such devices,
all pretty recent.)

Such devices are nonconformant.  The proper fix is have the vendors
of those devices do the simple, obvious, and correct thing ... which
will let them be used with USB hosts that don't have workarounds for
this particular vendor bug.  But unless/until they do, we can at least
have one of the high speed HCDs work with such buggy devices.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:35 -07:00
David Brownell e01e7fe388 USB: ohci: port reset paranoia timeout
This limits how long the OHCI port reset loop waits for the hardware
to do its job, if the controller either (a) dies, or (b) can't finish
the reset.  Such limits are always a good idea.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:34 -07:00
David Brownell 9776afc8b3 USB: ehci: minor cleanups
Minor cleanups to the EHCI code:  revision history is what source
code repositories should have.  Switch to a more standard way to
kick in verbose debugging -- don't be EHCI-specific.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:34 -07:00
David Brownell dbe0dbb7df USB: defines for USB "Link Power Management" (LPM) ECN
There's a new PM-related change notice for the USB 2.0 specification
called "Link Power Management" (LPM).  It defines a new "L1 Suspend"
state which resembles the current (L2) suspend state, except that it
can be entered and exited much more quickly.  It should thus be more
useful for runtime PM, even though it doesn't mandate reduced power
draw from VBUS.

This patch provides the relevant #defines for usbcore.  Actually
implementing these mechanisms requires host silicon that can generate
new USB packets, plus hubs handling some new requests and peripherals
which understand the new packets.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:34 -07:00
Pavel Emelyanov c4504a7eb9 USB: usbatm: convert heavy init dances to kthread API
This is an attempt to kill two birds with one stone.

First, we kill one more user of kernel_thread, which is scheduled
for removal. Second - we kill one of the last users of kill_proc -
the function which is also to be removed, because it uses a pid_t
which is not safe now.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:34 -07:00
Andrew Morton 1409e8e0e4 USB: usb-ohci-sm501-driver: use the conventional convention for suspend and resume
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:34 -07:00
Adrian Bunk 5ddeac117f USB: make USB_STORAGE_ONETOUCH available with PM
As Torsten Kaiser pointed out, it seems the dependency of
USB_STORAGE_ONETOUCH on !PM should have been removed in commit
7931e1c6f8.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Torsten Kaiser <just.for.lkml@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:34 -07:00
Daniel Walker 75c43b6ec6 USB: libusual: locking cleanup
I converted the usu_init_notify semaphore to normal mutex usage, and it
should still prevent the request_module before the init routine is
complete.  Before it acted more like a complete, now the mutex protects two
distinct section from running at the same time.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:33 -07:00
Daniel Walker d99388aa0a USB: microtek: remove unused semaphore
No current references, so removing it.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:33 -07:00
Alan Stern 9214d1d80c USB: enable USB-PERSIST by default
This patch (as1052) enables USB-PERSIST for all devices by default.
The user won't have to remember to enable it explicitly for devices
containing mounted filesystems.

Eventually userspace tools like hal may be able to set the persist
attribute automatically when a filesystem is mounted on a USB device.
When that time comes this patch can be reverted, if people think it
matters.

This approach has the advantage of giving the user the ability to turn
off USB-PERSIST for devices with mounted filesystems, rather than
making the kernel always assume it should be on.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:33 -07:00
Alan Stern eb764c4be1 USB: check serial-number string after device reset
This patch (as1048) extends the descriptor checking after a device is
reset.  Now the SerialNumber string descriptor is compared to its old
value, in addition to the device and configuration descriptors.

As a consequence, the kmalloc() call in usb_string() is now on the
error-handling pathway for usb-storage.  Hence its allocation type is
changed to GFO_NOIO.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:33 -07:00
Alan Stern feccc30d90 USB: remove CONFIG_USB_PERSIST setting
This patch (as1047) removes the USB_PERSIST Kconfig option, enabling
it permanently.  It also prevents the power/persist attribute from
being created for hub devices; there's no point in having it since
USB-PERSIST is always turned on for hubs.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:32 -07:00
Alan Stern 5e6effaed6 USB: make USB-PERSIST work after every system sleep
This patch (as1046) makes USB-PERSIST work more in accordance with
the documentation.  Currently it takes effect only in cases where the
root hub has lost power or been reset, but it is supposed to operate
whenever a power session was dropped during a system sleep.

A new hub_restart() routine carries out the duties required during a
reset or a reset-resume.  It checks to see whether occupied ports are
still enabled, and if they aren't then it clears the enable-change and
connect-change features (to prevent interference by khubd) and sets
the child device's reset_resume flag.  It also checks ports that are
supposed to be unoccupied to verify that the firmware hasn't left the
port in an enabled state.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:32 -07:00
Alan Stern 3eb14915a3 USB: reorganize code in hub.c
This patch (as1045) reorganizes some code in the hub driver.
hub_port_status() is moved earlier in the file, and a new hub_stop()
routine is created to do the work currently in hub_preset() (i.e.,
disconnect all child devices and quiesce the hub).

There are no functional changes.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:32 -07:00
Alan Stern 3bb1af5243 USB: EHCI: carry out port handover during each root-hub resume
This patch (as1044) causes EHCI port handover for non-high-speed
devices to occur during every root-hub resume, not just in cases where
the controller lost power or was reset.  This is necessary because:

	When some machines go into suspend, they remove power from
	on-board USB devices while retaining suspend current for USB
	controllers.

	The user might well unplug a USB device while the system is
	suspended and then plug it back in before resuming.

A corresponding change is made to the core resume routine; now
high-speed root hubs will always be resumed when the system wakes up,
even if they were suspended before the system went to sleep.  If this
weren't done then EHCI port handover wouldn't work, since it is called
when the EHCI root hub is resumed.

Finally, a comment is added to the hub driver explaining the khubd has
to be freezable; if it weren't frozen then it could interfere with
port handover.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:32 -07:00
Stefan Seyfried 8f7f85e9f9 USB: Add HP hs2300 Broadband Wireless Module to sierra.c
Add the HP hs2300 Broadband Wireless Module (relabeled MC8775) USB IDs

Signed-off-by: Stefan Seyfried <seife@suse.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:32 -07:00
Ming Lei d4062fcb9e USB: Fix memory leak in mon_stat_release
Fix the leak of the snap structure allocated in mon_stat_open().

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:32 -07:00
Craig Shelley 59fba744da USB: CP2101 Add new device IDs
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:31 -07:00
Matheos Worku a5d6ab56da niu: Add support for Neptune FEM/NEM cards for C10 server blades
[ Minor coding style and whitespace corrections, also bump
  driver version and release date. -DaveM ]

Signed-off-by: Matheos Worku <matheos.worku@sun.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-24 21:09:20 -07:00
Matheos Worku 7f7c4072ea niu: Determine the # of ports from the card's VPD data
[ Fix minor whitespace and coding style stuff... -DaveM ]

Signed-off-by: Matheos Worku <matheos.worku@sun.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-24 21:02:37 -07:00
Tejun Heo 8e5443a098 sata_sis: SCR accessors return -EINVAL when requested SCR isn't available
sis_scr_cfg_read() can't access SError and was incorrectly returning
-1 instead of -EINVAL.  This went unnoticed because SError used to be
cleared in @postreset() and it didn't care about how scr_read() failed
but commit ac371987 moved SError clearing into sata_link_resume() and
SCR access failure other than -EINVAL is considered an error condition
and exposes the incorrect return value bug as detection failure.  Fix
it.

Also, scsi_scr_cfg_write() was incorrectly returning 0 after it
ignored the request to write to SError.  Make it also return -EINVAL.

This was bisected and reported by Patrick McHardy.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-24 23:42:47 -04:00
Harvey Harrison 2b4221bb54 libata: functions with definition should not be extern
Noticed by sparse
drivers/ata/libata-core.c:3380:12: warning: function 'ata_wait_after_reset' with external linkage has definition

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-24 23:42:26 -04:00
Ping Cheng b345dc7da0 Input: wacom - add support for Cintiq 20WSX
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-04-24 23:34:05 -04:00
Nick Forbes 060856c799 leds: Add default-on trigger
Add a trigger which allows LEDs to default to the full
brightness state.

Signed-off-by: Nick Forbes <Nick.Forbes@huntsworth.com>
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
2008-04-25 00:06:52 +01:00