xhci: Bug fixes for 3.12.

Hi Greg,
 
 Here's three low-priority bug fixes that should be queued for 3.12.
 They disable runtime PM for hosts that need the XHCI_RESET_ON_RESUME
 quirk, fix USB 2.0 Link PM on hosts that don't have BESL support, and
 prevent a bunch of log spam.
 
 Please pull into usb-next for 3.12.
 
 Sarah Sharp
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJSHNHAAAoJEBMGWMLi1Gc5zTUP+gLGRJnBl7n1Zj99wAqOkzp5
 f3NdT074g2Shh8sdy/CVYUINX+6XZc8EC0qiiEx3ZgrTEUy8YXh3NZgY2JzztogR
 kkBzZ9cpU6YDZeoVot88ViqmN0xeer7nXNzbF0Spk5pU+sZBjSf74DvjAkv+f1gu
 43XgbhudNYUfY2jUouRi4FB4iySU6n7Y++Q7F7Xcnqh0mR0HM385DQZR3ffTpaUs
 asFCwV6fI9y9tHOZ5Es0NLSlGj9sFkofdJrlAWd6RR1xLMGXGqOHbT/3tq/MGW/f
 CfrUhtO2W9uym81iqtrw+CuwRS8EFMkkhsze77w1yB11j9wJ02JRef14a5HQXMg4
 KlU9FFy25TNss574XpsAqxfnZjNG3bIqawAyGJRpEuwi/beqLq+KsJ1JeLZ5LhOJ
 Ncu+HLksX/kloVftsqKwNvZMW563V36/MzVTS5+w5nbAVDdrKKOWaDYqb376z4Xv
 1ZaDCuzrh8lgjaxgdLsyF5BPVuhXmnwWKqyp3eUsoRTVI8NcQdA8oqcectdrazuq
 aHKNKAbtkjMzycszscGdgwNHVCDfFjJyYGIhmHTlwekKFoBMbIvs3sR9U+iKshm4
 52CqTexPe9SC+XRh02RtD3GOr+kXgSJ1QupULZ/g9wd+aRGfp7Me5CvKJyL/S9Cd
 PpWop/xBeAMigXpwcKwk
 =XFdI
 -----END PGP SIGNATURE-----

Merge tag 'for-usb-next-2013-08-27' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-next

Sarah writes:

xhci: Bug fixes for 3.12.

Hi Greg,

Here's three low-priority bug fixes that should be queued for 3.12.
They disable runtime PM for hosts that need the XHCI_RESET_ON_RESUME
quirk, fix USB 2.0 Link PM on hosts that don't have BESL support, and
prevent a bunch of log spam.

Please pull into usb-next for 3.12.

Sarah Sharp
This commit is contained in:
Greg Kroah-Hartman 2013-08-27 13:02:57 -07:00
commit 62f4b242ca
3 changed files with 31 additions and 17 deletions

View File

@ -71,7 +71,7 @@
/* USB 2.0 xHCI 1.0 hardware LMP capability - section 7.2.2.1.3.2 */ /* USB 2.0 xHCI 1.0 hardware LMP capability - section 7.2.2.1.3.2 */
#define XHCI_HLC (1 << 19) #define XHCI_HLC (1 << 19)
#define XHCI_BLC (1 << 19) #define XHCI_BLC (1 << 20)
/* command register values to disable interrupts and halt the HC */ /* command register values to disable interrupts and halt the HC */
/* start/stop HC execution - do not write unless HC is halted*/ /* start/stop HC execution - do not write unless HC is halted*/

View File

@ -3087,14 +3087,10 @@ int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
* to set the polling interval (once the API is added). * to set the polling interval (once the API is added).
*/ */
if (xhci_interval != ep_interval) { if (xhci_interval != ep_interval) {
if (printk_ratelimit()) dev_dbg_ratelimited(&urb->dev->dev,
dev_dbg(&urb->dev->dev, "Driver uses different interval" "Driver uses different interval (%d microframe%s) than xHCI (%d microframe%s)\n",
" (%d microframe%s) than xHCI " ep_interval, ep_interval == 1 ? "" : "s",
"(%d microframe%s)\n", xhci_interval, xhci_interval == 1 ? "" : "s");
ep_interval,
ep_interval == 1 ? "" : "s",
xhci_interval,
xhci_interval == 1 ? "" : "s");
urb->interval = xhci_interval; urb->interval = xhci_interval;
/* Convert back to frames for LS/FS devices */ /* Convert back to frames for LS/FS devices */
if (urb->dev->speed == USB_SPEED_LOW || if (urb->dev->speed == USB_SPEED_LOW ||
@ -3876,14 +3872,10 @@ int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags,
* to set the polling interval (once the API is added). * to set the polling interval (once the API is added).
*/ */
if (xhci_interval != ep_interval) { if (xhci_interval != ep_interval) {
if (printk_ratelimit()) dev_dbg_ratelimited(&urb->dev->dev,
dev_dbg(&urb->dev->dev, "Driver uses different interval" "Driver uses different interval (%d microframe%s) than xHCI (%d microframe%s)\n",
" (%d microframe%s) than xHCI " ep_interval, ep_interval == 1 ? "" : "s",
"(%d microframe%s)\n", xhci_interval, xhci_interval == 1 ? "" : "s");
ep_interval,
ep_interval == 1 ? "" : "s",
xhci_interval,
xhci_interval == 1 ? "" : "s");
urb->interval = xhci_interval; urb->interval = xhci_interval;
/* Convert back to frames for LS/FS devices */ /* Convert back to frames for LS/FS devices */
if (urb->dev->speed == USB_SPEED_LOW || if (urb->dev->speed == USB_SPEED_LOW ||

View File

@ -3557,10 +3557,21 @@ void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
{ {
struct xhci_hcd *xhci = hcd_to_xhci(hcd); struct xhci_hcd *xhci = hcd_to_xhci(hcd);
struct xhci_virt_device *virt_dev; struct xhci_virt_device *virt_dev;
struct device *dev = hcd->self.controller;
unsigned long flags; unsigned long flags;
u32 state; u32 state;
int i, ret; int i, ret;
#ifndef CONFIG_USB_DEFAULT_PERSIST
/*
* We called pm_runtime_get_noresume when the device was attached.
* Decrement the counter here to allow controller to runtime suspend
* if no devices remain.
*/
if (xhci->quirks & XHCI_RESET_ON_RESUME)
pm_runtime_put_noidle(dev);
#endif
ret = xhci_check_args(hcd, udev, NULL, 0, true, __func__); ret = xhci_check_args(hcd, udev, NULL, 0, true, __func__);
/* If the host is halted due to driver unload, we still need to free the /* If the host is halted due to driver unload, we still need to free the
* device. * device.
@ -3634,6 +3645,7 @@ static int xhci_reserve_host_control_ep_resources(struct xhci_hcd *xhci)
int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev) int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
{ {
struct xhci_hcd *xhci = hcd_to_xhci(hcd); struct xhci_hcd *xhci = hcd_to_xhci(hcd);
struct device *dev = hcd->self.controller;
unsigned long flags; unsigned long flags;
int timeleft; int timeleft;
int ret; int ret;
@ -3686,6 +3698,16 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
goto disable_slot; goto disable_slot;
} }
udev->slot_id = xhci->slot_id; udev->slot_id = xhci->slot_id;
#ifndef CONFIG_USB_DEFAULT_PERSIST
/*
* If resetting upon resume, we can't put the controller into runtime
* suspend if there is a device attached.
*/
if (xhci->quirks & XHCI_RESET_ON_RESUME)
pm_runtime_get_noresume(dev);
#endif
/* Is this a LS or FS device under a HS hub? */ /* Is this a LS or FS device under a HS hub? */
/* Hub or peripherial? */ /* Hub or peripherial? */
return 1; return 1;