diff mbox

ARM: OMAP: Disable USB interrupt in the musb_resume() function

Message ID 4d34a0a70901310021l6f42b34es24ca320e44c51ae6@mail.gmail.com (mailing list archive)
State Not Applicable, archived
Delegated to: Felipe Balbi
Headers show

Commit Message

kim kyuwon Jan. 31, 2009, 8:21 a.m. UTC
USB should be suspended with interrupt disabled[1]. If USB is suspended with
interrupt enabled and connected to host PC, a kernel panic would occur When
it wakes up. Because, after the arch_suspend_enable_irqs() function is called
in the suspend_enter() function, USB Interrupt handler is called, even though
USB controller is still not resumed! All devices are resumed after the
device_resume() is called.

[1] /Documentation/power/devices.txt: 412 line

Signed-off-by: Kim Kyuwon <chammoru@gmail.com>
---
 drivers/usb/musb/musb_core.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

 		 * the system up quickly enough to respond ...
@@ -2184,6 +2186,8 @@ static int musb_resume(struct platform_device *pdev)
 	else
 		clk_enable(musb->clock);

+	enable_irq(musb->nIrq);
+
 	/* for static cmos like DaVinci, register values were preserved
 	 * unless for some reason the whole soc powered down and we're
 	 * not treating that as a whole-system restart (e.g. swsusp)

Comments

Tony Lindgren Feb. 3, 2009, 8:42 p.m. UTC | #1
* Kim Kyuwon <chammoru@gmail.com> [090131 00:22]:
> USB should be suspended with interrupt disabled[1]. If USB is suspended with
> interrupt enabled and connected to host PC, a kernel panic would occur When
> it wakes up. Because, after the arch_suspend_enable_irqs() function is called
> in the suspend_enter() function, USB Interrupt handler is called, even though
> USB controller is still not resumed! All devices are resumed after the
> device_resume() is called.

Please send the usb patches to the linux-usb@vger.kernel.org list
with linux-omap list Cc'd.

Regards,

Tony


> [1] /Documentation/power/devices.txt: 412 line
> 
> Signed-off-by: Kim Kyuwon <chammoru@gmail.com>
> ---
>  drivers/usb/musb/musb_core.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index 2cc34fa..0dfe15e 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -2151,6 +2151,8 @@ static int musb_suspend(struct platform_device
> *pdev, pm_message_t message)
> 
>  	spin_lock_irqsave(&musb->lock, flags);
> 
> +	disable_irq(musb->nIrq);
> +
>  	if (is_peripheral_active(musb)) {
>  		/* FIXME force disconnect unless we know USB will wake
>  		 * the system up quickly enough to respond ...
> @@ -2184,6 +2186,8 @@ static int musb_resume(struct platform_device *pdev)
>  	else
>  		clk_enable(musb->clock);
> 
> +	enable_irq(musb->nIrq);
> +
>  	/* for static cmos like DaVinci, register values were preserved
>  	 * unless for some reason the whole soc powered down and we're
>  	 * not treating that as a whole-system restart (e.g. swsusp)
> -- 
> Kim Kyuwon
> --
> 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
--
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
Felipe Balbi Feb. 3, 2009, 10:28 p.m. UTC | #2
On Tue, Feb 03, 2009 at 12:42:36PM -0800, Tony Lindgren wrote:
> * Kim Kyuwon <chammoru@gmail.com> [090131 00:22]:
> > USB should be suspended with interrupt disabled[1]. If USB is suspended with
> > interrupt enabled and connected to host PC, a kernel panic would occur When
> > it wakes up. Because, after the arch_suspend_enable_irqs() function is called
> > in the suspend_enter() function, USB Interrupt handler is called, even though
> > USB controller is still not resumed! All devices are resumed after the
> > device_resume() is called.
> 
> Please send the usb patches to the linux-usb@vger.kernel.org list
> with linux-omap list Cc'd.

and Cc me as well and David Brownell
kim kyuwon Feb. 3, 2009, 11:33 p.m. UTC | #3
On Wed, Feb 4, 2009 at 7:28 AM, Felipe Balbi <me@felipebalbi.com> wrote:
> On Tue, Feb 03, 2009 at 12:42:36PM -0800, Tony Lindgren wrote:
>> * Kim Kyuwon <chammoru@gmail.com> [090131 00:22]:
>> > USB should be suspended with interrupt disabled[1]. If USB is suspended with
>> > interrupt enabled and connected to host PC, a kernel panic would occur When
>> > it wakes up. Because, after the arch_suspend_enable_irqs() function is called
>> > in the suspend_enter() function, USB Interrupt handler is called, even though
>> > USB controller is still not resumed! All devices are resumed after the
>> > device_resume() is called.
>>
>> Please send the usb patches to the linux-usb@vger.kernel.org list
>> with linux-omap list Cc'd.
>
> and Cc me as well and David Brownell
>

OK.
I will resend this patch to the linux-usb@vger.kernel.org list with CCing
linux-omap list, Felipe Balbi and David Brownell

> --
> balbi
>
diff mbox

Patch

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 2cc34fa..0dfe15e 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2151,6 +2151,8 @@  static int musb_suspend(struct platform_device
*pdev, pm_message_t message)

 	spin_lock_irqsave(&musb->lock, flags);

+	disable_irq(musb->nIrq);
+
 	if (is_peripheral_active(musb)) {
 		/* FIXME force disconnect unless we know USB will wake