public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [Fwd: patch usb-ehci-ensure-all-watchdog-timer-events-are-deleted-when-suspending-usb.patch added to gregkh-2.6 tree]
@ 2009-08-14 17:40 Jon Hunter
  2009-08-14 18:20 ` Kevin Hilman
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Hunter @ 2009-08-14 17:40 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org

Hi All,

I just thought I would send out this patch as an FYI. We recently ran 
into an issue where we were getting a kernel panic in the ehci driver 
when entering suspend on the omap3. We discussed this with the linux-usb 
folks and they recommended the below fix. This problem is hard to 
reproduce, but has not been seen since adding this fix. Anyway the 
details are below.

Cheers
Jon

-------- Original Message --------
Subject: patch 
usb-ehci-ensure-all-watchdog-timer-events-are-deleted-when-suspending-usb.patch 
added to gregkh-2.6 tree
Date: Fri, 14 Aug 2009 11:48:45 -0500
From: gregkh@suse.de <gregkh@suse.de>
To: Hunter, Jon <jon-hunter@ti.com>, fei.yang@motorola.com 
<fei.yang@motorola.com>, gregkh@suse.de <gregkh@suse.de>, 
greg@kroah.com	<greg@kroah.com>, stern@rowland.harvard.edu 
<stern@rowland.harvard.edu>


This is a note to let you know that I've just added the patch titled

     Subject: USB: EHCI: ensure all watchdog timer events are deleted 
when suspending usb

to my gregkh-2.6 tree.  Its filename is

 
usb-ehci-ensure-all-watchdog-timer-events-are-deleted-when-suspending-usb.patch

This tree can be found at
 
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


 From stern@rowland.harvard.edu  Thu Aug 13 16:37:16 2009
From: Jon Hunter <jon-hunter@ti.com>
Date: Wed, 12 Aug 2009 11:57:59 -0400 (EDT)
Subject: USB: EHCI: ensure all watchdog timer events are deleted when 
suspending usb
To: Greg KH <greg@kroah.com>, Jon Hunter <jon-hunter@ti.com>
Cc: Fei Yang <fei.yang@motorola.com>
Message-ID: <Pine.LNX.4.44L0.0908121157090.9635-100000@iolanthe.rowland.org>


From: Jon Hunter <jon-hunter@ti.com>

This patch was previously discussed in the following thread:
http://thread.gmane.org/gmane.linux.usb.general/19472/focus=19484

On the OMAP3 device the usbhost controller is in a separate internal
power-domain. So when the usbhost is inactive or suspend is called,
we can disable clocks and power-down the usbhost to save power.

Recently we found that after calling ehci_bus_suspend() and disabling
the usbhost clocks we would see the ehci watchdog timer event fire. This
was causing a kernel panic because the usbhost controllers clocks were
disabled and inside the watchdog timer function the clocks were not
being re-enabled, so when the ehci registers were accessed this resulted
in a CPU data-abort.

To avoid this panic, per recommendation from Alan Stern (see above 
thread), we
make sure any pending timer events (that may have been scheduled by calling
ehci_work within the ehci_bus_suspend() function) are deleted before 
returning.

Signed-off-by: Fei Yang <fei.yang@motorola.com>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
  drivers/usb/host/ehci-hub.c |    5 +++++
  1 file changed, 5 insertions(+)

--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -209,6 +209,11 @@ static int ehci_bus_suspend (struct usb_

  	ehci->next_statechange = jiffies + msecs_to_jiffies(10);
  	spin_unlock_irq (&ehci->lock);
+
+	/* ehci_work() may have re-enabled the watchdog timer, which we do not
+	 * want, and so we must delete any pending watchdog timer events.
+	 */
+	del_timer_sync(&ehci->watchdog);
  	return 0;
  }




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

* Re: [Fwd: patch usb-ehci-ensure-all-watchdog-timer-events-are-deleted-when-suspending-usb.patch added to gregkh-2.6 tree]
  2009-08-14 17:40 [Fwd: patch usb-ehci-ensure-all-watchdog-timer-events-are-deleted-when-suspending-usb.patch added to gregkh-2.6 tree] Jon Hunter
@ 2009-08-14 18:20 ` Kevin Hilman
  2009-08-14 18:44   ` Jon Hunter
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Hilman @ 2009-08-14 18:20 UTC (permalink / raw)
  To: Jon Hunter; +Cc: linux-omap@vger.kernel.org

Jon Hunter <jon-hunter@ti.com> writes:

> Hi All,
>
> I just thought I would send out this patch as an FYI. We recently ran
> into an issue where we were getting a kernel panic in the ehci driver
> when entering suspend on the omap3. We discussed this with the
> linux-usb folks and they recommended the below fix. This problem is
> hard to reproduce, but has not been seen since adding this fix. Anyway
> the details are below.
>

Jon,

Do you know if this will be queued as a fix for .31?  or if it will wait
for the .32 merge window.

Kevin

>
> -------- Original Message --------
> Subject: patch
> usb-ehci-ensure-all-watchdog-timer-events-are-deleted-when-suspending-usb.patch
> added to gregkh-2.6 tree
> Date: Fri, 14 Aug 2009 11:48:45 -0500
> From: gregkh@suse.de <gregkh@suse.de>
> To: Hunter, Jon <jon-hunter@ti.com>, fei.yang@motorola.com
> <fei.yang@motorola.com>, gregkh@suse.de <gregkh@suse.de>,
> greg@kroah.com	<greg@kroah.com>, stern@rowland.harvard.edu
> <stern@rowland.harvard.edu>
>
>
> This is a note to let you know that I've just added the patch titled
>
>     Subject: USB: EHCI: ensure all watchdog timer events are deleted
> when suspending usb
>
> to my gregkh-2.6 tree.  Its filename is
>
>
> usb-ehci-ensure-all-watchdog-timer-events-are-deleted-when-suspending-usb.patch
>
> This tree can be found at
>
> http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/
>
>
> From stern@rowland.harvard.edu  Thu Aug 13 16:37:16 2009
> From: Jon Hunter <jon-hunter@ti.com>
> Date: Wed, 12 Aug 2009 11:57:59 -0400 (EDT)
> Subject: USB: EHCI: ensure all watchdog timer events are deleted when
> suspending usb
> To: Greg KH <greg@kroah.com>, Jon Hunter <jon-hunter@ti.com>
> Cc: Fei Yang <fei.yang@motorola.com>
> Message-ID: <Pine.LNX.4.44L0.0908121157090.9635-100000@iolanthe.rowland.org>
>
>
> From: Jon Hunter <jon-hunter@ti.com>
>
> This patch was previously discussed in the following thread:
> http://thread.gmane.org/gmane.linux.usb.general/19472/focus=19484
>
> On the OMAP3 device the usbhost controller is in a separate internal
> power-domain. So when the usbhost is inactive or suspend is called,
> we can disable clocks and power-down the usbhost to save power.
>
> Recently we found that after calling ehci_bus_suspend() and disabling
> the usbhost clocks we would see the ehci watchdog timer event fire. This
> was causing a kernel panic because the usbhost controllers clocks were
> disabled and inside the watchdog timer function the clocks were not
> being re-enabled, so when the ehci registers were accessed this resulted
> in a CPU data-abort.
>
> To avoid this panic, per recommendation from Alan Stern (see above
> thread), we
> make sure any pending timer events (that may have been scheduled by calling
> ehci_work within the ehci_bus_suspend() function) are deleted before
> returning.
>
> Signed-off-by: Fei Yang <fei.yang@motorola.com>
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
>
> ---
>  drivers/usb/host/ehci-hub.c |    5 +++++
>  1 file changed, 5 insertions(+)
>
> --- a/drivers/usb/host/ehci-hub.c
> +++ b/drivers/usb/host/ehci-hub.c
> @@ -209,6 +209,11 @@ static int ehci_bus_suspend (struct usb_
>
>  	ehci->next_statechange = jiffies + msecs_to_jiffies(10);
>  	spin_unlock_irq (&ehci->lock);
> +
> +	/* ehci_work() may have re-enabled the watchdog timer, which we do not
> +	 * want, and so we must delete any pending watchdog timer events.
> +	 */
> +	del_timer_sync(&ehci->watchdog);
>  	return 0;
>  }
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [Fwd: patch usb-ehci-ensure-all-watchdog-timer-events-are-deleted-when-suspending-usb.patch added to gregkh-2.6 tree]
  2009-08-14 18:20 ` Kevin Hilman
@ 2009-08-14 18:44   ` Jon Hunter
  0 siblings, 0 replies; 3+ messages in thread
From: Jon Hunter @ 2009-08-14 18:44 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-omap@vger.kernel.org


Kevin Hilman wrote:
> Jon,
> 
> Do you know if this will be queued as a fix for .31?  or if it will wait
> for the .32 merge window.
> 
> Kevin

I am not sure. I was just browsing Greg's page and I found the following 
text file.

http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/series

Here Greg has a list of patches for .31. This patch is not part of what 
he has planned for .31. The patch is listed under "USB stuff  (after 
2.6.30 is out)", however, I believe that this is a typo, as this is 
under the main heading "Stuff to be merged after 2.6.31 is out". So I 
would presume this would come after .31 in .32 if there are no issues.

Cheers
Jon




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

end of thread, other threads:[~2009-08-14 18:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-14 17:40 [Fwd: patch usb-ehci-ensure-all-watchdog-timer-events-are-deleted-when-suspending-usb.patch added to gregkh-2.6 tree] Jon Hunter
2009-08-14 18:20 ` Kevin Hilman
2009-08-14 18:44   ` Jon Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox