1. 02 10月, 2006 1 次提交
  2. 29 9月, 2006 2 次提交
  3. 28 9月, 2006 13 次提交
    • G
      1b21d5e1
    • A
      usbcore: remove usb_suspend_root_hub · 02c399ee
      Alan Stern 提交于
      This patch (as740) removes the existing support for autosuspend of
      root hubs.  That support fit in rather awkwardly with the rest of
      usbcore and it was used only by ohci-hcd.  It won't be needed any more
      since the hub driver will take care of autosuspending all hubs, root
      or external.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      02c399ee
    • 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
      USB: Turn usb_resume_both() into static inline · 42d8a2d2
      Alexey Dobriyan 提交于
      drivers/usb/core/hub.c: In function `hub_events':
      drivers/usb/core/hub.c:2591: warning: statement with no effect
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      42d8a2d2
    • L
      USB core: Use const where possible. · 095bc335
      Luiz Fernando N. Capitulino 提交于
      This patch marks some USB core's functions parameters as const. This
      improves the design (we're saying to the caller that its parameter is
      not going to be modified) and may help in compiler's optimisation work.
      Signed-off-by: NLuiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      095bc335
    • L
      USB: Make file operations structs in drivers/usb const. · 066202dd
      Luiz Fernando N. Capitulino 提交于
      Making structs const prevents accidental bugs and with the proper debug
      options they're protected against corruption.
      Signed-off-by: NLuiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      066202dd
    • A
      hub driver: improve use of #ifdef · d388dab7
      Alan Stern 提交于
      This patch (as736) makes the hub driver more readable by improving the
      usage of "#ifdef CONFIG_PM" and "#ifdef CONFIG_USB_SUSPEND".
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d388dab7
    • A
      usbcore: track whether interfaces are suspended · 4d064c08
      Alan Stern 提交于
      Currently we rely on intf->dev.power.power_state.event for tracking
      whether intf is suspended.  This is not a reliable technique because
      that value is owned by the PM core, not by usbcore.  This patch (as718b)
      adds a new flag so that we can accurately tell which interfaces are
      suspended and which aren't.
      
      At first one might think these flags aren't needed, since interfaces
      will be suspended along with their devices.  It turns out there are a
      couple of intermediate situations where that's not quite true, such as
      while processing a remote-wakeup request.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4d064c08
    • 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: 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
    • A
      usbcore: rename usb_suspend_device to usb_port_suspend · 140d8f68
      Alan Stern 提交于
      This revised patch (as715b) renames usb_suspend_device to
      usb_port_suspend, usb_resume_device to usb_port_resume, and
      finish_device_resume to finish_port_resume.  There was no objection to
      the original version of the patch so this should be okay to apply.
      
      The revision was needed only because I have re-arranged the order of the
      earlier patches.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      140d8f68
    • A
      usbfs: private mutex for open, release, and remove · 4a2a8a2c
      Alan Stern 提交于
      The usbfs code doesn't provide sufficient mutual exclusion among open,
      release, and remove.  Release vs. remove is okay because they both
      acquire the device lock, but open is not exclusive with either one.  All
      three routines modify the udev->filelist linked list, so they must not
      run concurrently.
      
      Apparently someone gave this a minimum amount of thought in the past by
      explicitly acquiring the BKL at the start of the usbdev_open routine.
      Oddly enough, there's a comment pointing out that locking is unnecessary
      because chrdev_open already has acquired the BKL.
      
      But this ignores the point that the files in /proc/bus/usb/* are not
      char device files; they are regular files and so they don't get any
      special locking.  Furthermore it's necessary to acquire the same lock in
      the release and remove routines, which the code does not do.
      
      Yet another problem arises because the same file_operations structure is
      accessible through both the /proc/bus/usb/* and /dev/usb/usbdev* file
      nodes.  Even when one of them has been removed, it's still possible for
      userspace to open the other.  So simple locking around the individual
      remove routines is insufficient; we need to lock the entire
      usb_notify_remove_device notifier chain.
      
      Rather than rely on the BKL, this patch (as723) introduces a new private
      mutex for the purpose.  Holding the BKL while invoking a notifier chain
      doesn't seem like a good idea.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4a2a8a2c
  4. 01 7月, 2006 1 次提交
  5. 22 6月, 2006 2 次提交
  6. 05 1月, 2006 2 次提交
    • A
      [PATCH] USB: Remove USB private semaphore · 9ad3d6cc
      Alan Stern 提交于
      This patch (as605) removes the private udev->serialize semaphore,
      relying instead on the locking provided by the embedded struct device's
      semaphore.  The changes are confined to the core, except that the
      usb_trylock_device routine now uses the return convention of
      down_trylock rather than down_read_trylock (they return opposite values
      for no good reason).
      
      A couple of other associated changes are included as well:
      
      	Now that we aren't concerned about HCDs that avoid using the
      	hcd glue layer, usb_disconnect no longer needs to acquire the
      	usb_bus_lock -- that can be done by usb_remove_hcd where it
      	belongs.
      
      	Devices aren't locked over the same scope of code in
      	usb_new_device and hub_port_connect_change as they used to be.
      	This shouldn't cause any trouble.
      
      Along with the preceding driver core patch, this needs a lot of testing.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9ad3d6cc
    • G
      [PATCH] USB: reorg some functions out of the main usb.c file · ddae41be
      Greg Kroah-Hartman 提交于
      This will make the dynamic-id stuff easier to do, as it will be
      self-contained.
      
      No logic was changed at all.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ddae41be
  7. 29 10月, 2005 7 次提交
    • A
      [PATCH] usbcore: Fix handling of sysfs strings and other attributes · 4f62efe6
      Alan Stern 提交于
      This patch (as592) makes a few small improvements to the way device
      strings are handled, and it fixes some bugs in a couple of other sysfs
      attribute routines.  (Look at show_configuration_string() to see what I
      mean.)
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4f62efe6
    • G
      a7b986b3
    • G
      [PATCH] USB: add notifier functions to the USB core for devices and busses · 3099e75a
      Greg Kroah-Hartman 提交于
      This should let us get rid of all of the different hooks in the USB core for
      when something has changed.
      
      Also, some other parts of the kernel have wanted to know this kind of
      information at times.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3099e75a
    • G
      [PATCH] USB: remove the global function usbdev_lookup_minor · 4592bf5a
      Greg Kroah-Hartman 提交于
      It's only used locally.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4592bf5a
    • D
      [PATCH] stop exporting two functions · 5edbfb7c
      David Brownell 提交于
      The way we're looking at USB suspend lately doesn't expect drivers to
      call usb_suspend_device() or usb_resume_device() directly; that'll
      be implicit when no interfaces are in use.
      
      This patch removes those APIs from visibility outside usbcore.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      
       drivers/usb/core/hub.c |   12 ++++--------
       drivers/usb/core/usb.h |    4 ++++
       include/linux/usb.h    |    5 -----
       3 files changed, 8 insertions(+), 13 deletions(-)
      5edbfb7c
    • D
      [PATCH] root hub changes (lesser half) · 979d5199
      David Brownell 提交于
      This patch collects various small updates related to root hubs, to shrink
      later patches which build on them.
      
        - For root hub suspend/resume support:
           * Make the existing usb_hcd_resume_root_hub() routine respect pmcore
             locking, exporting and using the dpm_runtime_resume() method.
           * Add a new usb_hcd_suspend_root_hub() to pair with that routine.
             (Essential to make OHCI autosuspend behave again...)
           * HC_SUSPENDED by itself only refers to the root hub's downstream ports.
             So let HCDs see root hub URBs unless the parent device is suspended.
      
        - Remove an assertion we no longer need (and now, also don't want).
      
        - Generic suspend/resume updates to work better with swsusp.
           * Ignore the FREEZE vs SUSPEND distinction for hardware; trying to
             use it breaks the swsusp snapshots it's supposed to help (sigh).
           * On resume, mark devices as resumed right away, but then
             do nothing else if the device is marked NOTATTACHED.
      
      These changes shouldn't be very noticable by themselves.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
       drivers/base/power/runtime.c |    1
       drivers/usb/core/hcd.c       |   64 ++++++++++++++++++++++++++++++++++++++-----
       drivers/usb/core/hcd.h       |    1
       drivers/usb/core/hub.c       |   45 ++++++++++++++++++++++++------
       drivers/usb/core/usb.c       |   20 +++++++++----
       drivers/usb/core/usb.h       |    1
       6 files changed, 111 insertions(+), 21 deletions(-)
      979d5199
    • D
      [PATCH] usb_interface power state · db690874
      David Brownell 提交于
      This updates the handling of power state for USB interfaces.
      
        - Formalizes an existing invariant:  interface "power state" is a boolean:
          ON when I/O is allowed, and FREEZE otherwise.  It does so by defining
          some inlined helpers, then using them.
      
        - Adds a useful invariant:  the only interfaces marked active are those
          bound to non-suspended drivers.  Later patches build on this invariant.
      
        - Simplifies the interface driver API (and removes some error paths) by
          removing the requirement that they record power state changes during
          suspend and resume callbacks.  Now usbcore does that.
      
      A few drivers were simplified to address that last change.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
       drivers/usb/core/hub.c       |   33 +++++++++------------
       drivers/usb/core/message.c   |    1
       drivers/usb/core/usb.c       |   65 +++++++++++++++++++++++++++++++++----------
       drivers/usb/core/usb.h       |   18 +++++++++++
       drivers/usb/input/hid-core.c |    2 -
       drivers/usb/misc/usbtest.c   |   10 ------
       drivers/usb/net/pegasus.c    |    2 -
       drivers/usb/net/usbnet.c     |    2 -
       8 files changed, 85 insertions(+), 48 deletions(-)
      db690874
  8. 11 10月, 2005 1 次提交
  9. 09 9月, 2005 1 次提交
    • K
      [PATCH] USB: real nodes instead of usbfs · fbf82fd2
      Kay Sievers 提交于
      This patch introduces a /sys/class/usb_device/ class
      where every connected usb-device will show up:
      
        tree /sys/class/usb_device/
        /sys/class/usb_device/
        |-- usb1.1
        |   |-- dev
        |   `-- device -> ../../../devices/pci0000:00/0000:00:1d.0/usb1
        |-- usb2.1
        |   |-- dev
        |   `-- device -> ../../../devices/pci0000:00/0000:00:1d.1/usb2
        ...
      
      The presence of the "dev" file lets udev create real device nodes.
        kay@pim:~/src/linux-2.6> tree /dev/bus/usb/
        /dev/bus/usb/
        |-- 1
        |   `-- 1
        |-- 2
        |   `-- 1
        ...
      
      udev rule:
        SUBSYSTEM="usb_device", PROGRAM="/sbin/usb_device %k", NAME="%c"
        (echo $1 | /bin/sed 's/usb\([0-9]*\)\.\([0-9]*\)/bus\/usb\/\1\/\2/')
      
      This makes libusb pick up the real nodes instead of the mounted usbfs:
        export USB_DEVFS_PATH=/dev/bus/usb
      
      Background:
        All this makes it possible to manage usb devices with udev instead of
        the devfs solution. We are currently working on a pam_console/resmgr
        replacement driven by udev and a pam-helper. It applies ACL's to device
        nodes, which is required for modern desktop functionalty like
        "Fast User Switching" or multiple local login support.
      
      New patch with its own major. I've succesfully disabled usbfs and use real
      nodes only on my box. With: "export USB_DEVFS_PATH=/dev/bus/usb" libusb picks
      up the udev managed nodes instead of reading usbfs files.
      
      This makes udev to provide symlinks for libusb to pick up:
        SUBSYSTEM="usb_device", PROGRAM="/sbin/usbdevice %k", SYMLINK="%c"
      
      /sbin/usbdevice:
        #!/bin/sh
        echo $1 | /bin/sed 's/usbdev\([0-9]*\)\.\([0-9]*\)/bus\/usb\/\1\/\2/'
      Signed-off-by: NKay Sievers <kay.sievers@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      fbf82fd2
  10. 19 4月, 2005 1 次提交
  11. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4