All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb/host/ehci-hub: Fix the issue EG20T USB host controller has long resuming time, when pen drive is attached.
@ 2012-07-11  0:28 Tomoya MORINAGA
  2012-07-11 14:24 ` Alan Stern
  2012-07-12  2:53 ` [PATCH v2] " Tomoya MORINAGA
  0 siblings, 2 replies; 6+ messages in thread
From: Tomoya MORINAGA @ 2012-07-11  0:28 UTC (permalink / raw)
  To: Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel; +Cc: Tomoya MORINAGA


Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
---
 drivers/usb/host/ehci-hub.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index fc9e7cc..d596d0f 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -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;
 }
 
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] usb/host/ehci-hub: Fix the issue EG20T USB host controller has long resuming time, when pen drive is attached.
  2012-07-11  0:28 [PATCH] usb/host/ehci-hub: Fix the issue EG20T USB host controller has long resuming time, when pen drive is attached Tomoya MORINAGA
@ 2012-07-11 14:24 ` Alan Stern
  2012-07-12  2:53 ` [PATCH v2] " Tomoya MORINAGA
  1 sibling, 0 replies; 6+ messages in thread
From: Alan Stern @ 2012-07-11 14:24 UTC (permalink / raw)
  To: Tomoya MORINAGA; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel

On Wed, 11 Jul 2012, Tomoya MORINAGA wrote:

> 
> Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>

There's no patch description.  What is the cause of the problem and how
does the patch fix it?

> ---
>  drivers/usb/host/ehci-hub.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
> index fc9e7cc..d596d0f 100644
> --- a/drivers/usb/host/ehci-hub.c
> +++ b/drivers/usb/host/ehci-hub.c
> @@ -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;

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] usb/host/ehci-hub: Fix the issue EG20T USB host controller has long resuming time, when pen drive is attached.
  2012-07-11  0:28 [PATCH] usb/host/ehci-hub: Fix the issue EG20T USB host controller has long resuming time, when pen drive is attached Tomoya MORINAGA
  2012-07-11 14:24 ` Alan Stern
@ 2012-07-12  2:53 ` Tomoya MORINAGA
  2012-07-12 14:44   ` Alan Stern
  2012-07-13  2:43   ` [PATCH v3] " Tomoya MORINAGA
  1 sibling, 2 replies; 6+ messages in thread
From: Tomoya MORINAGA @ 2012-07-12  2:53 UTC (permalink / raw)
  To: Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel; +Cc: 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 <tomoya.rohm@gmail.com>
---
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(-)

diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index fc9e7cc..818a2f1 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -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
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] usb/host/ehci-hub: Fix the issue EG20T USB host controller has long resuming time, when pen drive is attached.
  2012-07-12  2:53 ` [PATCH v2] " Tomoya MORINAGA
@ 2012-07-12 14:44   ` Alan Stern
  2012-07-13  2:43   ` [PATCH v3] " Tomoya MORINAGA
  1 sibling, 0 replies; 6+ messages in thread
From: Alan Stern @ 2012-07-12 14:44 UTC (permalink / raw)
  To: Tomoya MORINAGA; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel

On Thu, 12 Jul 2012, Tomoya MORINAGA wrote:

> 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 <tomoya.rohm@gmail.com>
> ---
> 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(-)
> 
> diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
> index fc9e7cc..818a2f1 100644
> --- a/drivers/usb/host/ehci-hub.c
> +++ b/drivers/usb/host/ehci-hub.c
> @@ -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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3] usb/host/ehci-hub: Fix the issue EG20T USB host controller has long resuming time, when pen drive is attached.
  2012-07-12  2:53 ` [PATCH v2] " Tomoya MORINAGA
  2012-07-12 14:44   ` Alan Stern
@ 2012-07-13  2:43   ` Tomoya MORINAGA
  2012-07-13 14:11     ` Alan Stern
  1 sibling, 1 reply; 6+ messages in thread
From: Tomoya MORINAGA @ 2012-07-13  2:43 UTC (permalink / raw)
  To: Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel; +Cc: 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 <tomoya.rohm@gmail.com>
---
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(-)

diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index fc9e7cc..278b589 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -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
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] usb/host/ehci-hub: Fix the issue EG20T USB host controller has long resuming time, when pen drive is attached.
  2012-07-13  2:43   ` [PATCH v3] " Tomoya MORINAGA
@ 2012-07-13 14:11     ` Alan Stern
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Stern @ 2012-07-13 14:11 UTC (permalink / raw)
  To: Tomoya MORINAGA; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel

On Fri, 13 Jul 2012, Tomoya MORINAGA wrote:

> 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 <tomoya.rohm@gmail.com>
> ---
> 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.

Acked-by: Alan Stern <stern@rowland.harvard.edu>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-07-13 14:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-11  0:28 [PATCH] usb/host/ehci-hub: Fix the issue EG20T USB host controller has long resuming time, when pen drive is attached Tomoya MORINAGA
2012-07-11 14:24 ` Alan Stern
2012-07-12  2:53 ` [PATCH v2] " Tomoya MORINAGA
2012-07-12 14:44   ` Alan Stern
2012-07-13  2:43   ` [PATCH v3] " Tomoya MORINAGA
2012-07-13 14:11     ` Alan Stern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.