usb/host/ehci-hub: Fix the issue EG20T USB host controller has long resuming time, when pen drive is attached.
Subsystems (2)
PATCH 1/1 usb/host/ehci-hub: Fix the issue EG20T USB host controller has long resuming time, when pen drive is attached.
--- drivers/usb/host/ehci-hub.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/usb/host/ehci-hub.c +4 -0
@@ -207,6 +207,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)int port;int mask;int changed; +int temp;ehci_dbg (ehci,"suspend root hub\n" );
@@ -324,6 +325,9 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)* want, and so we must delete any pending watchdog timer events. */ del_timer_sync (&ehci->watchdog); + temp =ehci_readl (ehci, &ehci->regs->status); +if (temp &STS_FLR ) +ehci_writel (ehci,STS_FLR , &ehci->regs->status);return 0 ; }
Signature · 1 line
1.7.4.4
Alan Stern
maintainerQuoted 2 lines · Tomoya MORINAGA
Signed-off-by Tomoya MORINAGA <[email protected]>
There's no patch description. What is the cause of the problem and how does the patch fix it?
Quoted 17 lines
--- drivers/usb/host/ehci-hub.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)drivers/usb/host/ehci-hub.c +1
-0@@ -207,6 +207,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)int port;int mask;int changed; +int temp;ehci_dbg (ehci,"suspend root hub\n" );
drivers/usb/host/ehci-hub.c static int ehci_bus_suspend (struct usb_hcd *hcd) · line 331
Quoted 7 lines
drivers/usb/host/ehci-hub.c +3
-0@@ -324,6 +325,9 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)* want, and so we must delete any pending watchdog timer events. */ del_timer_sync (&ehci->watchdog); + temp =ehci_readl (ehci, &ehci->regs->status); +if (temp &STS_FLR ) +ehci_writel (ehci,STS_FLR , &ehci->regs->status);return 0 ;
Operations like this should be done while holding the spinlock.
Also, why do you need the ehci_readl and the test? You could always clear the STS_FLR flag.
Alan Stern
PATCH v2 1/1 usb/host/ehci-hub: Fix the issue EG20T USB host controller has long resuming time, when pen drive is attached.
In reply to Tomoya MORINAGAIntel EG20T USB host controller does not send SOF in resuming time after suspending, if the FLR bit was not cleared. When pen drive is attached, the controller has a long resuming time to try re-connect it. This patch clear the FLR bit in suspending time for fixing the issue.
---
v2: Update comments from Alan Stern
Add patch description
Always clear the STS_FLR flag.
--- drivers/usb/host/ehci-hub.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/usb/host/ehci-hub.c +1 -0
@@ -318,6 +318,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)ehci_readl (ehci, &ehci->regs->intr_enable); ehci->next_statechange = jiffies +msecs_to_jiffies (10 ); +ehci_writel (ehci,STS_FLR , &ehci->regs->status);spin_unlock_irq (&ehci->lock);/* ehci_work() may have re-enabled the watchdog timer, which we do not
Signature · 1 line
1.7.4.4
Alan Stern
maintainerQuoted 20 lines · Tomoya MORINAGA
Intel EG20T USB host controller does not send SOF in resuming time after suspending, if the FLR bit was not cleared. When pen drive is attached, the controller has a long resuming time to try re-connect it. This patch clear the FLR bit in suspending time for fixing the issue.
Signed-off-by Tomoya MORINAGA <[email protected]>---
v2: Update comments from Alan Stern
Add patch description
Always clear theSTS_FLRflag.--- drivers/usb/host/ehci-hub.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)drivers/usb/host/ehci-hub.c +0
-0
drivers/usb/host/ehci-hub.c static int ehci_bus_suspend (struct usb_hcd *hcd) · line 322
Quoted 5 lines
drivers/usb/host/ehci-hub.c +1
-0@@ -318,6 +318,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)ehci_readl (ehci, &ehci->regs->intr_enable); ehci->next_statechange = jiffies +msecs_to_jiffies (10 ); +ehci_writel (ehci,STS_FLR , &ehci->regs->status);spin_unlock_irq (&ehci->lock);
You need to add a comment to the code also. Otherwise, a few years from now somebody will see that line, realize it doesn't do anything important, and get rid of it.
Alan Stern
PATCH v3 1/1 usb/host/ehci-hub: Fix the issue EG20T USB host controller has long resuming time, when pen drive is attached.
In reply to Tomoya MORINAGAIntel EG20T USB host controller does not send SOF in resuming time after suspending, if the FLR bit was not cleared. When pen drive is attached, the controller has a long resuming time to try re-connect it. This patch clear the FLR bit in suspending time for fixing the issue.
---
v3: Update comments from Alan Stern
Add comment in the source code.
v2: Update comments from Alan Stern
Add patch description
Always clear the STS_FLR flag.
--- drivers/usb/host/ehci-hub.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/usb/host/ehci-hub.c +7 -0
@@ -318,6 +318,13 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)ehci_readl (ehci, &ehci->regs->intr_enable); ehci->next_statechange = jiffies +msecs_to_jiffies (10 ); + +/* Intel EG20T USB host controller does not send SOF +* in resuming time after suspending, if the FLR bit was not cleared. +* Therefore clear the FLR bit in here. +*/ +ehci_writel (ehci,STS_FLR , &ehci->regs->status); +spin_unlock_irq (&ehci->lock);/* ehci_work() may have re-enabled the watchdog timer, which we do not
Signature · 1 line
1.7.4.4
Quoted 5 lines · Tomoya MORINAGA
Intel EG20T USB host controller does not send SOF in resuming time after suspending, if the FLR bit was not cleared. When pen drive is attached, the controller has a long resuming time to try re-connect it. This patch clear the FLR bit in suspending time for fixing the issue.
Quoted 8 lines
Signed-off-by Tomoya MORINAGA <[email protected]>---
v3: Update comments from Alan Stern
Add comment in the source code.v2: Update comments from Alan Stern
Add patch description
Always clear theSTS_FLRflag.