An error occurred fetching the project authors.
  1. 12 Jul, 2007 4 commits
    • Alan Stern's avatar
      USB: add USB-Persist facility · 0458d5b4
      Alan Stern authored
      This patch (as886) adds the controversial USB-persist facility,
      allowing USB devices to persist across a power loss during system
      suspend.
      
      The facility is controlled by a new Kconfig option (with appropriate
      warnings about the potential dangers); when the option is off the
      behavior will remain the same as it is now.  But when the option is
      on, people will be able to use suspend-to-disk and keep their USB
      filesystems intact -- something particularly valuable for small
      machines where the root filesystem is on a USB device!
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      0458d5b4
    • Alan Stern's avatar
      USB: move bus_suspend and bus_resume method calls · b6f6436d
      Alan Stern authored
      This patch (as885) moves the root-hub bus_suspend() and bus_resume()
      method calls from the hub driver's suspend and resume methods into the
      usb_generic driver methods, where they make just as much sense.
      
      Their old locations were not fully correct.  For example, in a kernel
      compiled without CONFIG_USB_SUSPEND, if one were to do:
      
      	echo -n 1-0:1.0 >/sys/bus/usb/drivers/hub/unbind
      
      to unbind the hub driver from a root hub, there would then be no way
      to suspend that root hub.  Attempts to put the system to sleep would
      fail; the USB controller driver would refuse to suspend because the
      root hub was still active.
      
      The patch also makes a very slight change in the way devices with no
      driver are handled during suspend.  Rather than doing a standard USB
      port-suspend directly, now the suspend routine in usb_generic is
      called.  In practice this should never affect anyone.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      b6f6436d
    • Alan Stern's avatar
      USB: Implement PM FREEZE and PRETHAW · 4d461095
      Alan Stern authored
      This patch (as884) finally implements the time-saving semantics
      possible with the Power Management FREEZE and PRETHAW events.  Their
      proper handling requires only that devices be quiesced, with
      interrupts and DMA turned off; non-root USB devices don't actually
      need to be put in a suspended state.  The patch checks and avoids
      doing the suspend call when possible.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4d461095
    • Alan Stern's avatar
      USB: interface PM state · 784a6e1c
      Alan Stern authored
      This patch (as880) strives to keep the PM core's idea of a USB
      interface's power state in synch with usbcore's own idea.  In the end
      this doesn't really matter, but it's better to be consistent.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      784a6e1c
  2. 23 May, 2007 1 commit
    • Alan Stern's avatar
      USB: more autosuspend timer stuff · ef7f6c70
      Alan Stern authored
      This patch (as879) ties up some loose ends from an earlier patch.
      These are things I didn't think to include at the time but which
      clearly belonged there.
      
      	If an autosuspend fails because driver activity races with
      	the autosuspend call, restart the autosuspend timer.
      
      	When a device is resumed by an external request, it counts
      	as device activity and should update the last_busy time so
      	that the next autoresume won't occur immediately.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      ef7f6c70
  3. 27 Apr, 2007 8 commits
    • Alan Stern's avatar
      USB: fix signed jiffies issue in autosuspend logic · 8c9862e5
      Alan Stern authored
      This patch (as897) changes the autosuspend timer code to use the
      standard types and macros in dealing with jiffies values.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      
      8c9862e5
    • Alan Stern's avatar
      USB: add "last_busy" field for use in autosuspend · 1941044a
      Alan Stern authored
      This patch (as877) adds a "last_busy" field to struct usb_device, for
      use by the autosuspend framework.  Now if an autosuspend call comes at
      a time when the device isn't busy but hasn't yet been idle for long
      enough, the timer can be set to exactly the desired value.  And we
      will be ready to handle things like HID drivers, which can't maintain
      a useful usage count and must rely on the time-of-last-use to decide
      when to autosuspend.
      
      The patch also makes some related minor improvements:
      
      	Move the calls to the autosuspend condition-checking routine
      	into usb_suspend_both(), which is the only place where it
      	really matters.
      
      	If the autosuspend timer is already running, don't stop
      	and restart it.
      
      	Replace immediate returns with gotos so that the optional
      	debugging ouput won't be bypassed.
      
      	If autoresume is disabled but the device is already awake,
      	don't return an error for an autoresume call.
      
      	Don't try to autoresume a device if it isn't suspended.
      	(Yes, this undercuts the previous change -- so sue me.)
      
      	Don't duplicate existing code in the autosuspend work routine.
      
      	Fix the kerneldoc in usb_autopm_put_interface(): If an
      	autoresume call fails, the usage counter is left unchanged.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      
      1941044a
    • Kay Sievers's avatar
      USB: make usbdevices export their device nodes instead of using a separate class · 9f8b17e6
      Kay Sievers authored
      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: default avatarKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      
      9f8b17e6
    • Alan Stern's avatar
      USB: add power/level sysfs attribute · 2add5229
      Alan Stern authored
      This patch (as874) adds another piece to the user-visible part of the
      USB autosuspend interface.  The new power/level sysfs attribute allows
      users to force the device on (with autosuspend off), force the device
      to sleep (with autoresume off), or return to normal automatic operation.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      2add5229
    • Alan Stern's avatar
      USB: Allow autosuspend delay to equal 0 · eaafbc3a
      Alan Stern authored
      This patch (as867) adds an entry for the new power/autosuspend
      attribute in Documentation/ABI/testing, and it changes the behavior of
      the delay value.  Now a delay of 0 means to autosuspend as soon as
      possible, and negative values will prevent autosuspend.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      eaafbc3a
    • Alan Stern's avatar
      USB: separate autosuspend from external suspend · 6b157c9b
      Alan Stern authored
      This patch (as866) adds new entry points for external USB device
      suspend and resume requests, as opposed to internally-generated
      autosuspend or autoresume.  It also changes the existing
      remote-wakeup code paths to use the new routines, since remote wakeup
      is not the same as autoresume.
      
      As part of the change, it turns out to be necessary to do remote
      wakeup of root hubs from a workqueue.  We had been using khubd, but it
      does autoresume rather than an external resume.  Using the
      ksuspend_usb_wq workqueue for this purpose seemed a logical choice.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      6b157c9b
    • Alan Stern's avatar
      usbcore: move usb_autosuspend_work · 718efa64
      Alan Stern authored
      This patch (as864) moves the work routine for USB autosuspend from one
      source file to another.  This permits the removal of one whole global
      symbol (!) and should smooth the way for more changes in the future.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      718efa64
    • Greg Kroah-Hartman's avatar
      USB: remove use of the bus rwsem, as it doesn't really protect anything. · 341487a8
      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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      341487a8
  4. 23 Feb, 2007 3 commits
  5. 16 Feb, 2007 1 commit
  6. 07 Feb, 2007 2 commits
  7. 01 Dec, 2006 7 commits
  8. 28 Sep, 2006 3 commits
  9. 27 Sep, 2006 11 commits
    • Greg Kroah-Hartman's avatar
    • Alan Stern's avatar
      USB: fix root-hub resume when CONFIG_USB_SUSPEND is not set · 592fbbe4
      Alan Stern authored
      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: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      592fbbe4
    • Alan Stern's avatar
      usbcore: add autosuspend/autoresume infrastructure · 645daaab
      Alan Stern authored
      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: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      645daaab
    • Alan Stern's avatar
      usbcore: suspending devices with no driver · 1c5df7e7
      Alan Stern authored
      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: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      1c5df7e7
    • Alan Stern's avatar
      usbcore: fix up device and power state tests · 114b368c
      Alan Stern authored
      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: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      114b368c
    • Alan Stern's avatar
      usbcore: set device and power states properly · 2bf4086d
      Alan Stern authored
      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: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      2bf4086d
    • Alan Stern's avatar
      usbcore: resume device resume recursion · a8e7c565
      Alan Stern authored
      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: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      a8e7c565
    • Alan Stern's avatar
      usbcore: split suspend/resume for device and interfaces · 1cc8a25d
      Alan Stern authored
      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: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      1cc8a25d
    • Alan Stern's avatar
      usbcore: make usb_generic a usb_device_driver · 782da727
      Alan Stern authored
      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: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      782da727
    • Alan Stern's avatar
      usbcore: add usb_device_driver definition · 8bb54ab5
      Alan Stern authored
      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: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      8bb54ab5
    • Alan Stern's avatar
      usbcore: move code among source files · 36e56a34
      Alan Stern authored
      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: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      
      36e56a34