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:
@@ -151,9 +151,8 @@ static void xhci_usb3_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci,
|
|||||||
if (portsc & PORT_DEV_REMOVE)
|
if (portsc & PORT_DEV_REMOVE)
|
||||||
port_removable |= 1 << (i + 1);
|
port_removable |= 1 << (i + 1);
|
||||||
}
|
}
|
||||||
memset(&desc->u.ss.DeviceRemovable,
|
|
||||||
(__force __u16) cpu_to_le16(port_removable),
|
desc->u.ss.DeviceRemovable = cpu_to_le16(port_removable);
|
||||||
sizeof(__u16));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xhci_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci,
|
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]);
|
temp = xhci_readl(xhci, port_array[wIndex]);
|
||||||
xhci_dbg(xhci, "set port power, actual port %d status = 0x%x\n", wIndex, temp);
|
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,
|
temp = usb_acpi_power_manageable(hcd->self.root_hub,
|
||||||
wIndex);
|
wIndex);
|
||||||
if (temp)
|
if (temp)
|
||||||
usb_acpi_set_power_state(hcd->self.root_hub,
|
usb_acpi_set_power_state(hcd->self.root_hub,
|
||||||
wIndex, true);
|
wIndex, true);
|
||||||
|
spin_lock_irqsave(&xhci->lock, flags);
|
||||||
break;
|
break;
|
||||||
case USB_PORT_FEAT_RESET:
|
case USB_PORT_FEAT_RESET:
|
||||||
temp = (temp | PORT_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,
|
xhci_writel(xhci, temp & ~PORT_POWER,
|
||||||
port_array[wIndex]);
|
port_array[wIndex]);
|
||||||
|
|
||||||
|
spin_unlock_irqrestore(&xhci->lock, flags);
|
||||||
temp = usb_acpi_power_manageable(hcd->self.root_hub,
|
temp = usb_acpi_power_manageable(hcd->self.root_hub,
|
||||||
wIndex);
|
wIndex);
|
||||||
if (temp)
|
if (temp)
|
||||||
usb_acpi_set_power_state(hcd->self.root_hub,
|
usb_acpi_set_power_state(hcd->self.root_hub,
|
||||||
wIndex, false);
|
wIndex, false);
|
||||||
|
spin_lock_irqsave(&xhci->lock, flags);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
goto error;
|
goto error;
|
||||||
|
@@ -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(
|
static unsigned long long xhci_service_interval_to_ns(
|
||||||
struct usb_endpoint_descriptor *desc)
|
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,
|
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))
|
(xhci_service_interval_to_ns(desc) > timeout_ns))
|
||||||
timeout_ns = xhci_service_interval_to_ns(desc);
|
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)
|
if (u2_del_ns > timeout_ns)
|
||||||
timeout_ns = u2_del_ns;
|
timeout_ns = u2_del_ns;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user