1. 05 1月, 2006 11 次提交
    • A
      [PATCH] USB: Store port number in usb_device · 12c3da34
      Alan Stern 提交于
      This patch (as610) adds a field to struct usb_device to store the device's
      port number.  This allows us to remove several loops in the hub driver
      (searching for a particular device among all the entries in the parent's
      array of children).
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      12c3da34
    • A
      [PATCH] USB: Consider power budget when choosing configuration · 55c52718
      Alan Stern 提交于
      This patch (as609) changes the way we keep track of power budgeting for
      USB hubs and devices, and it updates the choose_configuration routine to
      take this information into account.  (This is something we should have
      been doing all along.)  A new field in struct usb_device holds the amount
      of bus current available from the upstream port, and the usb_hub structure
      keeps track of the current available for each downstream port.
      
      Two new rules for configuration selection are added:
      
      	Don't select a self-powered configuration when only bus power
      	is available.
      
      	Don't select a configuration requiring more bus power than is
      	available.
      
      However the first rule is #if-ed out, because I found that the internal
      hub in my HP USB keyboard claims that its only configuration is
      self-powered.  The rule would prevent the configuration from being chosen,
      leaving the hub & keyboard unconfigured.  Since similar descriptor errors
      may turn out to be fairly common, it seemed wise not to include a rule
      that would break automatic configuration unnecessarily for such devices.
      
      The second rule may also trigger unnecessarily, although this should be
      less common.  More likely it will annoy people by sometimes failing to
      accept configurations that should never have been chosen in the first
      place.
      
      The patch also changes usbcore's reaction when no configuration is
      suitable.  Instead of raising an error and rejecting the device, now
      the core will simply leave the device unconfigured.  People can always
      work around such problems by installing configurations manually through
      sysfs.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      55c52718
    • A
      [PATCH] USB: Fix locking for USB suspend/resume · 4bf0ba86
      Alan Stern 提交于
      The earlier USB locking updates didn't touch the suspend/resume
      routines.  They need updating as well, since now the caller holds the
      device semaphore.  This patch (as608) makes the necessary changes.  It
      also adds a line to store the correct power state when a device is
      resumed, something which was unaccountably missing.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4bf0ba86
    • A
      [PATCH] USB: Disconnect children during hub unbind · 7d069b7d
      Alan Stern 提交于
      This patch (as606b) is an updated version of my earlier patch to
      disconnect children from a hub device when the hub driver is unbound.
      Thanks to the changes in the driver core locking, we now know that the
      entire hub device (and not just the interface) is locked whenever the
      hub driver's disconnect method runs.  Hence it is safe to disconnect the
      child device structures immediately instead of deferring the job.
      
      The earlier version of the patch neglected to disable the hub's ports.
      We don't want to forget that; otherwise we'd end up with live devices
      using addresses that have been recycled.  This update adds the necessary
      code.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7d069b7d
    • 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: remove .owner field from struct usb_driver · 75318d2d
      Greg Kroah-Hartman 提交于
      It is no longer needed, so let's remove it, saving a bit of memory.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      75318d2d
    • G
      [PATCH] USB: make registering a usb driver automatically set the module owner · 2143acc6
      Greg Kroah-Hartman 提交于
      This fixes the driver that forgot to set the module owner up.  Now we
      can remove the unneeded pointer from the usb driver structure.  The idea
      for how to do this was from Al Viro, who did this for the PCI drivers.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2143acc6
    • G
      [PATCH] USB: allow usb drivers to disable dynamic ids · ba9dc657
      Greg Kroah-Hartman 提交于
      This lets drivers, like the usb-serial ones, disable the ability to add
      ids from sysfs.
      
      The usb-serial drivers are "odd" in that they are really usb-serial bus
      drivers, not usb bus drivers, so the dynamic id logic will have to go
      into the usb-serial bus core for those drivers to get that ability.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ba9dc657
    • G
      [PATCH] USB: add dynamic id functionality to USB core · 733260ff
      Greg Kroah-Hartman 提交于
      Echo the usb vendor and product id to the "new_id" file in the driver's
      sysfs directory, and then that driver will be able to bind to a device
      with those ids if it is present.
      
      Example:
      	echo 0557 2008 > /sys/bus/usb/drivers/foo_driver/new_id
      adds the hex values 0557 and 2008 to the device id table for the foo_driver.
      
      Note, usb-serial drivers do not currently work with this capability yet.
      usb-storage also might have some oddities.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      733260ff
    • 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
    • A
      [PATCH] USB: central handling for host controllers that were reset during suspend/resume · 1c50c317
      Alan Stern 提交于
      This patch (as515b) adds a routine to usbcore to simplify handling of
      host controllers that lost power or were reset during suspend/resume.
      The new core routine marks all the child devices of the root hub as
      NOTATTACHED and tells khubd to disconnect the device structures as soon
      as possible.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1c50c317
  2. 22 12月, 2005 1 次提交
  3. 30 11月, 2005 1 次提交
    • B
      [PATCH] USB: Fix USB suspend/resume crasher (#2) · 8de98402
      Benjamin Herrenschmidt 提交于
      This patch closes the IRQ race and makes various other OHCI & EHCI code
      path safer vs. suspend/resume.
      I've been able to (finally !) successfully suspend and resume various
      Mac models, with or without USB mouse plugged, or plugging while asleep,
      or unplugging while asleep etc... all without a crash.
      
      Alan, please verify the UHCI bit I did, I only verified that it builds.
      It's very simple so I wouldn't expect any issue there. If you aren't
      confident, then just drop the hunks that change uhci-hcd.c
      
      I also made the patch a little bit more "safer" by making sure the store
      to the interrupt register that disables interrupts is not posted before
      I set the flag and drop the spinlock.
      
      Without this patch, you cannot reliably sleep/wakeup any recent Mac, and
      I suspect PCs have some more sneaky issues too (they don't frankly crash
      with machine checks because x86 tend to silently swallow PCI errors but
      that won't last afaik, at least PCI Express will blow up in those
      situations, but the USB code may still misbehave).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8de98402
  4. 24 11月, 2005 2 次提交
  5. 18 11月, 2005 5 次提交
  6. 29 10月, 2005 20 次提交