- Mar 07, 2010
-
-
Linus Torvalds authored
The caller of usbfs_conn_disc_event() in some cases (but not always) already holds usbfs_mutex, so trying to protect the event counter with that lock causes nasty deadlocks. The problem was introduced by commit 554f7696 ("USB: Remove BKL from poll()") when the BLK protection was turned into using the mutex instead. So fix this by using an atomic variable instead. And while we're at it, get rid of the atrocious naming of said variable and the waitqueue it is associated with. This also cleans up the unnecessary locking in the poll routine, since the whole point of how the pollwait table works is that you can just add yourself to the waiting list, and then check the condition you're waiting for afterwards - avoiding all races. It also gets rid of the unnecessary dynamic allocation of the device status that just contained a single word. We should use f_version for this, as Dmitry Torokhov points out. That simplifies everything further. Reported-and-tested-by:
Jeff Chua <jeff.chua.linux@gmail.com> Acked-by:
Greg Kroah-Hartman <gregkh@suse.de> Acked-by:
Alan Stern <stern@rowland.harvard.edu> Cc: Oliver Neukum <oliver@neukum.org> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Mar 02, 2010
-
-
Oliver Neukum authored
Replace it by mutex_lock(&file->f_dentry->d_inode->i_mutex); following the example of the generic method Signed-off-by:
Oliver Neukum <oliver@neukum.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Oliver Neukum authored
Replace BKL with usbfs_mutex to protect a global counter and a per file data structure Signed-off-by:
Oliver Neukum <oliver@neukum.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Jan 20, 2010
-
-
Oliver Neukum authored
Memory allocations with GFP_KERNEL can cause IO to a storage device which can fail resulting in a need to reset the device. Therefore GFP_KERNEL cannot be safely used between usb_lock_device() and usb_unlock_device(). Replace by GFP_NOIO. Signed-off-by:
Oliver Neukum <oliver@neukum.org> Cc: stable <stable@kernel.org> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Jul 12, 2009
-
-
Frans Pop authored
Added descriptions (for WIRELESS_CONTROLLER and MISC) were taken from the usb-devices script now included in usbutils. Also sort the classes in the same order as in include/linux/usb/ch9.h for easier comparison for future updates. Signed-off-by:
Frans Pop <elendil@planet.nl> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Mar 24, 2009
-
-
Julia Lawall authored
This set of patches introduces calls to the following set of functions: usb_endpoint_dir_in(epd) usb_endpoint_dir_out(epd) usb_endpoint_is_bulk_in(epd) usb_endpoint_is_bulk_out(epd) usb_endpoint_is_int_in(epd) usb_endpoint_is_int_out(epd) usb_endpoint_num(epd) usb_endpoint_type(epd) usb_endpoint_xfer_bulk(epd) usb_endpoint_xfer_control(epd) usb_endpoint_xfer_int(epd) usb_endpoint_xfer_isoc(epd) In some cases, introducing one of these functions is not possible, and it just replaces an explicit integer value by one of the following constants: USB_ENDPOINT_XFER_BULK USB_ENDPOINT_XFER_CONTROL USB_ENDPOINT_XFER_INT USB_ENDPOINT_XFER_ISOC An extract of the semantic patch that makes these changes is as follows: (http://www.emn.fr/x-info/coccinelle/ ) // <smpl> @r1@ struct usb_endpoint_descriptor *epd; @@ - ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) == - \(USB_ENDPOINT_XFER_CONTROL\|0\)) + usb_endpoint_xfer_control(epd) @r5@ struct usb_endpoint_descriptor *epd; @@ - ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) == - \(USB_DIR_IN\|0x80\)) + usb_endpoint_dir_in(epd) @inc@ @@ #include <linux/usb.h> @depends on !inc && (r1||r5)@ @@ + #include <linux/usb.h> #include <linux/usb/...> // </smpl> Signed-off-by:
Julia Lawall <julia@diku.dk> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Jul 21, 2008
-
-
Felipe Balbi authored
We can't allow hubs on the 7th tier as they would allow devices on the 8th tier. Signed-off-by:
Felipe Balbi <felipe.balbi@nokia.com> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Adrian Bunk authored
This patch removes CVS keywords that weren't updated for a long time from comments. Signed-off-by:
Adrian Bunk <bunk@kernel.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Feb 01, 2008
-
-
Greg Kroah-Hartman authored
Fixes a number of coding style issues in the devices.c file. Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Jul 12, 2007
-
-
Craig W. Nadler authored
USB_IAD: Adds support for USB Interface Association Descriptors. This patch adds support to the USB host stack for parsing, storing, and displaying Interface Association Descriptors. In /proc/bus/usb/devices lines starting with A: show the fields in an IAD. In sysfs if an interface on a USB device is referenced by an IAD the following files will be added to the sysfs directory for that interface: iad_bFirstInterface, iad_bInterfaceCount, iad_bFunctionClass, and iad_bFunctionSubClass, iad_bFunctionProtocol Signed-off-by:
Craig W. Nadler <craig@nadler.us> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Apr 27, 2007
-
-
Greg Kroah-Hartman authored
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 <stern@rowland.harvard.edu> Cc: Oliver Neukum <oneukum@suse.de> Cc: David Brownell <david-b@pacbell.net> Cc: linux-usb-devel <linux-usb-devel@lists.sourceforge.net> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Feb 16, 2007
-
-
Oliver Neukum authored
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 <oneukum@suse.de> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Feb 07, 2007
-
-
Oliver Neukum authored
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 <oneukum@suse.de> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
David Brownell authored
Update /proc/bus/usb/devices output to report active altsettings. Signed-off-by:
David Brownell <dbrownell@users.sourceforge.net> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Dec 01, 2006
-
-
Luiz Fernando N. Capitulino authored
Signed-off-by:
Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Sep 27, 2006
-
-
Tobias Klauser authored
The patch removes unneeded casts for the following (void *) pointers: - struct file: private - struct urb: context - struct usb_bus: hcpriv - return value of kmalloc() The patch also contains some whitespace cleanup in the relevant areas. Signed-off-by:
Tobias Klauser <tklauser@distanz.ch> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Luiz Fernando N. Capitulino authored
Making structs const prevents accidental bugs and with the proper debug options they're protected against corruption. Signed-off-by:
Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Mar 20, 2006
-
-
Arjan van de Ven authored
the patch below converts a bunch of semaphores-used-as-mutex in the USB code to mutexes Signed-off-by:
Arjan van de Ven <arjan@infradead.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Jan 04, 2006
-
-
Arjan van de Ven authored
patch below marks various USB tables and variables as const so that they end up in .rodata section and don't cacheline share with things that get written to. For the non-array variables it also allows gcc to optimize more. Signed-off-by:
Arjan van de Ven <arjan@infradead.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Alan Stern authored
This patch (as605) removes the private udev->serialize semaphore, relying instead on the locking provided by the embedded struct device's semaphore. The changes are confined to the core, except that the usb_trylock_device routine now uses the return convention of down_trylock rather than down_read_trylock (they return opposite values for no good reason). A couple of other associated changes are included as well: Now that we aren't concerned about HCDs that avoid using the hcd glue layer, usb_disconnect no longer needs to acquire the usb_bus_lock -- that can be done by usb_remove_hcd where it belongs. Devices aren't locked over the same scope of code in usb_new_device and hub_port_connect_change as they used to be. This shouldn't cause any trouble. Along with the preceding driver core patch, this needs a lot of testing. Signed-off-by:
Alan Stern <stern@rowland.harvard.edu> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Jun 20, 2005
-
-
Dmitry Torokhov authored
Driver core: change driver's, bus's, class's and platform device's names to be const char * so one can use const char *drv_name = "asdfg"; when initializing structures. Also kill couple of whitespaces. Signed-off-by:
Dmitry Torokhov <dtor@mail.ru> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Apr 19, 2005
-
-
Jesper Juhl authored
Get rid of a bunch of redundant NULL pointer checks in drivers/usb/*, there's no need to check a pointer for NULL before calling kfree() on it. Signed-off-by:
Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de> Index: gregkh-2.6/drivers/usb/class/audio.c ===================================================================
-
Greg KH authored
Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de> Index: gregkh-2.6/drivers/usb/core/usb.h ===================================================================
-
- Apr 16, 2005
-
-
Linus Torvalds authored
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
-