1. 18 10月, 2008 1 次提交
  2. 14 8月, 2008 1 次提交
  3. 06 8月, 2008 1 次提交
    • A
      Fix USB storage hang on command abort · 580da348
      Alan Stern 提交于
      Okay, I found the cause of the hang.  It is a simple bug in the USB
      scatter-gather library, caused by changes added in response to the S-G
      chaining modification.
      
      This patch (as1125) fixes a bug in the USB scatter-gather library.
      Early exit from the S-G initialization loop does not reset the count of
      outstanding URBs.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      580da348
  4. 22 7月, 2008 4 次提交
  5. 15 5月, 2008 1 次提交
    • A
      USB: create attributes before sending uevent · 2e5f10e4
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2e5f10e4
  6. 03 5月, 2008 1 次提交
    • Y
      USB: fix cannot work usb storage when using ohci-sm501 · e2722528
      Yoshihiro Shimoda 提交于
      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: NYoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e2722528
  7. 25 4月, 2008 3 次提交
  8. 25 3月, 2008 1 次提交
  9. 02 2月, 2008 2 次提交
  10. 29 11月, 2007 2 次提交
    • A
      USB: uevent environment key fix · 4a9bee82
      Alan Stern 提交于
      This patch (as1010) was written by both Kay Sievers and me.  It solves
      the problem of duplicated keys in USB uevent structures by refactoring
      the uevent subroutines, taking advantage of the way the hotplug core
      calls uevent handlers for the device's bus and for the device's type.
      Keys needed for both USB-device and USB-interface events are added in
      usb_uevent(), which is the bus handler.  Keys appropriate only for
      USB-device or USB-interface events are added in usb_dev_uevent() or
      usb_if_uevent() respectively, the type handlers.
      
      In addition, unnecessary tests for NULL pointers are removed as are
      duplicated debugging log statements.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4a9bee82
    • A
      USB: keep track of whether interface sysfs files exist · 7e61559f
      Alan Stern 提交于
      This patch (as1009) solves the problem of multiple registrations for
      USB sysfs files in a more satisfying way than the existing code.  It
      simply adds a flag to keep track of whether or not the files have been
      created; that way the files can be created or removed as needed.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      7e61559f
  11. 30 10月, 2007 1 次提交
  12. 26 10月, 2007 1 次提交
    • A
      USB: fix interface sysfs file-creation bug · 439a903a
      Alan Stern 提交于
      This patch (as1005) fixes a rather subtle problem.  When
      usb_set_configuration() registers the interfaces and their files in
      sysfs, it doesn't expect those files to exist already.  But when an
      interface is registered, its driver may call usb_set_interface() and
      thereby cause the sysfs files to be created.  The result is an error
      when usb_set_configuration() goes on to create those same files again.
      
      The (not-so-great) solution is to have usb_set_configuration() remove
      any existing files before creating them.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      439a903a
  13. 24 10月, 2007 1 次提交
  14. 23 10月, 2007 1 次提交
  15. 19 10月, 2007 1 次提交
    • J
      Add missing newlines to some uses of dev_<level> messages · 898eb71c
      Joe Perches 提交于
      Found these while looking at printk uses.
      
      Add missing newlines to dev_<level> uses
      Add missing KERN_<level> prefixes to multiline dev_<level>s
      Fixed a wierd->weird spelling typo
      Added a newline to a printk
      Signed-off-by: NJoe Perches <joe@perches.com>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Mark M. Hoffman <mhoffman@lightlink.com>
      Cc: Roland Dreier <rolandd@cisco.com>
      Cc: Tilman Schmidt <tilman@imap.cc>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: Stephen Hemminger <shemminger@linux-foundation.org>
      Cc: Greg KH <greg@kroah.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: James Smart <James.Smart@Emulex.Com>
      Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
      Cc: "Antonino A. Daplas" <adaplas@pol.net>
      Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Jaroslav Kysela <perex@suse.cz>
      Cc: Takashi Iwai <tiwai@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      898eb71c
  16. 13 10月, 2007 7 次提交
    • A
      USB: break apart flush_endpoint and disable_endpoint · 95cf82f9
      Alan Stern 提交于
      This patch (as988) breaks usb_hcd_endpoint_disable() apart into two
      routines.  The first, usb_hcd_flush_endpoint() does the -ESHUTDOWN
      unlinking of all URBs in the endpoint's queue and waits for them to
      complete.  The second, usb_hcd_disable_endpoint() -- renamed for
      better grammatical style -- merely calls the HCD's endpoint_disable
      method.  The changeover is easy because the routine currently has only
      one caller.
      
      This separation of function will be exploited in the following patch:
      When a device is suspended, the core will be able to cancel all
      outstanding URBs for that device while leaving the HCD's
      endpoint-related data structures intact for later.
      
      As an added benefit, HCDs no longer need to check for existing URBs in
      their endpoint_disable methods.  It is now guaranteed that there will
      be none.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      95cf82f9
    • A
      USB: don't touch sysfs stuff when altsetting is unchanged · d74d4a69
      Alan Stern 提交于
      This patch (as955) prevents the interface-related sysfs files and
      endpoint pseudo-devices from being deleted and recreated when a call
      to usb_set_interface() specifies the current altsetting.  Since the
      altsetting doesn't get changed, there's no need to do anything.
      
      Furthermore, avoiding changes to the endpoint devices will be
      necessary in the future.  This code is called from usb_reset_device(),
      which gets invoked for reset-resume processing, but upcoming changes
      to the PM and driver cores will make it impossible to register devices
      while a suspend/resume transition is in progress.  Since we don't need
      to re-register those endpoint devices anyhow, it's best to skip the
      whole thing.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d74d4a69
    • G
      USB: make usb_release_interface static · b0e396e3
      Greg Kroah-Hartman 提交于
      No one else calls it, this makes sparse happy.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b0e396e3
    • I
      usb: usb_set_configuration() obeys authorization · 16bbab29
      Inaky Perez-Gonzalez 提交于
      Will refuse to configure a non-authorized device.
      
      Update: simplified if statement--thanks to Ragner Magalhaes for the
      heads up.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      16bbab29
    • A
      USB: avoid using urb->pipe in usbcore · 5e60a161
      Alan Stern 提交于
      This patch (as946) eliminates many of the uses of urb->pipe in
      usbcore.  Unfortunately there will have to be a significant API
      change, affecting all USB drivers, before we can remove it entirely.
      This patch contents itself with changing only the interface to
      usb_buffer_map_sg() and friends: The pipe argument is replaced with a
      direction flag.  That can be done easily because those routines get
      used in only one place.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      5e60a161
    • A
      USB: add ep->enable · bdd016ba
      Alan Stern 提交于
      This patch (as944) adds an explicit "enabled" field to the
      usb_host_endpoint structure and uses it in place of the current
      mechanism.  This is merely a time-space tradeoff; it makes checking
      whether URBs may be submitted to an endpoint simpler.  The existing
      mechanism is efficient when converting urb->pipe to an endpoint
      pointer, but it's not so efficient when urb->ep is used instead.
      
      As a side effect, the procedure for enabling an endpoint is now a
      little more complicated.  The ad-hoc inline code in usb.c and hub.c
      for enabling ep0 is now replaced with calls to usb_enable_endpoint,
      which is no longer static.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bdd016ba
    • K
      Driver core: change add_uevent_var to use a struct · 7eff2e7a
      Kay Sievers 提交于
      This changes the uevent buffer functions to use a struct instead of a
      long list of parameters. It does no longer require the caller to do the
      proper buffer termination and size accounting, which is currently wrong
      in some places. It fixes a known bug where parts of the uevent
      environment are overwritten because of wrong index calculations.
      
      Many thanks to Mathieu Desnoyers for finding bugs and improving the
      error handling.
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      7eff2e7a
  17. 23 8月, 2007 2 次提交
  18. 31 7月, 2007 2 次提交
  19. 20 7月, 2007 1 次提交
  20. 13 7月, 2007 2 次提交
    • C
      USB: add IAD support to usbfs and sysfs · 165fe97e
      Craig W. Nadler 提交于
      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: NCraig W. Nadler <craig@nadler.us>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      165fe97e
    • A
      USB: Fix off-by-1 error in the scatter-gather library · 8ccef0df
      Alan Stern 提交于
      The loop in usb_sg_wait() is structured in a way that makes it hard to
      tell, when the loop exits, whether or not the last URB submission
      succeeded.  This patch (as928) changes it from a "for" loop to a
      "while" loop and keeps "i" always equal to the number of successful
      submissions.  This fixes an off-by-one error which can show up when
      the first URB submission fails.
      
      The patch also removes a couple of lines that initialize fields which
      don't need to be initialized.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8ccef0df
  21. 23 5月, 2007 1 次提交
  22. 28 4月, 2007 3 次提交
    • T
      USB: Allow transfer_buffer with transfer_dma · 35d07fd5
      Tony Lindgren 提交于
      Some host controller drivers may need a PIO fallback when a DMA channel
      is temporarily unavailable.  This patch provides an address that such
      drivers can use for PIO in those cases, and nulls that field out when
      no such address is available (highmem) which should help usbmon.
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      35d07fd5
    • K
      USB: make usbdevices export their device nodes instead of using a separate class · 9f8b17e6
      Kay Sievers 提交于
      o The "real" usb-devices export now a device node which can
        populate /dev/bus/usb.
      
      o The usb_device class is optional now and can be disabled in the
        kernel config. Major/minor of the "real" devices and class devices
        are the same.
      
      o The environment of the usb-device event contains DEVNUM and BUSNUM to
        help udev and get rid of the ugly udev rule we need for the class
        devices.
      
      o The usb-devices and usb-interfaces share the same bus, so I used
        the new "struct device_type" to let these devices identify
        themselves. This also removes the current logic of using a magic
        platform-pointer.
        The name of the device_type is also added to the environment
        which makes it easier to distinguish the different kinds of devices
        on the same subsystem.
      
        It looks like this:
          add@/devices/pci0000:00/0000:00:1d.1/usb2/2-1
          ACTION=add
          DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb2/2-1
          SUBSYSTEM=usb
          SEQNUM=1533
          MAJOR=189
          MINOR=131
          DEVTYPE=usb_device
          PRODUCT=46d/c03e/2000
          TYPE=0/0/0
          BUSNUM=002
          DEVNUM=004
      
      This udev rule works as a replacement for usb_device class devices:
        SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
          NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"
      
      Updated patch, which needs the device_type patches in Greg's tree.
      
      I also got a bugzilla assigned for this. :)
        https://bugzilla.novell.com/show_bug.cgi?id=250659Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      9f8b17e6
    • G
      USB: remove use of the bus rwsem, as it doesn't really protect anything. · 341487a8
      Greg Kroah-Hartman 提交于
      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: NGreg Kroah-Hartman <gregkh@suse.de>
      341487a8