1. 28 9月, 2006 10 次提交
    • A
      USB: fix root-hub resume when CONFIG_USB_SUSPEND is not set · 592fbbe4
      Alan Stern 提交于
      This patch (as786) removes a redundant test and fixes a problem
      involving repeated system sleeps when CONFIG_USB_SUSPEND is not set.
      During the first wakeup, the root hub's dev.power.power_state.event
      field doesn't get updated, causing it not to be suspended during the
      second sleep transition.
      
      This takes care of the issue raised by Rafael J. Wysocki and Mattia
      Dongili.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      592fbbe4
    • A
      usbcore: add autosuspend/autoresume infrastructure · 645daaab
      Alan Stern 提交于
      This patch (as739) adds the basic infrastructure for USB autosuspend
      and autoresume.  The main features are:
      
      	PM usage counters added to struct usb_device and struct
      	usb_interface, indicating whether it's okay to autosuspend
      	them or they are currently in use.
      
      	Flag added to usb_device indicating whether the current
      	suspend/resume operation originated from outside or as an
      	autosuspend/autoresume.
      
      	Flag added to usb_driver indicating whether the driver
      	supports autosuspend.  If not, no device bound to the driver
      	will be autosuspended.
      
      	Mutex added to usb_device for protecting PM operations.
      	Unlike the device semaphore, the locking rule for the pm_mutex
      	is that you must acquire the locks going _up_ the device tree.
      
      	New routines handling autosuspend/autoresume requests for
      	interfaces and devices.
      
      	Suspend and resume requests are propagated up the device tree
      	(but not outside the USB subsystem).
      
      	work_struct added to usb_device, for carrying out delayed
      	autosuspend requests.
      
      	Autoresume added (and autosuspend prevented) during probe and
      	disconnect.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      645daaab
    • A
      usbcore: suspending devices with no driver · 1c5df7e7
      Alan Stern 提交于
      Since usb_generic can be unbound from a USB device, we need to be able
      to handle the possibility that a suspend or resume request arrives for a
      device with no driver.  This patch (as735) arranges things so that
      resume requests will fail and suspend requests will use the standard USB
      port-suspend code.  Attempts to suspend or resume an unbound interface
      are handled similarly (although the error caused by trying to resume an
      unbound interface is dropped by the calling routine).
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1c5df7e7
    • A
      usbcore: fix up device and power state tests · 114b368c
      Alan Stern 提交于
      This patch (as734) rationalizes the various tests of device state and
      power states.  There are duplications and mistaken tests in several
      places.
      
      Perhaps the most interesting challenge is where the hub driver tests to
      see that all the child devices are suspended before allowing itself to
      be suspended.  When CONFIG_USB_SUSPEND is set the test is
      straightforward, since we expect that the children _will_ be suspended.
      But when CONFIG_USB_SUSPEND isn't set, it's not so clear what should be
      done.  The code compromises by checking the child's
      power.power_state.event field.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      114b368c
    • A
      usbcore: set device and power states properly · 2bf4086d
      Alan Stern 提交于
      This patch (as733) fixes up the places where device states and power
      states are set in usbcore.  Right now things are duplicated or missing;
      this should straighten things out.
      
      The idea is that udev->state is USB_STATE_SUSPENDED exactly when the
      device's upstream port has been suspended, whereas
      udev->dev.power.power_state.event reflects the result of the last call
      to the suspend/resume routines (which might not actually change the
      device state, especially if CONFIG_USB_SUSPEND isn't set).
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2bf4086d
    • A
      usbcore: resume device resume recursion · a8e7c565
      Alan Stern 提交于
      This patch (as717b) removes the existing recursion in hub resume code:
      Resuming a hub will no longer automatically resume the devices attached
      to the hub.
      
      At the same time, it adds one level of recursion: Suspending a USB
      device will automatically suspend all the device's interfaces.  Failure
      at an intermediate stage will cause all the already-suspended interfaces
      to be resumed. Attempts to suspend or resume an interface by itself will
      do nothing, although they won't return an error.  Thus the regular
      system-suspend and system-resume procedures should continue to work as
      before; only runtime PM will be affected.
      
      The patch also removes the code that tests state of the interfaces
      before suspending a device.  It's no longer needed, since everything
      gets suspended together.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a8e7c565
    • A
      usbcore: split suspend/resume for device and interfaces · 1cc8a25d
      Alan Stern 提交于
      This patch (as716b) splits up the core suspend and resume routines into
      two parts each: one for handling devices and one for handling
      interfaces.  The behavior of the parts should be the same as in the old
      unified code.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1cc8a25d
    • A
      usbcore: make usb_generic a usb_device_driver · 782da727
      Alan Stern 提交于
      This patch (as714b) makes usb_generic into a usb_device_driver capable
      of being probed and unbound, just like other drivers.  A fair amount of
      the work that used to get done during discovery or removal of a USB
      device have been moved to the probe and disconnect methods of
      usb_generic: creating the sysfs attributes and selecting an initial
      configuration.  However the normal behavior should continue to be the
      same as before.
      
      We will now have the possibility of creating other USB device drivers,
      They will assist with exporting devices to remote systems
      (USB-over-TCPIP) or to paravirtual guest operating systems.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      782da727
    • A
      usbcore: add usb_device_driver definition · 8bb54ab5
      Alan Stern 提交于
      This patch (as732) adds a usb_device_driver structure, for representing
      drivers that manage an entire USB device as opposed to just an
      interface.  Support routines like usb_register_device_driver,
      usb_deregister_device_driver, usb_probe_device, and usb_unbind_device
      are also added.
      
      Unlike an earlier version of this patch, the new code is type-safe.  To
      accomplish this, the existing struct driver embedded in struct
      usb_driver had to be wrapped in an intermediate wrapper.  This enables
      the core to tell at runtime whether a particular struct driver belongs
      to a device driver or to an interface driver.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8bb54ab5
    • A
      usbcore: move code among source files · 36e56a34
      Alan Stern 提交于
      This revised patch (as713b) moves a few routines among source files in
      usbcore.  Some driver-related code in usb.c (claiming interfaces and
      matching IDs) is moved to driver.c, where it belongs.  Also the
      usb_generic stuff in driver.c is moved to a new source file: generic.c.
      (That's the reason for revising the patch.)  Although not very big now,
      it will get bigger in a later patch.
      
      None of the code has been changed; it has only been re-arranged.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      36e56a34
  2. 01 7月, 2006 1 次提交
  3. 21 3月, 2006 1 次提交
  4. 06 2月, 2006 1 次提交
  5. 05 1月, 2006 5 次提交