aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex He <alex.he@amd.com>2012-03-29 22:21:38 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-22 19:21:41 -0400
commit4701517be3f6950c7120f213c50270eff9ebe169 (patch)
tree1ab3f0c0fc06afcb8dc0c1fb5a93ba24a21df226
parent12faabb18deebe28d463ee150c0cefafbac482ae (diff)
xHCI: Correct the #define XHCI_LEGACY_DISABLE_SMI
commit 95018a53f7653e791bba1f54c8d75d9cb700d1bd upstream. Re-define XHCI_LEGACY_DISABLE_SMI and used it in right way. All SMI enable bits will be cleared to zero and flag bits 29:31 are also cleared to zero. Other bits should be presvered as Table 146. This patch should be backported to kernels as old as 2.6.31. Signed-off-by: Alex He <alex.he@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/pci-quirks.c10
-rw-r--r--drivers/usb/host/xhci-ext-caps.h5
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 3f387b832fe..7fec8bd202d 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -824,9 +824,13 @@ static void __devinit quirk_usb_handoff_xhci(struct pci_dev *pdev)
824 } 824 }
825 } 825 }
826 826
827 /* Disable any BIOS SMIs */ 827 val = readl(base + ext_cap_offset + XHCI_LEGACY_CONTROL_OFFSET);
828 writel(XHCI_LEGACY_DISABLE_SMI, 828 /* Mask off (turn off) any enabled SMIs */
829 base + ext_cap_offset + XHCI_LEGACY_CONTROL_OFFSET); 829 val &= XHCI_LEGACY_DISABLE_SMI;
830 /* Mask all SMI events bits, RW1C */
831 val |= XHCI_LEGACY_SMI_EVENTS;
832 /* Disable any BIOS SMIs and clear all SMI events*/
833 writel(val, base + ext_cap_offset + XHCI_LEGACY_CONTROL_OFFSET);
830 834
831 if (usb_is_intel_switchable_xhci(pdev)) 835 if (usb_is_intel_switchable_xhci(pdev))
832 usb_enable_xhci_ports(pdev); 836 usb_enable_xhci_ports(pdev);
diff --git a/drivers/usb/host/xhci-ext-caps.h b/drivers/usb/host/xhci-ext-caps.h
index ce5c9e51748..4206f6bef6f 100644
--- a/drivers/usb/host/xhci-ext-caps.h
+++ b/drivers/usb/host/xhci-ext-caps.h
@@ -62,8 +62,9 @@
62/* USB Legacy Support Control and Status Register - section 7.1.2 */ 62/* USB Legacy Support Control and Status Register - section 7.1.2 */
63/* Add this offset, plus the value of xECP in HCCPARAMS to the base address */ 63/* Add this offset, plus the value of xECP in HCCPARAMS to the base address */
64#define XHCI_LEGACY_CONTROL_OFFSET (0x04) 64#define XHCI_LEGACY_CONTROL_OFFSET (0x04)
65/* bits 1:2, 5:12, and 17:19 need to be preserved; bits 21:28 should be zero */ 65/* bits 1:3, 5:12, and 17:19 need to be preserved; bits 21:28 should be zero */
66#define XHCI_LEGACY_DISABLE_SMI ((0x3 << 1) + (0xff << 5) + (0x7 << 17)) 66#define XHCI_LEGACY_DISABLE_SMI ((0x7 << 1) + (0xff << 5) + (0x7 << 17))
67#define XHCI_LEGACY_SMI_EVENTS (0x7 << 29)
67 68
68/* command register values to disable interrupts and halt the HC */ 69/* command register values to disable interrupts and halt the HC */
69/* start/stop HC execution - do not write unless HC is halted*/ 70/* start/stop HC execution - do not write unless HC is halted*/