diff options
author | Ingo Molnar <mingo@elte.hu> | 2012-03-05 03:20:08 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2012-03-05 03:20:08 -0500 |
commit | 737f24bda723fdf89ecaacb99fa2bf5683c32799 (patch) | |
tree | 35495fff3e9956679cb5468e74e6814c8e44ee66 /drivers/usb/host | |
parent | 8eedce996556d7d06522cd3a0e6069141c8dffe0 (diff) | |
parent | b7c924274c456499264d1cfa3d44063bb11eb5db (diff) |
Merge branch 'perf/urgent' into perf/core
Conflicts:
tools/perf/builtin-record.c
tools/perf/builtin-top.c
tools/perf/perf.h
tools/perf/util/top.h
Merge reason: resolve these cherry-picking conflicts.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/Kconfig | 8 | ||||
-rw-r--r-- | drivers/usb/host/ehci-fsl.c | 11 | ||||
-rw-r--r-- | drivers/usb/host/ehci-fsl.h | 1 | ||||
-rw-r--r-- | drivers/usb/host/pci-quirks.c | 17 | ||||
-rw-r--r-- | drivers/usb/host/xhci-hub.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 32 | ||||
-rw-r--r-- | drivers/usb/host/xhci.c | 5 |
7 files changed, 61 insertions, 15 deletions
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 91413cac97be..353cdd488b93 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig | |||
@@ -130,7 +130,7 @@ config USB_FSL_MPH_DR_OF | |||
130 | tristate | 130 | tristate |
131 | 131 | ||
132 | config USB_EHCI_FSL | 132 | config USB_EHCI_FSL |
133 | bool "Support for Freescale on-chip EHCI USB controller" | 133 | bool "Support for Freescale PPC on-chip EHCI USB controller" |
134 | depends on USB_EHCI_HCD && FSL_SOC | 134 | depends on USB_EHCI_HCD && FSL_SOC |
135 | select USB_EHCI_ROOT_HUB_TT | 135 | select USB_EHCI_ROOT_HUB_TT |
136 | select USB_FSL_MPH_DR_OF if OF | 136 | select USB_FSL_MPH_DR_OF if OF |
@@ -138,7 +138,7 @@ config USB_EHCI_FSL | |||
138 | Variation of ARC USB block used in some Freescale chips. | 138 | Variation of ARC USB block used in some Freescale chips. |
139 | 139 | ||
140 | config USB_EHCI_MXC | 140 | config USB_EHCI_MXC |
141 | bool "Support for Freescale on-chip EHCI USB controller" | 141 | bool "Support for Freescale i.MX on-chip EHCI USB controller" |
142 | depends on USB_EHCI_HCD && ARCH_MXC | 142 | depends on USB_EHCI_HCD && ARCH_MXC |
143 | select USB_EHCI_ROOT_HUB_TT | 143 | select USB_EHCI_ROOT_HUB_TT |
144 | ---help--- | 144 | ---help--- |
@@ -546,7 +546,7 @@ config USB_RENESAS_USBHS_HCD | |||
546 | config USB_WHCI_HCD | 546 | config USB_WHCI_HCD |
547 | tristate "Wireless USB Host Controller Interface (WHCI) driver (EXPERIMENTAL)" | 547 | tristate "Wireless USB Host Controller Interface (WHCI) driver (EXPERIMENTAL)" |
548 | depends on EXPERIMENTAL | 548 | depends on EXPERIMENTAL |
549 | depends on PCI && USB | 549 | depends on PCI && USB && UWB |
550 | select USB_WUSB | 550 | select USB_WUSB |
551 | select UWB_WHCI | 551 | select UWB_WHCI |
552 | help | 552 | help |
@@ -559,7 +559,7 @@ config USB_WHCI_HCD | |||
559 | config USB_HWA_HCD | 559 | config USB_HWA_HCD |
560 | tristate "Host Wire Adapter (HWA) driver (EXPERIMENTAL)" | 560 | tristate "Host Wire Adapter (HWA) driver (EXPERIMENTAL)" |
561 | depends on EXPERIMENTAL | 561 | depends on EXPERIMENTAL |
562 | depends on USB | 562 | depends on USB && UWB |
563 | select USB_WUSB | 563 | select USB_WUSB |
564 | select UWB_HWA | 564 | select UWB_HWA |
565 | help | 565 | help |
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index b556a72264d1..c26a82e83f6e 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c | |||
@@ -239,7 +239,7 @@ static void ehci_fsl_setup_phy(struct ehci_hcd *ehci, | |||
239 | ehci_writel(ehci, portsc, &ehci->regs->port_status[port_offset]); | 239 | ehci_writel(ehci, portsc, &ehci->regs->port_status[port_offset]); |
240 | } | 240 | } |
241 | 241 | ||
242 | static void ehci_fsl_usb_setup(struct ehci_hcd *ehci) | 242 | static int ehci_fsl_usb_setup(struct ehci_hcd *ehci) |
243 | { | 243 | { |
244 | struct usb_hcd *hcd = ehci_to_hcd(ehci); | 244 | struct usb_hcd *hcd = ehci_to_hcd(ehci); |
245 | struct fsl_usb2_platform_data *pdata; | 245 | struct fsl_usb2_platform_data *pdata; |
@@ -299,12 +299,19 @@ static void ehci_fsl_usb_setup(struct ehci_hcd *ehci) | |||
299 | #endif | 299 | #endif |
300 | out_be32(non_ehci + FSL_SOC_USB_SICTRL, 0x00000001); | 300 | out_be32(non_ehci + FSL_SOC_USB_SICTRL, 0x00000001); |
301 | } | 301 | } |
302 | |||
303 | if (!(in_be32(non_ehci + FSL_SOC_USB_CTRL) & CTRL_PHY_CLK_VALID)) { | ||
304 | printk(KERN_WARNING "fsl-ehci: USB PHY clock invalid\n"); | ||
305 | return -ENODEV; | ||
306 | } | ||
307 | return 0; | ||
302 | } | 308 | } |
303 | 309 | ||
304 | /* called after powerup, by probe or system-pm "wakeup" */ | 310 | /* called after powerup, by probe or system-pm "wakeup" */ |
305 | static int ehci_fsl_reinit(struct ehci_hcd *ehci) | 311 | static int ehci_fsl_reinit(struct ehci_hcd *ehci) |
306 | { | 312 | { |
307 | ehci_fsl_usb_setup(ehci); | 313 | if (ehci_fsl_usb_setup(ehci)) |
314 | return -ENODEV; | ||
308 | ehci_port_power(ehci, 0); | 315 | ehci_port_power(ehci, 0); |
309 | 316 | ||
310 | return 0; | 317 | return 0; |
diff --git a/drivers/usb/host/ehci-fsl.h b/drivers/usb/host/ehci-fsl.h index 491806221165..bdf43e2adc51 100644 --- a/drivers/usb/host/ehci-fsl.h +++ b/drivers/usb/host/ehci-fsl.h | |||
@@ -45,5 +45,6 @@ | |||
45 | #define FSL_SOC_USB_PRICTRL 0x40c /* NOTE: big-endian */ | 45 | #define FSL_SOC_USB_PRICTRL 0x40c /* NOTE: big-endian */ |
46 | #define FSL_SOC_USB_SICTRL 0x410 /* NOTE: big-endian */ | 46 | #define FSL_SOC_USB_SICTRL 0x410 /* NOTE: big-endian */ |
47 | #define FSL_SOC_USB_CTRL 0x500 /* NOTE: big-endian */ | 47 | #define FSL_SOC_USB_CTRL 0x500 /* NOTE: big-endian */ |
48 | #define CTRL_PHY_CLK_VALID (1 << 17) | ||
48 | #define SNOOP_SIZE_2GB 0x1e | 49 | #define SNOOP_SIZE_2GB 0x1e |
49 | #endif /* _EHCI_FSL_H */ | 50 | #endif /* _EHCI_FSL_H */ |
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index caf87428ca43..7732d69e49e0 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c | |||
@@ -867,6 +867,22 @@ hc_init: | |||
867 | 867 | ||
868 | static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev) | 868 | static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev) |
869 | { | 869 | { |
870 | /* Skip Netlogic mips SoC's internal PCI USB controller. | ||
871 | * This device does not need/support EHCI/OHCI handoff | ||
872 | */ | ||
873 | if (pdev->vendor == 0x184e) /* vendor Netlogic */ | ||
874 | return; | ||
875 | if (pdev->class != PCI_CLASS_SERIAL_USB_UHCI && | ||
876 | pdev->class != PCI_CLASS_SERIAL_USB_OHCI && | ||
877 | pdev->class != PCI_CLASS_SERIAL_USB_EHCI && | ||
878 | pdev->class != PCI_CLASS_SERIAL_USB_XHCI) | ||
879 | return; | ||
880 | |||
881 | if (pci_enable_device(pdev) < 0) { | ||
882 | dev_warn(&pdev->dev, "Can't enable PCI device, " | ||
883 | "BIOS handoff failed.\n"); | ||
884 | return; | ||
885 | } | ||
870 | if (pdev->class == PCI_CLASS_SERIAL_USB_UHCI) | 886 | if (pdev->class == PCI_CLASS_SERIAL_USB_UHCI) |
871 | quirk_usb_handoff_uhci(pdev); | 887 | quirk_usb_handoff_uhci(pdev); |
872 | else if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI) | 888 | else if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI) |
@@ -875,5 +891,6 @@ static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev) | |||
875 | quirk_usb_disable_ehci(pdev); | 891 | quirk_usb_disable_ehci(pdev); |
876 | else if (pdev->class == PCI_CLASS_SERIAL_USB_XHCI) | 892 | else if (pdev->class == PCI_CLASS_SERIAL_USB_XHCI) |
877 | quirk_usb_handoff_xhci(pdev); | 893 | quirk_usb_handoff_xhci(pdev); |
894 | pci_disable_device(pdev); | ||
878 | } | 895 | } |
879 | DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, quirk_usb_early_handoff); | 896 | DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, quirk_usb_early_handoff); |
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index 35e257f79c7b..557b6f32db86 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c | |||
@@ -93,7 +93,7 @@ static void xhci_usb2_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci, | |||
93 | */ | 93 | */ |
94 | memset(port_removable, 0, sizeof(port_removable)); | 94 | memset(port_removable, 0, sizeof(port_removable)); |
95 | for (i = 0; i < ports; i++) { | 95 | for (i = 0; i < ports; i++) { |
96 | portsc = xhci_readl(xhci, xhci->usb3_ports[i]); | 96 | portsc = xhci_readl(xhci, xhci->usb2_ports[i]); |
97 | /* If a device is removable, PORTSC reports a 0, same as in the | 97 | /* If a device is removable, PORTSC reports a 0, same as in the |
98 | * hub descriptor DeviceRemovable bits. | 98 | * hub descriptor DeviceRemovable bits. |
99 | */ | 99 | */ |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 36cbe2226a44..383fc857491c 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -1126,26 +1126,42 @@ static unsigned int xhci_parse_exponent_interval(struct usb_device *udev, | |||
1126 | } | 1126 | } |
1127 | 1127 | ||
1128 | /* | 1128 | /* |
1129 | * Convert bInterval expressed in frames (in 1-255 range) to exponent of | 1129 | * Convert bInterval expressed in microframes (in 1-255 range) to exponent of |
1130 | * microframes, rounded down to nearest power of 2. | 1130 | * microframes, rounded down to nearest power of 2. |
1131 | */ | 1131 | */ |
1132 | static unsigned int xhci_parse_frame_interval(struct usb_device *udev, | 1132 | static unsigned int xhci_microframes_to_exponent(struct usb_device *udev, |
1133 | struct usb_host_endpoint *ep) | 1133 | struct usb_host_endpoint *ep, unsigned int desc_interval, |
1134 | unsigned int min_exponent, unsigned int max_exponent) | ||
1134 | { | 1135 | { |
1135 | unsigned int interval; | 1136 | unsigned int interval; |
1136 | 1137 | ||
1137 | interval = fls(8 * ep->desc.bInterval) - 1; | 1138 | interval = fls(desc_interval) - 1; |
1138 | interval = clamp_val(interval, 3, 10); | 1139 | interval = clamp_val(interval, min_exponent, max_exponent); |
1139 | if ((1 << interval) != 8 * ep->desc.bInterval) | 1140 | if ((1 << interval) != desc_interval) |
1140 | dev_warn(&udev->dev, | 1141 | dev_warn(&udev->dev, |
1141 | "ep %#x - rounding interval to %d microframes, ep desc says %d microframes\n", | 1142 | "ep %#x - rounding interval to %d microframes, ep desc says %d microframes\n", |
1142 | ep->desc.bEndpointAddress, | 1143 | ep->desc.bEndpointAddress, |
1143 | 1 << interval, | 1144 | 1 << interval, |
1144 | 8 * ep->desc.bInterval); | 1145 | desc_interval); |
1145 | 1146 | ||
1146 | return interval; | 1147 | return interval; |
1147 | } | 1148 | } |
1148 | 1149 | ||
1150 | static unsigned int xhci_parse_microframe_interval(struct usb_device *udev, | ||
1151 | struct usb_host_endpoint *ep) | ||
1152 | { | ||
1153 | return xhci_microframes_to_exponent(udev, ep, | ||
1154 | ep->desc.bInterval, 0, 15); | ||
1155 | } | ||
1156 | |||
1157 | |||
1158 | static unsigned int xhci_parse_frame_interval(struct usb_device *udev, | ||
1159 | struct usb_host_endpoint *ep) | ||
1160 | { | ||
1161 | return xhci_microframes_to_exponent(udev, ep, | ||
1162 | ep->desc.bInterval * 8, 3, 10); | ||
1163 | } | ||
1164 | |||
1149 | /* Return the polling or NAK interval. | 1165 | /* Return the polling or NAK interval. |
1150 | * | 1166 | * |
1151 | * The polling interval is expressed in "microframes". If xHCI's Interval field | 1167 | * The polling interval is expressed in "microframes". If xHCI's Interval field |
@@ -1164,7 +1180,7 @@ static unsigned int xhci_get_endpoint_interval(struct usb_device *udev, | |||
1164 | /* Max NAK rate */ | 1180 | /* Max NAK rate */ |
1165 | if (usb_endpoint_xfer_control(&ep->desc) || | 1181 | if (usb_endpoint_xfer_control(&ep->desc) || |
1166 | usb_endpoint_xfer_bulk(&ep->desc)) { | 1182 | usb_endpoint_xfer_bulk(&ep->desc)) { |
1167 | interval = ep->desc.bInterval; | 1183 | interval = xhci_parse_microframe_interval(udev, ep); |
1168 | break; | 1184 | break; |
1169 | } | 1185 | } |
1170 | /* Fall through - SS and HS isoc/int have same decoding */ | 1186 | /* Fall through - SS and HS isoc/int have same decoding */ |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 6bbe3c3a7111..c939f5fdef9e 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -352,6 +352,11 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd) | |||
352 | /* hcd->irq is -1, we have MSI */ | 352 | /* hcd->irq is -1, we have MSI */ |
353 | return 0; | 353 | return 0; |
354 | 354 | ||
355 | if (!pdev->irq) { | ||
356 | xhci_err(xhci, "No msi-x/msi found and no IRQ in BIOS\n"); | ||
357 | return -EINVAL; | ||
358 | } | ||
359 | |||
355 | /* fall back to legacy interrupt*/ | 360 | /* fall back to legacy interrupt*/ |
356 | ret = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED, | 361 | ret = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED, |
357 | hcd->irq_descr, hcd); | 362 | hcd->irq_descr, hcd); |