xHCI fixes for 3.7-rc3

Hi Greg,
 
 Here's four bug fixes for 3.7.
 
 The first patch fixes a potential deadlock in the USB port power off code,
 and the last two patches fix bugs in the USB 3.0 Link PM patchset.  The
 second one is trivial and removes an unnecessary cast.
 
 Sarah Sharp
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQhx9VAAoJEBMGWMLi1Gc5pWkP/2tlO+vD+8HUr3bsdQT1Avmn
 yyrK2zRdvqQ2LWhQmuKySvbB5911Jm1WPCeU8OUvQF2VCO49XKsSKFIQ/mUM+TWd
 VaTAUyb+kdaxtulDIP6FiwXmb3SQavDSPek5kJ3W5nTZz32IQR7tODfwdhAv8Jla
 jcWDOnisc2OnxYNEGu72i7kngpKf88iZTIjKoH8+inXkZM5WQ1SNK6mtR4coRjvE
 HvoiivuIgdOL/326bdV6S3ysCRHUjEMlUWbJF9hyGjrCVBxTBg/r7sbNJGd39CMP
 zmRs/fUEfFr2asFB+jwSM8/Dj8bb11O88lwzD5E3FqdXbTjH8eDkgkxhrIYsHtrA
 /eB6TcTPXo7reeJUo5jLaKD3aBe69LR47YC7apL6+hgloqvIHsOD3rWpFoZZPusZ
 2F6WgNg21pNah3+PufnJepMYvm/T0yZAhoK05EePkPSoFvUUBiu+j485dwajO4vj
 387mmbFchXdj/QWgiMM2KXrxOskrijJVkLhg8rOV67nwl6DgoVzqh28q6edXxrfu
 +QhxdHioWF2AQm1l9AdrotWqSBoCFEVXoQjszfYK2ZRR5lfiXRK2b4pjDobnhLo+
 v+eQVCJerOuV32a3w16755AVejE6DBP3ouTq0eCRpr0Y0aL5dpi+xVJWvVxxJ6I1
 h1NcSn02ENZxMn3kF+hr
 =W4Wk
 -----END PGP SIGNATURE-----

Merge tag 'for-usb-linus-2012-10-23' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-linus

xHCI fixes for 3.7-rc3

Hi Greg,

Here's four bug fixes for 3.7.

The first patch fixes a potential deadlock in the USB port power off code,
and the last two patches fix bugs in the USB 3.0 Link PM patchset.  The
second one is trivial and removes an unnecessary cast.

Sarah Sharp
This commit is contained in:
Greg Kroah-Hartman 2012-10-23 19:25:52 -07:00
commit 3a99ba53d1
2 changed files with 8 additions and 5 deletions

View File

@ -151,9 +151,8 @@ static void xhci_usb3_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci,
if (portsc & PORT_DEV_REMOVE)
port_removable |= 1 << (i + 1);
}
memset(&desc->u.ss.DeviceRemovable,
(__force __u16) cpu_to_le16(port_removable),
sizeof(__u16));
desc->u.ss.DeviceRemovable = cpu_to_le16(port_removable);
}
static void xhci_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci,
@ -809,11 +808,13 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
temp = xhci_readl(xhci, port_array[wIndex]);
xhci_dbg(xhci, "set port power, actual port %d status = 0x%x\n", wIndex, temp);
spin_unlock_irqrestore(&xhci->lock, flags);
temp = usb_acpi_power_manageable(hcd->self.root_hub,
wIndex);
if (temp)
usb_acpi_set_power_state(hcd->self.root_hub,
wIndex, true);
spin_lock_irqsave(&xhci->lock, flags);
break;
case USB_PORT_FEAT_RESET:
temp = (temp | PORT_RESET);
@ -917,11 +918,13 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
xhci_writel(xhci, temp & ~PORT_POWER,
port_array[wIndex]);
spin_unlock_irqrestore(&xhci->lock, flags);
temp = usb_acpi_power_manageable(hcd->self.root_hub,
wIndex);
if (temp)
usb_acpi_set_power_state(hcd->self.root_hub,
wIndex, false);
spin_lock_irqsave(&xhci->lock, flags);
break;
default:
goto error;

View File

@ -4021,7 +4021,7 @@ int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
static unsigned long long xhci_service_interval_to_ns(
struct usb_endpoint_descriptor *desc)
{
return (1 << (desc->bInterval - 1)) * 125 * 1000;
return (1ULL << (desc->bInterval - 1)) * 125 * 1000;
}
static u16 xhci_get_timeout_no_hub_lpm(struct usb_device *udev,
@ -4142,7 +4142,7 @@ static u16 xhci_calculate_intel_u2_timeout(struct usb_device *udev,
(xhci_service_interval_to_ns(desc) > timeout_ns))
timeout_ns = xhci_service_interval_to_ns(desc);
u2_del_ns = udev->bos->ss_cap->bU2DevExitLat * 1000;
u2_del_ns = le16_to_cpu(udev->bos->ss_cap->bU2DevExitLat) * 1000ULL;
if (u2_del_ns > timeout_ns)
timeout_ns = u2_del_ns;