1. 16 6月, 2009 13 次提交
  2. 12 6月, 2009 1 次提交
  3. 24 4月, 2009 1 次提交
    • J
      USB: pass mem_flags to dma_alloc_coherent · a8aa401f
      Johannes Berg 提交于
      When I want to use my webcam, I get:
      
                                       vvvvvvv
      cheese: page allocation failure. order:5, mode:0x8004
      Pid: 8100, comm: cheese Not tainted 2.6.30-rc2-wl-dirty #102
      Call Trace:
       [<ffffffff802c5d8e>] __alloc_pages_internal+0x3fe/0x520
       [<ffffffff80210a20>] dma_generic_alloc_coherent+0x90/0x120
       [<ffffffffa001c91e>] hcd_buffer_alloc+0xee/0x130 [usbcore]
       [<ffffffffa000d52d>] usb_buffer_alloc+0x2d/0x40 [usbcore]
       [<ffffffffa0160e14>] uvc_alloc_urb_buffers+0x84/0x140 [uvcvideo]
       [<ffffffffa0160ff6>] uvc_init_video+0x126/0x400 [uvcvideo]
       [...]
      
      Oddly, I remembered fixing this and putting in __GFP_NOWARN
      because uvcvideo retries a smaller allocation. However, the
      allocation function doesn't pass the gfp flags through to
      dma_alloc_coherent so we still get the warning!
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a8aa401f
  4. 18 4月, 2009 1 次提交
    • D
      USB: add reset endpoint operations · 3444b26a
      David Vrabel 提交于
      Wireless USB endpoint state has a sequence number and a current
      window and not just a single toggle bit.  So allow HCDs to provide a
      endpoint_reset method and call this or clear the software toggles as
      required (after a clear halt, set configuration etc.).
      
      usb_settoggle() and friends are then HCD internal and are moved into
      core/hcd.h and all device drivers call usb_reset_endpoint() instead.
      
      If the device endpoint state has been reset (with a clear halt) but
      the host endpoint state has not then subsequent data transfers will
      not complete. The device will only work again after it is reset or
      disconnected.
      Signed-off-by: NDavid Vrabel <david.vrabel@csr.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3444b26a
  5. 25 3月, 2009 8 次提交
  6. 18 3月, 2009 1 次提交
    • A
      USB: usbfs: keep async URBs until the device file is closed · 6ff10464
      Alan Stern 提交于
      The usbfs driver manages a list of completed asynchronous URBs.  But
      it is too eager to free the entries on this list: destroy_async() gets
      called whenever an interface is unbound or a device is removed, and it
      deallocates the outstanding struct async entries for all URBs on that
      interface or device.  This is wrong; the user program should be able
      to reap an URB any time after it has completed, regardless of whether
      or not the interface is still bound or the device is still present.
      
      This patch (as1222) moves the code for deallocating the completed list
      entries from destroy_async() to usbdev_release().  The outstanding
      entries won't be freed until the user program has closed the device
      file, thereby eliminating any possibility that the remaining URBs
      might still be reaped.
      
      This fixes a bug in which a program can hang in the USBDEVFS_REAPURB
      ioctl when the device is unplugged.
      Reported-and-tested-by: NMartin Poupe <martin.poupe@upek.com>
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6ff10464
  7. 28 2月, 2009 1 次提交
    • A
      USB: usb_get_string should check the descriptor type · 67f5a4ba
      Alan Stern 提交于
      This patch (as1218) fixes a problem with a radio-control joystick used
      in the "walkera 4#3" helicopter.  This device responds to the initial
      Get-String-Descriptor request for string 0 (which is really the list
      of supported languages) by sending its config descriptor!  The
      usb_get_string() routine needs to check whether it got the right
      type of descriptor.
      
      Oddly enough, this sort of check is already present in
      usb_get_descriptor().  The patch changes the error code from -EPROTO
      to -ENODATA, because -EPROTO shows up in so many other contexts to
      indicate a hardware failure rather than a firmware error.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NGuillermo Jarabo <williamjap@gmail.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      ===================================================================
      67f5a4ba
  8. 18 2月, 2009 1 次提交
  9. 28 1月, 2009 4 次提交
    • A
      USB: fix char-device disconnect handling · 501950d8
      Alan Stern 提交于
      This patch (as1198) fixes a conceptual bug: Somewhere along the line
      we managed to confuse USB class devices with USB char devices.  As a
      result, the code to send a disconnect signal to userspace would not be
      built if both CONFIG_USB_DEVICE_CLASS and CONFIG_USB_DEVICEFS were
      disabled.
      
      The usb_fs_classdev_common_remove() routine has been renamed to
      usbdev_remove() and it is now called whenever any USB device is
      removed, not just when a class device is unregistered.  The notifier
      registration and unregistration calls are no longer conditionally
      compiled.  And since the common removal code will always be called as
      part of the char device interface, there's no need to call it again as
      part of the usbfs interface; thus the invocation of
      usb_fs_classdev_common_remove() has been taken out of
      usbfs_remove_device().
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NAlon Bar-Lev <alon.barlev@gmail.com>
      Tested-by: NAlon Bar-Lev <alon.barlev@gmail.com>
      Cc: stable <stable@kernel.org>
      
      501950d8
    • R
      USB: Fix suspend-resume of PCI USB controllers · a15d95a0
      Rafael J. Wysocki 提交于
      Commit a0d4922d
      (USB: fix up suspend and resume for PCI host controllers) attempted
      to fix the suspend-resume of PCI USB controllers, but unfortunately
      it did that incorrectly and interrupts are left enabled by the USB
      controllers' ->suspend_late() callback as a result.  This leads to
      serious problems during suspend which are very difficult to debug.
      
      Fix the issue by removing the ->suspend_late() callback of PCI
      USB controllers and moving the code from there to the ->suspend()
      callback executed with interrupts enabled.  Additionally, make
      the ->resume() callback of PCI USB controllers execute
      pci_enable_wake(dev, PCI_D0, false) to disable wake-up from the
      full power state (PCI_D0).
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Tested-by: NAndrey Borzenkov <arvidjaar@mail.ru>
      Tested-by: N"Jeff Chua" <jeff.chua.linux@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: "Zdenek Kabelac" <zdenek.kabelac@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a15d95a0
    • A
      USB: don't enable wakeup by default for PCI host controllers · bcca06ef
      Alan Stern 提交于
      This patch (as1199) changes the initial wakeup settings for PCI USB
      host controllers.  The controllers are marked as capable of waking the
      system, but wakeup is not enabled by default.
      
      It turns out that enabling wakeup for USB host controllers has a lot
      of bad consequences.  As the simplest example, if a USB mouse or
      keyboard is unplugged immediately after the computer is put to sleep,
      the unplug will cause the system to wake back up again!  We are better
      off marking them as wakeup-capable and leaving wakeup disabled.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NRafael J. Wysocki <rjw@sisk.pl>
      CC: David Brownell <david-b@pacbell.net>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bcca06ef
    • A
      USB: fix toggle mismatch in disable_endpoint paths · ddeac4e7
      Alan Stern 提交于
      This patch (as1200) finishes some fixes that were left incomplete by
      an earlier patch.
      
      Although nobody has addressed this issue in the past, it turns out
      that we need to distinguish between two different modes of disabling
      and enabling endpoints.  In one mode only the data structures in
      usbcore are affected, and in the other mode the host controller and
      device hardware states are affected as well.
      
      The earlier patch added an extra argument to the routines in the
      enable_endpoint pathways to reflect this difference.  This patch adds
      corresponding arguments to the disable_endpoint pathways.  Without
      this change, the endpoint toggle state can get out of sync between
      the host and the device.  The exact mechanism depends on the details
      of the host controller (whether or not it stores its own copy of the
      toggle values).
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NDan Streetman <ddstreet@ieee.org>
      Tested-by: NDan Streetman <ddstreet@ieee.org>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      ddeac4e7
  10. 16 1月, 2009 1 次提交
  11. 08 1月, 2009 8 次提交
    • M
      USB: fix minor nit in usbfs checking · ed0c7720
      Mark Lord 提交于
      One minor nit did show up, though.  The patch below
      seems to make more sense than the code does without it.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      ed0c7720
    • A
      USB: re-enable interface after driver unbinds · 2caf7fcd
      Alan Stern 提交于
      This patch (as1197) fixes an error introduced recently.  Since a
      significant number of devices can't handle Set-Interface requests, we
      no longer call usb_set_interface() when a driver unbinds from an
      interface, provided the interface is already in altsetting 0.  However
      the interface still does get disabled, and the call to
      usb_set_interface() was the only thing re-enabling it.  Since the
      interface doesn't get re-enabled, further attempts to use it fail.
      
      So the patch adds a call to usb_enable_interface() when a driver
      unbinds and the interface is in altsetting 0.  For this to work
      right, the interface's endpoints have to be re-enabled but their
      toggles have to be left alone.  Therefore an additional argument is
      added to usb_enable_endpoint() and usb_enable_interface(), a flag
      indicating whether or not the endpoint toggles should be reset.
      
      This is a forward-ported version of a patch which fixes Bugzilla
      #12301.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NDavid Roka <roka@dawid.hu>
      Reported-by: NErik Ekman <erik@kryo.se>
      Tested-by: NErik Ekman <erik@kryo.se>
      Tested-by: NAlon Bar-Lev <alon.barlev@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2caf7fcd
    • A
      USB: cancel pending Set-Config requests if userspace gets there first · df718962
      Alan Stern 提交于
      This patch (as1195) eliminates a potential problem identified by
      Oliver Neukum.  When a driver queues an asynchronous Set-Config
      request using usb_driver_set_configuration(), the request should be
      cancelled if userspace changes the configuration first.  The patch
      introduces a linked list of pending async Set-Config requests, and
      uses it to invalidate the requests for a particular device whenever
      that device's configuration is set.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Oliver Neukum <oliver@neukum.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      df718962
    • A
      USB: automatically enable wakeup for PCI host controllers · 6fd9086a
      Alan Stern 提交于
      This patch (as1193b) enables wakeup during initialization for all PCI
      host controllers, and it removes some code (and comments!) that are no
      longer needed now that the PCI core automatically initializes wakeup
      settings for all new devices.
      
      The idea is that the bus should initialize wakeup, and the bus glue
      or controller driver should enable it.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6fd9086a
    • A
      USB: fix up suspend and resume for PCI host controllers · a0d4922d
      Alan Stern 提交于
      This patch (as1192) rearranges the USB PCI host controller suspend and
      resume and resume routines:
      
      	Use pci_wake_from_d3() for enabling and disabling wakeup,
      	instead of pci_enable_wake().
      
      	Carry out the actual state change while interrupts are
      	disabled.
      
      	Change the order of the preparations to agree with the
      	general recommendation for PCI devices, instead of
      	messing around with the wakeup settings while the device
      	is in D3.
      
      		In .suspend:
      			Call the underlying driver to disable IRQ
      				generation;
      			pci_wake_from_d3(device_may_wakeup());
      			pci_disable_device();
      
      		In .suspend_late:
      			pci_save_state();
      			pci_set_power_state(D3hot);
      			(for PPC_PMAC) Disable ASIC clocks
      
      		In .resume_early:
      			(for PPC_PMAC) Enable ASIC clocks
      			pci_set_power_state(D0);
      			pci_restore_state();
      
      		In .resume:
      			pci_enable_device();
      			pci_set_master();
      			pci_wake_from_d3(0);
      			Call the underlying driver to reenable IRQ
      				generation
      
      	Add the necessary .suspend_late and .resume_early method
      	pointers to the PCI host controller drivers.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: Rafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a0d4922d
    • O
      USB: extension of anchor API to unpoison an anchor · 856395d6
      Oliver Neukum 提交于
      This extension allows unpoisoning an anchor allowing drivers that
      resubmit URBs to reuse an anchor for methods like resume()
      Signed-off-by: NOliver Neukum <oneukum@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      856395d6
    • M
      USB: mark "reject" field of struct urb as atomic_t · 49367d8f
      Ming Lei 提交于
      It is enough to protect accesses to reject field of urb
      by marking it as atomic_t,also it is the only reason of
      existence of usb_reject_lock,so remove the lock to make
      code more clean.
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Acked-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      49367d8f
    • A
      USB: utilize the bus notifiers · 3b23dd6f
      Alan Stern 提交于
      This patch (as1185) makes usbcore take advantage of the bus
      notifications sent out by the driver core.  Now we can create all our
      device and interface attribute files before the device or interface
      uevent is broadcast.
      
      A side effect is that we no longer create the endpoint "pseudo"
      devices at the same time as a device or interface is registered -- it
      seems like a bad idea to try registering an endpoint before the
      registration of its parent is complete.  So the routines for creating
      and removing endpoint devices have been split out and renamed, and
      they are called explicitly when needed.  A new bitflag is used for
      keeping track of whether or not the interface's endpoint devices have
      been created, since (just as with the interface attributes) they vary
      with the altsetting and hence can be changed at random times.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3b23dd6f