1. 11 9月, 2007 1 次提交
  2. 23 8月, 2007 1 次提交
  3. 19 7月, 2007 1 次提交
    • D
      dev_vdbg(), available with -DVERBOSE_DEBUG · aebdc3b4
      David Brownell 提交于
      This defines a dev_vdbg() call, which is enabled with -DVERBOSE_DEBUG.
      When enabled, dev_vdbg() acts just like dev_dbg().  When disabled, it is a
      NOP ...  just like dev_dbg() without -DDEBUG.  The specific code was moved
      out of a USB patch, but lots of drivers have similar support.
      
      That is, code can now be written to use an additional level of debug
      output, selected at compile time.  Many driver authors have found this
      idiom to be very useful.  A typical usage model is for "normal" debug
      messages to focus on fault paths and not be very "chatty", so that those
      messages can be left on during normal operation without much of a
      performance or syslog load.  On the other hand "verbose" messages would be
      noisy enough that they wouldn't normally be enabled; they might even affect
      timings enough to change system or driver behavior.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      aebdc3b4
  4. 13 7月, 2007 9 次提交
    • V
      USB: Make usb-autosuspend timer 1 sec jiffy aligned · 8d6d5fd0
      Venki Pallipadi 提交于
      Make usb autosuspend timers 1sec jiffy aligned.
      
      This helps to reduce the frequency at which the CPU must be taken out of a
      lower-power state.
      Signed-off-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8d6d5fd0
    • A
      USB: Remove usages of dev->power.power_state · e7e6da9e
      Alan Stern 提交于
      This patch (as922) removes all but one of the remaining vestiges of
      dev->power.power_state from usbcore.  The only usage left must remain
      until the deprecated "power/state" sysfs attribute is gone.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e7e6da9e
    • A
      USB: add reset_resume method · f07600cf
      Alan Stern 提交于
      This patch (as918) introduces a new USB driver method: reset_resume.
      It is called when a device needs to be reset as part of a resume
      procedure (whether because of a device quirk or because of the
      USB-Persist facility), thereby taking over a role formerly assigned to
      the post_reset method.  As a consequence, post_reset no longer needs
      an argument indicating whether it is being called as part of a
      reset-resume.  This separation of functions makes the code clearer.
      
      In addition, the pre_reset and post_reset method return types are
      changed; they now must return an error code.  The return value is
      unused at present, but at some later time we may unbind drivers and
      re-probe if they encounter an error during reset handling.
      
      The existing pre_reset and post_reset methods in the usbhid,
      usb-storage, and hub drivers are updated to match the new
      requirements.  For usbhid the post_reset routine is also used for
      reset_resume (duplicate method pointers); for the other drivers a new
      reset_resume routine is added.  The change to hub.c looks bigger than
      it really is, because mark_children_for_reset_resume() gets moved down
      next to the new hub_reset_resume() routine.
      
      A minor change to usb-storage makes the usb_stor_report_bus_reset()
      routine acquire the host lock instead of requiring the caller to hold
      it already.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      f07600cf
    • A
      USB: rework C++-style comments · 20dfdad7
      Alan Stern 提交于
      This patch (as911) replaces some C++-style commented-out debugging
      lines in driver.c with a new "verbose debugging" macro.  It makes the
      code look cleaner, and it's easier to turn the debugging on or off.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      20dfdad7
    • A
      USB: add RESET_RESUME device quirk · 6bc6cff5
      Alan Stern 提交于
      This patch (as888) adds a new USB device quirk for devices which are
      unable to resume correctly.  By using the new code added for the
      USB-persist facility, it is a simple matter to reset these devices
      instead of resuming them.  To get things kicked off, a quirk entry is
      added for the Philips PSC805.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6bc6cff5
    • A
      USB: add USB-Persist facility · 0458d5b4
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0458d5b4
    • A
      USB: move bus_suspend and bus_resume method calls · b6f6436d
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b6f6436d
    • A
      USB: Implement PM FREEZE and PRETHAW · 4d461095
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4d461095
    • A
      USB: interface PM state · 784a6e1c
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      784a6e1c
  5. 23 5月, 2007 1 次提交
    • A
      USB: more autosuspend timer stuff · ef7f6c70
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ef7f6c70
  6. 28 4月, 2007 8 次提交
    • A
      USB: fix signed jiffies issue in autosuspend logic · 8c9862e5
      Alan Stern 提交于
      This patch (as897) changes the autosuspend timer code to use the
      standard types and macros in dealing with jiffies values.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      8c9862e5
    • A
      USB: add "last_busy" field for use in autosuspend · 1941044a
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      1941044a
    • 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
    • A
      USB: add power/level sysfs attribute · 2add5229
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2add5229
    • A
      USB: Allow autosuspend delay to equal 0 · eaafbc3a
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      eaafbc3a
    • A
      USB: separate autosuspend from external suspend · 6b157c9b
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6b157c9b
    • A
      usbcore: move usb_autosuspend_work · 718efa64
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      718efa64
    • 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
  7. 24 2月, 2007 3 次提交
  8. 17 2月, 2007 1 次提交
  9. 08 2月, 2007 2 次提交
  10. 02 12月, 2006 7 次提交
  11. 29 9月, 2006 3 次提交
  12. 28 9月, 2006 3 次提交
    • G
      1b21d5e1
    • 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