aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/core
AgeCommit message (Collapse)AuthorFilesLines
2007-04-27USB: separate autosuspend from external suspendAlan Stern6-41/+90
This patch (as866) adds new entry points for external USB device suspend and resume requests, as opposed to internally-generated autosuspend or autoresume. It also changes the existing remote-wakeup code paths to use the new routines, since remote wakeup is not the same as autoresume. As part of the change, it turns out to be necessary to do remote wakeup of root hubs from a workqueue. We had been using khubd, but it does autoresume rather than an external resume. Using the ksuspend_usb_wq workqueue for this purpose seemed a logical choice. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-04-27USB: fix race in HCD removalAlan Stern1-3/+5
This patch (as865) fixes a race in the HCD removal code discovered by Milan Plzik. Arrival of an interrupt after the root hub was unregistered could cause the root-hub status timer to start up, even after it was supposed to have been shut down. The problem is fixed by moving the del_timer_sync() call to after the HCD's stop() method, at which time IRQ generation should be disabled. Cc: Milan Plzik <[email protected]> Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-04-27usbcore: move usb_autosuspend_workAlan Stern3-30/+20
This patch (as864) moves the work routine for USB autosuspend from one source file to another. This permits the removal of one whole global symbol (!) and should smooth the way for more changes in the future. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-04-27dev_dbg: check dev_dbg() argumentsDan Williams1-3/+1
Duplicate what Zach Brown did for pr_debug in commit 8b2a1fd1b394c60eaa2587716102dd5e9b4e5990 [[email protected]: fix a couple of things which broke] Signed-off-by: Dan Williams <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-04-27USB: remove use of the bus rwsem, as it doesn't really protect anything.Greg Kroah-Hartman4-22/+7
The driver core stopped using the rwsem a long time ago, yet the USB core still grabbed the lock, thinking it protected something. This patch removes that useless use. Cc: Alan Stern <[email protected]> Cc: Oliver Neukum <[email protected]> Cc: David Brownell <[email protected]> Cc: linux-usb-devel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-03-26USB: another entry for the quirk listOliver Neukum1-1/+2
this scanner disconnects upon suspend. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-03-09USB: kill dead code from hub.cOliver Neukum1-7/+0
this kills residual obsoletet code from hub.c Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-03-09USB: ratelimit debounce error messagesOliver Neukum1-1/+1
flaky hardware can cause a lot of debounce failed messages. To limit the performance impact, a ratelimit should be used. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-03-09USB: set the correct interval for interrupt URBsAlan Stern2-9/+13
This patch (as862) fixes a couple of bugs in the way usbcore handles intervals for interrupt URBs. usb_interrupt_msg (and usb_bulk_msg for backward compatibility) don't set the interval correctly for high-speed devices. proc_do_submiturb() doesn't set it correctly when a bulk URB is submitted to an interrupt endpoint. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-23USB: export autosuspend delay in sysfsAlan Stern3-1/+87
This patch (as861) adds sysfs attributes to expose the autosuspend delay value for each USB device. If the user changes the delay from 0 (no autosuspend) to a positive value, an autosuspend is attempted. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-23USB: make autosuspend delay a module parameterAlan Stern4-10/+26
This patch (as859) makes the default USB autosuspend delay a module parameter of usbcore. By setting the delay value at boot time, users will be able to prevent the system from autosuspending devices which for some reason can't handle it. The patch also stores the autosuspend delay as a per-device value. A later patch will allow the user to change the value, tailoring the delay for each individual device. A delay value of 0 will prevent autosuspend. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-23USB: minor cleanups for sysfs.cAlan Stern1-24/+12
This patch (as858) makes some minor cleanups to sysfs.c in usbcore. Unnecessary tests are removed and a few temp variables are added. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-23USB: add a blacklist for devices that can't handle some things we throw at them.Oliver Neukum6-2/+96
This adds a blacklist to the USB core to handle some autosuspend and string issues that devices have. Originally written by Oliver, but hacked up a lot by Greg. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-23USB: refactor usb device matching and create usb_device_matchGreg Kroah-Hartman2-12/+23
This is needed for the quirk match code. Cc: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-16USB: kernel-doc fixesRandy Dunlap1-0/+1
Fix kernel-doc warnings and in USB core. Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-16USB: unconfigure devices which have config 0Alan Stern4-8/+22
Some USB devices do have a configuration 0, in contravention of the USB spec. Normally 0 is supposed to indicate that a device is unconfigured. While we can't change what the device is doing, we can change usbcore. This patch (as852) allows usb_set_configuration() to accept a config value of -1 as indicating that the device should be unconfigured. The request actually sent to the device will still contain 0 as the value. But even if the device does have a configuration 0, dev->actconfig will be set to NULL and dev->state will be set to USB_STATE_ADDRESS. Without some sort of special-case handling like this, there is no way to unconfigure these non-compliant devices. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-16USB: fix concurrent buffer access in the hub driverAlan Stern1-0/+6
This patch (as849) fixes a bug in the USB hub driver. A single pre-allocated buffer is used for all port status reads, but nothing guarantees exclusive use of the buffer. A mutex is added to provide this guarantee. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-16usbcore: small changes to hub driver's suspend methodAlan Stern1-15/+10
This patch (as847) makes some small changes to the hub driver's suspend method: For root hubs, the status URB should be unlinked and other activity stopped _before_ the bus_suspend method is called. The test for hdev->bus being NULL has been removed, since it can never succeed. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-16USB: Fix apparent typo CONFIG_USB_CDCETHER.Robert P. J. Day1-1/+1
Replace the apparent typo CONFIG_USB_CDCETHER with CONFIG_USB_NET_CDCETHER. Signed-off-by: Robert P. J. Day <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-16USB: fix needless failure under certain conditionsOliver Neukum1-4/+5
in devices.c we have a piece of code for dealing with losing in a race. If we indeed lose the race we don't care whether our own memory allocation worked. The check for that is so early that we return early even if we don't have to. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-16USB: In init_endpoint_class, use PTR_ERR to obtain an errno value, not IS_ERRJosh Triplett1-1/+1
init_endpoint_class calls class_create, and checks the result for an error with IS_ERR; however, if true, it then returns the result of IS_ERR (a boolean) rather than PTR_ERR (the actual errno). Signed-off-by: Josh Triplett <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-07Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6Linus Torvalds14-382/+218
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (70 commits) USB: remove duplicate device id from zc0301 USB: remove duplicate device id from usb_storage USB: remove duplicate device id from keyspan USB: remove duplicate device id from ftdi_sio USB: remove duplicate device id from visor USB: a bit more coding style cleanup usbcore: trivial whitespace fixes usb-storage: use first bulk endpoints, not last EHCI: fix interrupt-driven remote wakeup USB: switch ehci-hcd to new polling scheme USB: autosuspend for usb printer driver USB Input: Added kernel module to support all GTCO CalComp USB InterWrite School products USB: Sierra Wireless auto set D0 USB: usb ethernet gadget recognizes HUSB2DEV USB: list atmel husb2_udc gadget controller USB: gadgetfs AIO tweaks USB: gadgetfs behaves better on userspace init bug USB: gadgetfs race fix USB: gadgetfs simplifications USB: gadgetfs cleanups ...
2007-02-07USB: a bit more coding style cleanupOliver Neukum2-25/+25
I was sitting in a train threatened to be blocked by ice. I took this as a hint to do some more boring work for the common good. Here's a bit more for coding style. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-07usbcore: trivial whitespace fixesOliver Neukum3-107/+107
This patch (as844) makes some trivial whitespace fixes to a few files in usbcore. Oliver did most of the work and Alan added some tidying up. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-07USB: total removal of multithreaded probing in usbOliver Neukum1-43/+21
The whole approach is simply wrong. Forking a thread means that - errors are ignored - locking is ignored Doing this correctly would require major surgery for questionable benefit. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-07usbcore: remove unused bandwith-related codeAlan Stern4-157/+0
This patch (as841) removes from usbcore a couple of support routines meant to help with bandwidth allocation. With the changes to uhci-hcd in the previous patch, these routines are no longer used anywhere. Also removed is the CONFIG_USB_BANDWIDTH option; it no longer does anything and is no longer needed since the HCDs now handle bandwidth issues correctly. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-07USB serial: add dynamic id support to usb-serial coreGreg Kroah-Hartman1-16/+19
Thanks to Johannes Hölzl <[email protected]> for fixing a few things and getting it all working properly. This adds support for dynamic usb ids to the usb serial core. The file "new_id" will show up under the usb serial driver, not the usb driver associated with the usb-serial driver (yeah, it can be a bit confusing at first glance...) This patch also modifies the USB core to allow the usb-serial core to reuse much of the dynamic id logic. Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Johannes Hölzl <[email protected]>
2007-02-07rndis_host learns ActiveSync basicsOle Andre Vadla Ravnas1-8/+20
Windows Mobile 5 based devices described as supporting "ActiveSync": - Speak RNDIS but lack the CDC and union descriptors. This patch updates the cdc ethernet code to fake ACM descriptors we need. - Require RNDIS_MSG_QUERY messages to include a buffer of the size the response should generate. This patch updates the rndis host code to pass this will-be-ignored data. The resulting RNDIS host code has been reported to work with several WM5 based devices. (Note that a fancier patch is available at synce.sf.net.) Some bugfixes, affecting not just ActiveSync: (a) when cleaning up after RNDS init fails, scrub the second interface just like cdc_ether does, so disconnect won't oops. (b) handle peripherals that use the pad-to-end-of-packet option; some devices can't talk to us if that option doesn't work. (c) when choosing configurations, don't forget about an RNDIS config just because the RNDIS driver is dynamically linked. Cleanup, streamlining, bugfixes, Kconfig, and matching hub driver update. Also for paranoia's sake, refuse to talk to something that looks like a real modem instead of RNDIS. Signed-off-by: Ole Andre Vadla Ravnaas <[email protected]> Signed-off-by: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-07usbcore: remove unneeded error checkAlan Stern1-5/+1
This patch (as830) removes some unnecessary error checking. According to the kerneldoc, schedule_work() can't fail. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-07USB: indicate active altsetting in proc/bus/usb/devices fileDavid Brownell1-2/+6
Update /proc/bus/usb/devices output to report active altsettings. Signed-off-by: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-07USB: devio.c add missing INIT_LIST_HEAD()Dan Carpenter1-0/+1
It should hopefully fix the list corruption bug on: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214402 Add a missing INIT_LIST_HEAD() Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-07USB: convert usb class devices to real devicesGreg Kroah-Hartman1-7/+6
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-07USB: move usb_device_class class devices to be real devicesGreg Kroah-Hartman1-12/+12
This moves the usb class devices that control the usbfs nodes to show up in the proper place in the larger device tree. Cc: Kay Sievers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-07USB: add the sysfs driver name to all modulesGreg Kroah-Hartman1-1/+3
This adds the module name to all USB drivers, if they are built into the kernel or not. It will show up in /sys/modules/MODULE_NAME/drivers/ Cc: Kay Sievers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-01-22USB: disable USB_MULTITHREAD_PROBEGreg Kroah-Hartman2-24/+1
Disable the USB_MULTITHREAD_PROBE option because it causes crashes on people's machines and they never remember to actually read the config help files. No one likes this, everyone hates it, I'm going to go eat worms... The full logic will be ripped out later. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-01-05USB: Fixed bug in endpoint release function.Sarah Bailey1-1/+1
Error handling in usb_create_ep_files() is not correct unless the minor number is freed in ep_device_release(). Signed-off-by: Sarah Bailey <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-12-20USB: fix to usbfs_snoop logging of user defined control urbsChris Frey1-1/+5
When sending CONTROL URB's using the usual CONTROL ioctl, logging works fine, but when sending them via SUBMITURB, like VMWare does, the control fields are not logged. This patch fixes that. I didn't see any major changes to devio.c recently, so this patch should apply cleanly to even the latest kernel. I can resubmit if it doesn't. From: Chris Frey <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-12-08[PATCH] struct path: convert usbJosef Sipek1-2/+2
Signed-off-by: Josef Sipek <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-07[PATCH] Add include/linux/freezer.h and move definitions from sched.hNigel Cunningham1-0/+1
Move process freezing functions from include/linux/sched.h to freezer.h, so that modifications to the freezer or the kernel configuration don't require recompiling just about everything. [[email protected]: fix ueagle driver] Signed-off-by: Nigel Cunningham <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Pavel Machek <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-07[PATCH] slab: remove SLAB_DMAChristoph Lameter1-1/+1
SLAB_DMA is an alias of GFP_DMA. This is the last one so we remove the leftover comment too. Signed-off-by: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-07[PATCH] slab: remove SLAB_KERNELChristoph Lameter1-2/+2
SLAB_KERNEL is an alias of GFP_KERNEL. Signed-off-by: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-07[PATCH] slab: remove SLAB_ATOMICChristoph Lameter2-2/+2
SLAB_ATOMIC is an alias of GFP_ATOMIC Signed-off-by: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-05WorkQueue: Fix up arch-specific work items where possibleDavid Howells1-1/+1
Fix up arch-specific work items where possible to use the new work_struct and delayed_work structs. Three places that enqueue bits of their stack and then return have been marked with #error as this is not permitted. Signed-Off-By: David Howells <[email protected]>
2006-12-05Merge branch 'master' of ↵David Howells11-397/+489
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 Conflicts: drivers/infiniband/core/iwcm.c drivers/net/chelsio/cxgb2.c drivers/net/wireless/bcm43xx/bcm43xx_main.c drivers/net/wireless/prism54/islpci_eth.c drivers/usb/core/hub.h drivers/usb/input/hid-core.c net/core/netpoll.c Fix up merge failures with Linus's head and fix new compilation failures. Signed-Off-By: David Howells <[email protected]>
2006-12-01usbcore: remove unused argument in autosuspendAlan Stern5-62/+71
Thanks to several earlier patches, usb_autosuspend_device() and usb_autoresume_device() are never called with a second argument other than 1. This patch (as819) removes the now-redundant argument. It also consolidates some common code between those two routines, putting it into a new subroutine called usb_autopm_do_device(). And it includes a sizable kerneldoc update for the affected functions. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-12-01USB: keep count of unsuspended childrenAlan Stern2-11/+37
This patch (as818b) simplifies autosuspend processing by keeping track of the number of unsuspended children of each USB hub. This will permit us to avoid a good deal of unnecessary work all the time; we will no longer have to create a bunch of workqueue entries to carry out autosuspend requests, only to have them fail because one of the hub's children isn't suspended. The basic idea is simple. There already is a usage counter in the usb_device structure for preventing autosuspends. The patch just increments that counter for every unsuspended child. There's only one tricky part: When a device disconnects we need to remember whether it was suspended at the time (leave the counter alone) or not (decrement the counter). Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-12-01USB hub: simplify remote-wakeup handlingAlan Stern1-23/+20
This patch (as817) simplifies the remote-wakeup processing in the hub driver. Now instead of using a specialized code path, it relies on the standard USB resume routines. The hub_port_resume() function does an initial get_port_status() to see whether the port has already resumed itself (as it does when a remote-wakeup request is sent). This will slow down handling of other resume events slightly, but not enough to matter. The patch also changes the hub_port_status() routine, making it return an error if a short reply is received. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-12-01USB: struct usb_device: change flag to bitflagAlan Stern1-1/+1
This patch (as816) changes an existing flag in the usb_device structure to a bitflag, preparing the way for more bitflags to come in the future. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-12-01USB: Add autosuspend support to the hub driverAlan Stern1-19/+26
This patch (as742b) adds autosuspend/autoresume support to the USB hub driver. The largest aspect of the change is that we no longer need a special flag for root hubs that want to be resumed. Now every hub is autoresumed whenever khubd needs to access it. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-12-01USB: create a new thread for every USB device found during the probe sequenceGreg Kroah-Hartman2-22/+74
Might speed up some systems. If nothing else, a bad driver should not take the whole USB subsystem down with it. Signed-off-by: Greg Kroah-Hartman <[email protected]>