[meego-commits] 23515: Changes to MeeGo:1.2:oss:Testing/kernel-adaptation-oaktrail
Kangkai Yin
no_reply at build.meego.com
Wed Aug 3 08:26:07 UTC 2011
Hi,
I have made the following changes to kernel-adaptation-oaktrail in project MeeGo:1.2:oss:Testing. Please review and accept ASAP.
Thank You,
Kangkai Yin
[This message was auto-generated]
---
Request #23515:
submit: devel:kernel:1.2/kernel-adaptation-oaktrail(r11)(update) -> MeeGo:1.2:oss:Testing/kernel-adaptation-oaktrail
Message:
Special woraround for Intel Oaktrail MPH root hub. Fix BMC# 15873.
State: new 2011-08-03T01:25:58 kai
Comment: None
changes files:
--------------
--- kernel.changes
+++ kernel.changes
@@ -0,0 +1,3 @@
+* Wed Aug 3 2011 - Wang Zhi <zhi.wang at windriver.com> - 2.6.37.6
+- Special woraround for Intel Oaktrail MPH root hub. Fix BMC# 15873.
+
new:
----
linux-2.6.37-usb-host-controller-workaround-ic-bugs.patch
spec files:
-----------
--- kernel-adaptation-oaktrail.spec
+++ kernel-adaptation-oaktrail.spec
@@ -346,6 +346,9 @@
Patch339: linux-2.6.37-hso-fix-a-use-after-free-condition.patch
Patch340: linux-2.6.37-hso-enable-runtimePM.patch
+# Workaround USB Host Controller IC bugs.
+Patch341: linux-2.6.37-usb-host-controller-workaround-ic-bugs.patch
+
#
# End of the Oaktrail Adaptation patches
#
@@ -732,6 +735,10 @@
# linux-2.6.37-hso-enable-runtimePM.patch
%patch340 -p1
+# Workaround USB Host Controller IC bugs.
+# linux-2.6.37-usb-host-controller-workaround-ic-bugs.patch
+%patch341 -p1
+
#
# End of the Oaktrail Adaptation patches
#
other changes:
--------------
++++++ config-adaptation-oaktrail
--- config-adaptation-oaktrail
+++ config-adaptation-oaktrail
@@ -124,3 +124,5 @@
CONFIG_USB_ETH=m
CONFIG_USB_ETH_RNDIS=y
CONFIG_USB_FILE_STORAGE=m
+
+CONFIG_USB_SUSPEND=y
++++++ linux-2.6.37-usb-host-controller-workaround-ic-bugs.patch (new)
--- linux-2.6.37-usb-host-controller-workaround-ic-bugs.patch
+++ linux-2.6.37-usb-host-controller-workaround-ic-bugs.patch
+From: Wang Zhi <zhi.wang at windriver.com>
+Date: Wed, 03 Aug 2011 04:25:09 -0700
+Subject: [PATCH]: USB: Special workaround for Intel Oaktrail MPH root hub suspend
+
+Special woraround for Intel Oaktrail MPH root hub. Fix BMC 15873#.
+
+1. All ports suspended should be resumed before whole bus suspend, or the root
+hub of MPH core will fail to reset after system return from S3: reset never
+complete, PORT_RESET can't be cleared by SW. Sometimes can be recovered by
+device remote wakeup.
+
+2. EHCI SPEC p.28: Host The host controller will unconditionally set
+PORT_SUSPEND bit to a zero when:
+
+ a. Software sets the Force Port Resume bit to a zero (from a one).
+ b. Software sets the Port Reset bit to a one (from a zero).
+
+MPH appears to clear PORT_SUSPEND unexpectedly, when PORT_RESUME is set by
+SW(By printing PORTSC register, we can see PORT_RESUME is still
+set). Apparently ehci_bus_resume() relies on PORT_SUSPEND to stop USB bus
+resuming signals. So this IC bug will lead to an unexpected long resume on USB
+bus.
+
+Signed-off-by: Wang Zhi <zhi.wang at windriver.com>
+---
+ ehci-hub.c | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 106 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
+index 4d42194..de3f76d 100644
+--- a/drivers/usb/host/ehci-hub.c
++++ b/drivers/usb/host/ehci-hub.c
+@@ -200,6 +200,103 @@ static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci,
+ spin_unlock_irqrestore(&ehci->lock, flags);
+ }
+
++#ifdef CONFIG_INTEL_OAKTRAIL
++
++/* Special workround for Intel Oaktrail MPH root hub.
++ *
++ * 1. All ports suspended should be resumed before whole bus suspend,
++ * or the root hub of MPH core will fail to reset after system
++ * return from S3: reset never complete, PORT_RESET can't be cleared
++ * by SW. Sometimes can be recovered by device remote wakeup.
++ *
++ * 2. EHCI SPEC p.28: Host The host controller will unconditionally
++ * set PORT_SUSPEND bit to a zero when:
++ * a. Software sets the Force Port Resume bit to a zero (from a one).
++ * b. Software sets the Port Reset bit to a one (from a zero).
++ *
++ * MPH appears to clear PORT_SUSPEND unexpectedly, when PORT_RESUME is
++ * set by SW(By printing PORTSC register, we can see PORT_RESUME is
++ * still set). Apparently ehci_bus_resume() relies on PORT_SUSPEND to
++ * stop USB bus resuming signals. So this IC bug will lead to an
++ * unexpected long resume on USB bus.
++ *
++ * - By Wang Zhi<zhi.wang at windriver.com>
++ */
++
++static void oaktrail_rh_bus_suspend_workaround(struct ehci_hcd * ehci)
++{
++ u32 __iomem *hostpc_reg;
++
++ unsigned long resume_needed = 0;
++ unsigned long temp;
++
++ int i;
++
++ ehci_dbg(ehci, "special workaround for oaktrail\n");
++
++ spin_lock_irq(&ehci->lock);
++
++ if (ehci->has_hostpc) {
++ i = HCS_N_PORTS(ehci->hcs_params);
++ while (i--) {
++ hostpc_reg = (u32 __iomem *)((u8 *) ehci->regs
++ + HOSTPC0 + 4 * i);
++
++ temp = ehci_readl(ehci, hostpc_reg);
++
++ if (temp & HOSTPC_PHCD) {
++ ehci_writel(ehci, temp & ~HOSTPC_PHCD,
++ hostpc_reg);
++
++ ehci_dbg(ehci, "clear port %d low power mode\n",
++ i);
++ }
++ }
++ spin_unlock_irq(&ehci->lock);
++ msleep(5);
++ spin_lock_irq(&ehci->lock);
++ }
++
++ i = HCS_N_PORTS (ehci->hcs_params);
++ while (i--) {
++ temp = ehci_readl(ehci, &ehci->regs->port_status [i]);
++ temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS);
++
++ if (temp & PORT_SUSPEND) {
++ temp |= PORT_RESUME;
++ set_bit(i, &resume_needed);
++
++ ehci_dbg(ehci, "resuming port %d. \n", i);
++ }
++ ehci_writel(ehci, temp, &ehci->regs->port_status [i]);
++ }
++
++ if (resume_needed) {
++ spin_unlock_irq(&ehci->lock);
++ msleep(20);
++ spin_lock_irq(&ehci->lock);
++ }
++
++ i = HCS_N_PORTS (ehci->hcs_params);
++ while (i--) {
++ temp = ehci_readl(ehci, &ehci->regs->port_status [i]);
++ if (test_bit(i, &resume_needed)) {
++ temp &= ~(PORT_RWC_BITS | PORT_RESUME);
++ ehci_writel(ehci, temp, &ehci->regs->port_status [i]);
++
++ ehci_dbg(ehci, "resumed port %d. \n", i);
++ }
++ }
++
++ (void) ehci_readl(ehci, &ehci->regs->command);
++
++ spin_unlock_irq(&ehci->lock);
++
++ return;
++}
++
++#endif
++
+ static int ehci_bus_suspend (struct usb_hcd *hcd)
+ {
+ struct ehci_hcd *ehci = hcd_to_ehci (hcd);
+@@ -235,6 +332,12 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
+ }
+ }
+
++#ifdef CONFIG_INTEL_OAKTRAIL
++ spin_unlock_irq(&ehci->lock);
++ oaktrail_rh_bus_suspend_workaround(ehci);
++ spin_lock_irq(&ehci->lock);
++#endif
++
+ /* stop schedules, clean any completed work */
+ if (HC_IS_RUNNING(hcd->state)) {
+ ehci_quiesce (ehci);
+@@ -347,7 +450,7 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
+ u32 temp;
+ u32 power_okay;
+ int i;
+- u8 resume_needed = 0;
++ unsigned long resume_needed = 0;
+ int rc = 0;
+
+ if (time_before (jiffies, ehci->next_statechange))
+@@ -421,7 +524,7 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
+ if (test_bit(i, &ehci->bus_suspended) &&
+ (temp & PORT_SUSPEND)) {
+ temp |= PORT_RESUME;
+- resume_needed = 1;
++ set_bit(i, &resume_needed);
+ }
+ ehci_writel(ehci, temp, &ehci->regs->port_status [i]);
+ }
+@@ -437,7 +540,7 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
+ while (i--) {
+ temp = ehci_readl(ehci, &ehci->regs->port_status [i]);
+ if (test_bit(i, &ehci->bus_suspended) &&
+- (temp & PORT_SUSPEND)) {
++ test_bit(i, &resume_needed)) {
+ temp &= ~(PORT_RWC_BITS | PORT_RESUME);
+ ehci_writel(ehci, temp, &ehci->regs->port_status [i]);
+ ehci_vdbg (ehci, "resumed port %d\n", i + 1);
++++++ series
--- series
+++ series
@@ -196,6 +196,9 @@
linux-2.6.37-hso-fix-a-use-after-free-condition.patch
linux-2.6.37-hso-enable-runtimePM.patch
+# Workaround USB Host Controller IC bugs.
+linux-2.6.37-usb-host-controller-workaround-ic-bugs.patch
+
#
# End of the Oaktrail Adaptation patches
#
More information about the MeeGo-commits
mailing list