Skip to content
Snippets Groups Projects
  1. Mar 07, 2010
    • Linus Torvalds's avatar
      usbfs: fix deadlock on 'usbfs_mutex', clean up poll · 7bc80cd9
      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: default avatarJeff Chua <jeff.chua.linux@gmail.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Cc: Oliver Neukum <oliver@neukum.org>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7bc80cd9
  2. Mar 02, 2010
  3. Jan 20, 2010
  4. Jul 12, 2009
  5. Mar 24, 2009
    • Julia Lawall's avatar
      USB: drivers: use USB API functions rather than constants · 2e0fe709
      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: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      2e0fe709
  6. Jul 21, 2008
  7. Feb 01, 2008
  8. Jul 12, 2007
    • Craig W. Nadler's avatar
      USB: add IAD support to usbfs and sysfs · 165fe97e
      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: default avatarCraig W. Nadler <craig@nadler.us>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      165fe97e
  9. Apr 27, 2007
  10. Feb 16, 2007
  11. Feb 07, 2007
  12. Dec 01, 2006
  13. Sep 27, 2006
  14. Mar 20, 2006
  15. Jan 04, 2006
    • Arjan van de Ven's avatar
      [PATCH] USB: mark various usb tables const · 4c4c9432
      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: default avatarArjan van de Ven <arjan@infradead.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4c4c9432
    • Alan Stern's avatar
      [PATCH] USB: Remove USB private semaphore · 9ad3d6cc
      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: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9ad3d6cc
  16. Jun 20, 2005
  17. Apr 19, 2005
  18. Apr 16, 2005
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      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!
      v2.6.12-rc2
      1da177e4
Loading