summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
Commit message (Collapse)AuthorAgeFilesLines
...
* USB: add new routine for checking port-resume typeAlan Stern2008-07-221-26/+63
| | | | | | | | | | | | | | | | | | | This patch (as1070) creates a new subroutine to check whether a device can be resumed. This code is needed even when CONFIG_USB_SUSPEND isn't set, because devices do suspend themselves when the root hub (and hence the entire bus) is suspended, and power sessions can get lost during a system sleep even without individual port suspends. The patch also fixes a loose end in USB-Persist reset-resume handling. When a low- or full-speed device is attached to an EHCI's companion controller, the port handoff during resume will cause the companion port's connect-status-change feature to be set. If that flag isn't cleared, the port-reset code will think it indicates that the device has been unplugged and the reset-resume will fail. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usb dev_set_name() instead of dev->bus_idKay Sievers2008-07-223-5/+4Star
| | | | | | | | | The bus_id field is going away, use the dev_set_name() function to set it properly. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usb dev_name() instead of dev->bus_idKay Sievers2008-07-226-15/+15
| | | | | | | | The bus_id field is going away, use the dev_name() function instead. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: revert "don't lose disconnections during suspend"Greg Kroah-Hartman2008-07-221-4/+11
| | | | | | | | | | | This reverts Alan's previous patch so that the recent Hub changes will apply cleanly. The above mentioned patch was needed for 2.6.26 to work properly. Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Lukas Hejtmanek <xhejtman@ics.muni.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: handle pci_name() being constGreg Kroah-Hartman2008-07-222-2/+2
| | | | | | | | This changes usb_create_hcd() to be able to handle the fact that pci_name() has changed to a constant string. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Merge commit 'v2.6.26' into bkl-removalJonathan Corbet2008-07-146-55/+143
|\
| * Revert "USB: don't explicitly reenable root-hub status interrupts"Linus Torvalds2008-07-063-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e872154921a6b5256a3c412dd69158ac0b135176. Andrey Borzenkov reports that it resulted in a totally hung machine for him when loading the OHCI driver. Extensive netconsole capture with SysRq output shows that modprobe gets stuck in ohci_hub_status_data() when probing and enabling the OHCI controller, see for example http://lkml.org/lkml/2008/7/5/236 for an analysis. The problem appears to be an interrupt flood triggered by the commit that gets reverted, and Andrey confirmed that the revert makes things work for him again. Reported-and-tested-by: Andrey Borzenkov <arvidjaar@mail.ru> Acked-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: David Brownell <david-b@pacbell.net> Cc: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| * USB: don't lose disconnections during suspendAlan Stern2008-07-041-11/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1111) fixes a bug in the hub driver. When a hub resumes, disconnections that occurred while the hub was suspended are lost. A completely different fix for this problem has already been accepted for 2.6.27; however the problem still needs to be handled in 2.6.26. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Lukas Hejtmanek <xhejtman@ics.muni.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * USB: fix interrupt disabling for HCDs with shared interrupt handlersStefan Becker2008-07-041-10/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USB: fix interrupt disabling for HCDs with shared interrupt handlers As has been discussed several times on LKML, IRQF_SHARED | IRQF_DISABLED doesn't work reliably, i.e. a shared interrupt handler CAN'T be certain to be called with interrupts disabled. Most USB HCD handlers use IRQF_DISABLED and therefore havoc can break out if they share their interrupt with a handler that doesn't use it. On my test machine the yenta_socket interrupt handler (no IRQF_DISABLED) was registered before ehci_hcd and one uhci_hcd instance. Therefore all usb_hcd_irq() invocations for ehci_hcd and for one uhci_hcd instance happened with interrupts enabled. That led to random lockups as USB core HCD functions that acquire the same spinlock could be called twice from interrupt handlers. This patch updates usb_hcd_irq() to always disable/restore interrupts. usb_add_hcd() will silently remove any IRQF_DISABLED requested from HCD code. Signed-off-by: Stefan Becker <stefan.becker@nokia.com> Cc: stable <stable@kernel.org> Acked-by: David Brownell <david-b@pacbell.net> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * Merge branch 'for-linus' of ↵Linus Torvalds2008-06-181-0/+3
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: appletouch - implement reset-resume logic Input: i8042 - retry failed CTR writes when resuming Input: i8042 - add Fujitsu-Siemens Amilo Pro V2030 to nomux table Input: pcspkr - remove negative dependency on snd-pcsp Manually fixed up trivial conflict in drivers/usb/core/quirks.c
| | * Input: appletouch - implement reset-resume logicOliver Neukum2008-06-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | On some boxes the touchpad needs to be reinitialized after resume to make it function again. This fixes bugzilla #10825. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
| * | USB: don't use reset-resume if drivers don't support itLinus Torvalds2008-06-121-2/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch tries to identify which devices are able to accept reset-resume handling, by checking that there is at least one interface driver bound and that all of the drivers have a reset_resume method defined. If these conditions don't hold then during resume processing, the device is logicall disconnected. This is only a temporary fix. Later on we will explicitly unbind drivers that can't handle reset-resumes. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: Oliver Neukum <oliver@neukum.org> Cc: Pavel Machek <pavel@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: add another scanner quirkRené Rebe2008-05-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like the HP53{00,70} scanner other devices of the OEM Avision require the USB_QUIRK_STRING_FETCH_255 to correct set a configuration with "recent" Linux kernels. Signed-off-by: René Rebe <rene@exactcode.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: EHCI: suppress unwanted error messagesAlan Stern2008-05-292-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1096) fixes an annoying problem: When a full-speed or low-speed device is plugged into an EHCI controller, it fails to enumerate at high speed and then is handed over to the companion controller. But usbcore logs a misleading and unwanted error message when the high-speed enumeration fails. The patch adds a new HCD method, port_handed_over, which asks whether a port has been handed over to a companion controller. If it has, the error message is suppressed. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: add all configs to the "descriptors" attributeAlan Stern2008-05-291-23/+21Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1094) changes the output of the "descriptors" binary attribute. Now it will contain the device descriptor followed by all the configuration descriptors, not just the descriptor for the current config. Userspace libraries want to have access to the kernel's cached descriptor information, so they can learn about device characteristics without having to wake up suspended devices. So far the only user of this attribute is the new libusb-1.0 library; thus changing its contents shouldn't cause any problems. This should be considered for 2.6.26, if for no other reason than to minimize the range of releases in which the attribute contains only the current config descriptor. Also, it doesn't hurt that the patch removes the device locking -- which was formerly needed in order to know for certain which config was indeed current. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: fix possible deadlock involving sysfs attributesAlan Stern2008-05-292-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a potential deadlock when the usb_generic driver is unbound from a device. The problem is that generic_disconnect() is called with the device lock held, and it removes a bunch of device attributes from sysfs. If a user task happens to be running an attribute method at the time, the removal will block until the method returns. But at least one of the attribute methods (the store routine for power/level) needs to acquire the device lock! This patch (as1093) eliminates the deadlock by moving the calls to create and remove the sysfs attributes from the usb_generic driver into usb_new_device() and usb_disconnect(), where they can be invoked without holding the device lock. Besides, the other sysfs attributes are created when the device is registered and removed when the device is unregistered. So it seems only fitting for the extra attributes to be created and removed at the same time. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | USB: Core: fix race in device_createGreg Kroah-Hartman2008-05-201-3/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | There is a race from when a device is created with device_create() and then the drvdata is set with a call to dev_set_drvdata() in which a sysfs file could be open, yet the drvdata will be NULL, causing all sorts of bad things to happen. This patch fixes the problem by using the new function, device_create_drvdata(). Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | usbdev: BKL pushdownJonathan Corbet2008-06-201-0/+2
| | | | | | | | | | | | Add explicit lock_kernel() calls to usbdev_open() Signed-off-by: Jonathan Corbet <corbet@lwn.net>
* | usbcore: cdev lock_kernel() pushdownJonathan Corbet2008-06-201-0/+3
|/ | | | | | | usb_open() is protected by a down_read(&minor_rwsem), but I'm not sure I trust it to protect everything including subsidiary open() functions. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
* USB: create attributes before sending ueventAlan Stern2008-05-145-58/+96
| | | | | | | | | | | | | | | | | This patch (as1087d) fixes a long-standing problem in usbcore: Device, interface, and endpoint attributes aren't added until _after_ the creation uevent has already been broadcast. Unfortunately there are a few attributes which cannot be created that early. The "descriptors" attribute is binary and so must be created separately. The power-management attributes can't be created until the dev/power/ group exists. And the interface string can vary from one altsetting to another, so it has to be created dynamically. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: fix cannot work usb storage when using ohci-sm501Yoshihiro Shimoda2008-05-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When I used ohci-sm501, hcd_alloc_coherent() in map_urb_for_dma() is not called, because usb_sg_init() always sets URB_NO_TRANSFER_DMA_MAP. dmesg (CONFIG_USB_STORAGE_DEBUG enabled): usb-storage: Bulk Command S 0x43425355 T 0x1 L 36 F 128 Trg 0 LUN 0 CL 6 usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes usb-storage: Status code 0; transferred 31/31 usb-storage: -- transfer complete usb-storage: Bulk command transfer result=0 usb-storage: usb_stor_bulk_transfer_sglist: xfer 36 bytes, 1 entries usb-storage: Status code -75; transferred 0/36 usb-storage: -- babble usb-storage: Bulk data transfer result 0x3 usb-storage: Attempting to get CSW... usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes usb-storage: Status code 0; transferred 13/13 usb-storage: -- transfer complete usb-storage: Bulk status result = 0 usb-storage: Bulk Status S 0x53425355 T 0x1 R 0 Stat 0x0 usb-storage: scsi cmd done, result=0x2 Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* proc: remove proc_busAlexey Dobriyan2008-04-291-2/+2
| | | | | | | | | Remove proc_bus export and variable itself. Using pathnames works fine and is slightly more understandable and greppable. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* usb: don't update devnum for wusb devicesDavid Vrabel2008-04-251-3/+11
| | | | | | | | | | | 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>
* wusb: make ep0_reinit available for modulesInaky Perez-Gonzalez2008-04-252-5/+7
| | | | | | | | | | | | | 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>
* wusb: devices dont use a set addressInaky Perez-Gonzalez2008-04-251-20/+27
| | | | | | | | | | | | 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>
* wusb: teach choose_address() about wireless devicesInaky Perez-Gonzalez2008-04-251-9/+31
| | | | | | | | | 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>
* USB: replace remaining __FUNCTION__ occurrencesHarvey Harrison2008-04-256-47/+47
| | | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usbfs: export the URB_NO_INTERRUPT flag to userspaceAlan Stern2008-04-251-4/+23
| | | | | | | | | | | | | | | | | | | | 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>
* USB: don't explicitly reenable root-hub status interruptsAlan Stern2008-04-253-20/+0Star
| | | | | | | | | | | | | | | | | 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>
* USB: HCDs use the do_remote_wakeup flagAlan Stern2008-04-251-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* USB: log an error message when USB enumeration failsAlan Stern2008-04-251-0/+1
| | | | | | | | | | 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>
* USB: add extension of anchor API, usb_unlink_anchored_urbsOliver Neukum2008-04-251-0/+24
| | | | | | | | | | 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>
* USB: rework sysfs removal of interface filesAlan Stern2008-04-251-4/+3Star
| | | | | | | | | | | | | | | | | | 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>
* USB: clarify usage of hcd->suspend/resume methodsAlan Stern2008-04-252-7/+7
| | | | | | | | | | | | | | | 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>
* USB: root hubs don't lie about their number of TTsAlan Stern2008-04-252-2/+13
| | | | | | | | | | | | | 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>
* USB: fix comments of 2 functions in hcd.cMing Lei2008-04-251-2/+0Star
| | | | | | | | | 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>
* USB: Remove EXPERIMENTAL from dynamic USB minor allocation.Robert P. J. Day2008-04-251-2/+2
| | | | | | | | 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>
* drivers/usb/core/devio.c: suppress warning with 64k PAGE_SIZEAndrew Morton2008-04-251-1/+3
| | | | | | | | | | | | 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>
* USB: remove dev->power.power_stateAlan Stern2008-04-253-15/+4Star
| | | | | | | | | | | | | | | | 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>
* USB: partial USB embedded host supportRobin Getz2008-04-251-5/+8
| | | | | | | | | | | | | | | | | 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>
* USB: ehci tolerates some buggy devicesDavid Brownell2008-04-251-0/+17
| | | | | | | | | | | | | | | | | | | | | 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>
* USB: defines for USB "Link Power Management" (LPM) ECNDavid Brownell2008-04-252-3/+7
| | | | | | | | | | | | | | | | | | 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>
* USB: enable USB-PERSIST by defaultAlan Stern2008-04-251-2/+4
| | | | | | | | | | | | | | | | | | | 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>
* USB: check serial-number string after device resetAlan Stern2008-04-252-16/+51
| | | | | | | | | | | | | | 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>
* USB: remove CONFIG_USB_PERSIST settingAlan Stern2008-04-254-54/+32Star
| | | | | | | | | | | 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>
* USB: make USB-PERSIST work after every system sleepAlan Stern2008-04-251-34/+80
| | | | | | | | | | | | | | | | | | | 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>
* USB: reorganize code in hub.cAlan Stern2008-04-251-26/+32
| | | | | | | | | | | | | 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>
* USB: EHCI: carry out port handover during each root-hub resumeAlan Stern2008-04-252-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* drivers: Remove unnecessary inclusions of asm/semaphore.hMatthew Wilcox2008-04-191-1/+0Star
| | | | | | | | | None of these files use any of the functionality promised by asm/semaphore.h. It's possible that they rely on it dragging in some unrelated header file, but I can't build all these files, so we'll have fix any build failures as they come up. Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
* USB: new quirk flag to avoid Set-InterfaceAlan Stern2008-03-252-1/+7
| | | | | | | | | | | | This patch (as1057) fixes a problem with the X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter; the device crashes when it receives a Set-Interface request. A new quirk (USB_QUIRK_NO_SET_INTF) is introduced and a quirks entry is created for this device. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>