1. 24 8月, 2013 2 次提交
  2. 20 8月, 2013 3 次提交
  3. 19 8月, 2013 1 次提交
    • Y
      USB: serial: fix stringify operator in usb-serial-simple · 68c91d37
      Yann Droneaud 提交于
      usb-serial-simple uses an unknown stringify macro that make
      all drivers being named "stringify(vendor)".
      
      This can be a problem when two drivers have the same (wrong) name:
      
          kernel: usbcore: registered new interface driver usb_serial_simple
          kernel: usbserial: USB Serial support registered for stringify(vendor)
          kernel Error: Driver 'stringify(vendor)' is already registered, aborting...
          kernel: usbserial: problem -16 when registering driver stringify(vendor)
          kernel: usbserial: USB Serial deregistering driver stringify(vendor)
          kernel: usbcore: deregistering interface driver usb_serial_simple
      
      Before the fix:
      
          $ strings drivers/usb/serial/usb-serial-simple.o
          usb_serial_simple
          stringify(vendor)
      
      After the fix:
      
          $ strings drivers/usb/serial/usb-serial-simple.o
          usb_serial_simple
          funsoft
          flashloader
          vivopay
          moto_modem
          hp4x
          suunto
          siemens_mpi
      
      This patch makes usb-serial-simple use the correct stringify operator.
      Signed-off-by: NYann Droneaud <ydroneaud@opteya.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      68c91d37
  4. 16 8月, 2013 8 次提交
    • T
      USB: WUSBCORE: Use usb_init_urb instead of creating the URB manually · 66591015
      Thomas Pugliese 提交于
      In wa_seg_init, use usb_init_urb to init the URB object contained in the
      transfer segment instead of initializing it manually.  Use kmalloc to
      allocate the memory for segment instead of kzalloc and then use memset
      to set the non-URB portion of the transfer segment struct to 0 since
      that was already done by usb_init_urb.
      Signed-off-by: NThomas Pugliese <thomas.pugliese@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      66591015
    • T
      USB: WUSBCORE: fix leak of urb in wa_xfer_destroy. · 79731cbd
      Thomas Pugliese 提交于
      The check to free the URB was the opposite of the correct case.  This
      patch removes the check altogether since the ptr will be NULL if the URB
      was not allocated.  Also use usb_free_urb instead of usb_put_urb.
      Signed-off-by: NThomas Pugliese <thomas.pugliese@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      79731cbd
    • T
      USB: WUSBCORE: fix resource cleanup in error path in __wa_xfer_setup_segs · 11b1bf81
      Thomas Pugliese 提交于
      Use usb_free_urb instead of kfree in error path and point to the correct
      URB.  Also remember to clean up the sg list for the URB if it was allocated.
      Signed-off-by: NThomas Pugliese <thomas.pugliese@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      11b1bf81
    • T
      USB: WUSBCORE: clear RPIPE stall for control endpoints · 6d33f7bb
      Thomas Pugliese 提交于
      When the HWA encounters a STALL on a control endpoint, it should clear the
      RPIPE_STALL feature on the RPIPE before processing the next transfer
      request.  Otherwise, all transfer requests on that endpoint after the
      first STALL will fail because the RPIPE is still in the halted state.
      This also removes the unneccessary call to spin_lock_irqsave for a nested
      lock that was present in the first patch.
      Signed-off-by: NThomas Pugliese <thomas.pugliese@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6d33f7bb
    • S
      xhci-plat: Don't enable legacy PCI interrupts. · 52fb6125
      Sarah Sharp 提交于
      The xHCI platform driver calls into usb_add_hcd to register the irq for
      its platform device.  It does not want the xHCI generic driver to
      register an interrupt for it at all.  The original code did that by
      setting the XHCI_BROKEN_MSI quirk, which tells the xHCI driver to not
      enable MSI or MSI-X for a PCI host.
      
      Unfortunately, if CONFIG_PCI is enabled, and CONFIG_USB_DW3 is enabled,
      the xHCI generic driver will attempt to register a legacy PCI interrupt
      for the xHCI platform device in xhci_try_enable_msi().  This will result
      in a bogus irq being registered, since the underlying device is a
      platform_device, not a pci_device, and thus the pci_device->irq pointer
      will be bogus.
      
      Add a new quirk, XHCI_PLAT, so that the xHCI generic driver can
      distinguish between a PCI device that can't handle MSI or MSI-X, and a
      platform device that should not have its interrupts touched at all.
      This quirk may be useful in the future, in case other corner cases like
      this arise.
      
      This patch should be backported to kernels as old as 3.9, that
      contain the commit 00eed9c8 "USB: xhci:
      correctly enable interrupts".
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: NYu Y Wang <yu.y.wang@intel.com>
      Tested-by: NYu Y Wang <yu.y.wang@intel.com>
      Reviewed-by: NFelipe Balbi <balbi@ti.com>
      Cc: stable@vger.kernel.org
      52fb6125
    • S
      usb: Don't fail port power resume on device disconnect. · d49dad3e
      Sarah Sharp 提交于
      Userspace can tell the kernel to power off any USB port, including ones
      that are visible and connectible to users.  When an attached USB device
      goes into suspend, the port will be powered off if the
      pm_qos_no_port_poweroff file for its port is set to 0, the device does
      not have remote wakeup enabled, and the device is marked as persistent.
      
      If the user disconnects the USB device while the port is powered off,
      the current code does not handle that properly.  If you disconnect a
      device, and then run `lsusb -v -s` for the device, the device disconnect
      does not get handled by the USB core.  The runtime resume of the port
      fails, because hub_port_debounce_be_connected() returns -ETIMEDOUT.
      
      This means the port resume fails and khubd doesn't handle the USB device
      disconnect.  This leaves the device listed in lsusb, and the port's
      runtime_status will be permanently marked as "error".
      
      Fix this by ignoring the return value of hub_port_debounce_be_connected.
      Users can disconnect USB devices while the ports are powered off, and we
      must be able to handle that.
      
      This patch should be backported to kernels as old as 3.9, that
      contain the commit ad493e5e "usb: add
      usb port auto power off mechanism"
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Lan Tianyu <tianyu.lan@intel.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      d49dad3e
    • L
      usb: don't check pm qos NO_POWER_OFF flag in usb_port_suspend() · 98a4f1ff
      Lan Tianyu 提交于
      The pm qos NO_POWER_OFF flag is checked twice during usb device suspend
      to see if the usb port power off condition is met. This is redundant and
      also will prevent the port from being powered off if the NO_POWER_OFF
      flag is changed to 1 from 0 after the device was already suspended.
      
      More detail in the following link.
      	http://marc.info/?l=linux-usb&m=136543949130865&w=2
      
      This patch should be backported to kernels as old as 3.7, that
      contain the commit f7ac7787 "usb/acpi:
      Use ACPI methods to power off ports."
      Signed-off-by: NLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      98a4f1ff
    • A
      USB: handle LPM errors during device suspend correctly · aa5ceae2
      Alan Stern 提交于
      The hub driver's usb_port_suspend() routine doesn't handle errors
      related to Link Power Management properly.  It always returns failure,
      it doesn't try to clean up the wakeup setting, (in the case of system
      sleep) it doesn't try to go ahead with the port suspend regardless,
      and it doesn't try to apply the new power-off mechanism.
      
      This patch fixes these problems.
      
      Note: Sarah fixed this patch to apply against 3.11, since the original
      commit (4fae6f0f "USB: handle LPM errors
      during device suspend correctly") called usb_disable_remote_wakeup,
      which won't be added until 3.12.
      
      This patch should be backported to kernels as old as 3.5, that
      contain the commit 8306095f "USB:
      Disable USB 3.0 LPM in critical sections.".  There will be merge
      conflicts, since LTM wasn't added until 3.6.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      aa5ceae2
  5. 15 8月, 2013 26 次提交