1. 22 7月, 2008 5 次提交
    • A
      USB: simplify hub_restart() logic · 6ee0b270
      Alan Stern 提交于
      This patch (as1081) straightens out the logic of the hub_restart()
      routine.  Each port of the hub is scanned and the driver makes sure
      that ports which are supposed to be disabled really _are_ disabled.
      Any ports with a significant change in status are flagged in
      hub->change_bits, so that khubd can focus on them without the need to
      scan all the ports a second time -- which means the hub->activating
      flag is no longer needed.
      
      Also, it is now recognized explicitly that the only reason for
      resuming a port which was not suspended is to carry out a reset-resume
      operation, which happens only in a non-CONFIG_USB_SUSPEND setting.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6ee0b270
    • G
      USB: revert "don't use reset-resume if drivers don't support it" · 9e5eace7
      Greg Kroah-Hartman 提交于
      This reverts Linus's previous patch that is in mainline to make it
      easier for the USB hub.c patches that follow this to apply cleanly.  The
      functionality will be added back in a followon patch in this series.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9e5eace7
    • A
      USB: debounce before unregistering · 24618b0c
      Alan Stern 提交于
      This patch (as1080) makes a significant change to the way khubd
      handles port connect-change and enable-change events.  Both types of
      event are now debounced, and the debouncing is carried out _before_ an
      existing usb_device is unregistered, instead of afterward.
      
      This means that drivers will have to deal with longer runs of errors
      when a device is unplugged, but they are supposed to be prepared for
      that in any case.
      
      The advantage is that when an enable-change occurs (caused for example
      by electromagnetic interference), the debouncing period will provide
      time for the cause of the problem to die away.  A simple port reset
      (added in a forthcoming patch) will then allow us to recover from the
      fault.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      24618b0c
    • A
      USB: add new routine for checking port-resume type · b01b03f3
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b01b03f3
    • G
      USB: revert "don't lose disconnections during suspend" · 36aa8117
      Greg Kroah-Hartman 提交于
      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: NGreg Kroah-Hartman <gregkh@suse.de>
      36aa8117
  2. 07 7月, 2008 1 次提交
  3. 04 7月, 2008 1 次提交
  4. 12 6月, 2008 1 次提交
  5. 30 5月, 2008 2 次提交
    • A
      USB: EHCI: suppress unwanted error messages · 3a31155c
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      CC: David Brownell <david-b@pacbell.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3a31155c
    • A
      USB: fix possible deadlock involving sysfs attributes · e16362a0
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e16362a0
  6. 25 4月, 2008 12 次提交
  7. 19 4月, 2008 1 次提交
  8. 02 2月, 2008 6 次提交
  9. 18 12月, 2007 1 次提交
  10. 29 11月, 2007 1 次提交
  11. 19 10月, 2007 1 次提交
  12. 16 10月, 2007 1 次提交
  13. 13 10月, 2007 7 次提交
    • A
      USB: mutual exclusion for EHCI init and port resets · 32fe0198
      Alan Stern 提交于
      This patch (as999) fixes a problem that sometimes shows up when host
      controller driver modules are loaded in the wrong order.  If ehci-hcd
      happens to initialize an EHCI controller while the companion OHCI or
      UHCI controller is in the middle of a port reset, the reset can fail
      and the companion may get very confused.  The patch adds an
      rw-semaphore and uses it to keep EHCI initialization and port resets
      mutually exclusive.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NDavid Brownell <david-b@pacbell.net>
      Cc: David Miller <davem@davemloft.net>
      Cc: Dely L Sy <dely.l.sy@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      32fe0198
    • J
      USB: fix limited_power setting mistake in hub.c · 403fae78
      jidong xiao 提交于
      This patch (jx001) fixes a variable assignment mistake in hub driver.
      limited_power should be set to 0 if the hub is self-powered,and 1 if
      the hub is bus-powered.
      
      However, the effect of the code was exactly opposite to the spec's
      statement for the Local Power Source field. The spec says, this field
      is 1 meaning Local power supply lost while this field is 0 indicating
      Local power supply good.(This statement is very confusing.)
      
      So this patch switchs the 0 and 1.
      Signed-off-by: NJason Xiao <jidong.xiao@gmail.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      403fae78
    • A
      USB: flush outstanding URBs when suspending · 6840d255
      Alan Stern 提交于
      This patch (as989) makes usbcore flush all outstanding URBs for each
      device as the device is suspended.  This will be true even when
      CONFIG_USB_SUSPEND is not enabled.
      
      In addition, an extra can_submit flag is added to the usb_device
      structure.  That flag will be turned off whenever a suspend request
      has been received for the device, even if the device isn't actually
      suspended because CONFIG_USB_SUSPEND isn't set.
      
      It's no longer necessary to check for the device state being equal to
      USB_STATE_SUSPENDED during URB submission; that check can be replaced
      by a check of the can_submit flag.  This also permits us to remove
      some questionable references to the deprecated power.power_state field.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6840d255
    • A
      USB: remove traces of urb->status from usbcore · e015268d
      Alan Stern 提交于
      This patch (as981) removes the remaining nontrivial usages of
      urb->status from usbcore.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e015268d
    • G
      USB: rename choose_configuration · b5ea060f
      Greg Kroah-Hartman 提交于
      As it is global, give it a usb specific name in the global namespace.
      
      Cc: Inaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b5ea060f
    • I
      usb: introduce usb_authorize/deauthorize() · 93993a0a
      Inaky Perez-Gonzalez 提交于
      These USB API functions will do the full authorization/deauthorization
      to be used for a device. When authorized we effectively allow a
      configuration to be set. Reverse that when deauthorized.
      
      Effectively this means that we have to clean all the configuration
      descriptors on deauthorize and reload them when we authorized. We could
      do without throwing them out for wired devices, but for wireless, we can
      read them only after authenticating, and thus, when authorizing an
      authenticated device we would need to read them. So to simplify, always
      release them on deauthorize(), re-read them on authorize().
      
      Also fix leak reported by Ragner Magalhaes; in usb_deauthorize_device(),
      bNumConfigurations was being set to zero before the for loop, and thus
      the different raw descriptors where never being freed.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      93993a0a
    • I
      usb: split usb_new_device for clarity and refactoring · d9d16e8a
      Inaky Perez-Gonzalez 提交于
      This patch takes hub.c:usb_new_device() and splits it in three parts:
      
      - The actual actions of adding a new device (quirk detection,
        announcement and autoresume tracking)
      
      - Actual discovery and probing of the configuration and interfaces
        (split into __usb_configure_device())
      
      - Configuration of the On-the-go parameters (split into
        __usb_configure_device_otg()).
      
      The fundamental reasons for doing this split are clarity (smaller
      functions are easier to maintain) and to allow part of the code to be
      reused when authorizing devices to connect.
      
      When a device is authorized connection, we need to run through the
      hoops we didn't run when it was connected but not authorized, which is
      basically parsing the configurations and probing
      them. usb_configure_device() will do that for us.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d9d16e8a