* Questions about masking interrupts when disabling interrupts
@ 2009-01-06 2:59 김규원
2009-01-07 13:05 ` Tony Lindgren
0 siblings, 1 reply; 5+ messages in thread
From: 김규원 @ 2009-01-06 2:59 UTC (permalink / raw)
To: linux-omap; +Cc: 박경민, 허성관
Greetings,
I'm enabling the Suspend-to-RAM state in our new OMAP3 Board.
But I had some problems because of USB Interrupt.
Although I disabled USB interrupt by disable_irq() function while
entering the Suspend,
M_IRQ_92 irq continuously wake up the OMAP3430 Processor.
So, I fixed this problem as following patch.
My Questions are:
1. Could anyone suggest the better solution for this problem?
2. If there is no better solution, can I be applied this patch to omap-tree?
Thank you!
commit bbb49321b161e6a9ff2b73326d4012d8eb8bbf23
Author: Kim Kyuwon <chammoru@gmail.com>
Date: Tue Jan 6 10:11:46 2009 +0900
ARM: OMAP3: Mask interrupts when disabling interrupts
By Ingo Molnar, interrupts are not masked by default.
(refer to 76d2160147f43f982dfe881404cfde9fd0a9da21)
But if interrupts are not masked, the processor can wake up while in
Suspend-to-RAM state by an external interrupt. For example, if an
OMAP3 board
is connected to Host PC by USB and entered to Suspend-to-RAM
state, it wake up
automatically by M_IRQ_92. The disable_irq() function can't disable the
interrupt in H/W level, So I modified arch/arm/mach-omap2/irq.c
Signed-off-by: Kim Kyuwon <chammoru@gmail.com>
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 110acb9..b44dcae 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -123,6 +123,11 @@ static void omap_unmask_irq(unsigned int irq)
intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_CLEAR0 + offset);
}
+static void omap_disable_irq(unsigned int irq)
+{
+ omap_mask_irq(irq);
+}
+
static void omap_mask_ack_irq(unsigned int irq)
{
omap_mask_irq(irq);
@@ -134,6 +139,7 @@ static struct irq_chip omap_irq_chip = {
.ack = omap_mask_ack_irq,
.mask = omap_mask_irq,
.unmask = omap_unmask_irq,
+ .disable = omap_disable_irq,
};
static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
--
Kim Kyuwon
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: Questions about masking interrupts when disabling interrupts
2009-01-06 2:59 Questions about masking interrupts when disabling interrupts 김규원
@ 2009-01-07 13:05 ` Tony Lindgren
2009-01-08 1:27 ` Kim Kyuwon
0 siblings, 1 reply; 5+ messages in thread
From: Tony Lindgren @ 2009-01-07 13:05 UTC (permalink / raw)
To: 김규원
Cc: linux-omap, 박경민, 허성관
* 김규원 <chammoru@gmail.com> [090106 04:59]:
> Greetings,
>
> I'm enabling the Suspend-to-RAM state in our new OMAP3 Board.
> But I had some problems because of USB Interrupt.
>
> Although I disabled USB interrupt by disable_irq() function while
> entering the Suspend,
> M_IRQ_92 irq continuously wake up the OMAP3430 Processor.
>
> So, I fixed this problem as following patch.
>
> My Questions are:
> 1. Could anyone suggest the better solution for this problem?
Maybe suspend the USΒ too? :)
> 2. If there is no better solution, can I be applied this patch to omap-tree?
The patch looks OK to me, assuming the default enable calls unmask?
Regards,
Tony
>
> Thank you!
>
> commit bbb49321b161e6a9ff2b73326d4012d8eb8bbf23
> Author: Kim Kyuwon <chammoru@gmail.com>
> Date: Tue Jan 6 10:11:46 2009 +0900
>
> ARM: OMAP3: Mask interrupts when disabling interrupts
>
> By Ingo Molnar, interrupts are not masked by default.
> (refer to 76d2160147f43f982dfe881404cfde9fd0a9da21)
>
> But if interrupts are not masked, the processor can wake up while in
> Suspend-to-RAM state by an external interrupt. For example, if an
> OMAP3 board
> is connected to Host PC by USB and entered to Suspend-to-RAM
> state, it wake up
> automatically by M_IRQ_92. The disable_irq() function can't disable the
> interrupt in H/W level, So I modified arch/arm/mach-omap2/irq.c
>
> Signed-off-by: Kim Kyuwon <chammoru@gmail.com>
>
> diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
> index 110acb9..b44dcae 100644
> --- a/arch/arm/mach-omap2/irq.c
> +++ b/arch/arm/mach-omap2/irq.c
> @@ -123,6 +123,11 @@ static void omap_unmask_irq(unsigned int irq)
> intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_CLEAR0 + offset);
> }
>
> +static void omap_disable_irq(unsigned int irq)
> +{
> + omap_mask_irq(irq);
> +}
> +
> static void omap_mask_ack_irq(unsigned int irq)
> {
> omap_mask_irq(irq);
> @@ -134,6 +139,7 @@ static struct irq_chip omap_irq_chip = {
> .ack = omap_mask_ack_irq,
> .mask = omap_mask_irq,
> .unmask = omap_unmask_irq,
> + .disable = omap_disable_irq,
> };
>
> static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
> --
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Questions about masking interrupts when disabling interrupts
2009-01-07 13:05 ` Tony Lindgren
@ 2009-01-08 1:27 ` Kim Kyuwon
2009-01-08 3:57 ` Fwd: " Kim Kyuwon
2009-01-09 12:04 ` Tony Lindgren
0 siblings, 2 replies; 5+ messages in thread
From: Kim Kyuwon @ 2009-01-08 1:27 UTC (permalink / raw)
To: Tony Lindgren
Cc: linux-omap, 박경민, 허성관
Thanks Tony very much for your reply!
On Wed, Jan 7, 2009 at 10:05 PM, Tony Lindgren <tony@atomide.com> wrote:
> * 김규원 <chammoru@gmail.com> [090106 04:59]:
>> Greetings,
>>
>> I'm enabling the Suspend-to-RAM state in our new OMAP3 Board.
>> But I had some problems because of USB Interrupt.
>>
>> Although I disabled USB interrupt by disable_irq() function while
>> entering the Suspend,
>> M_IRQ_92 irq continuously wake up the OMAP3430 Processor.
>>
>> So, I fixed this problem as following patch.
>>
>> My Questions are:
>> 1. Could anyone suggest the better solution for this problem?
>
> Maybe suspend the USΒ too? :)
I confirmed musb_suspend() function was invoked while entering Suspend-to-RAM
state. musb_suspend() didn't disable USB interrupt, but only USB clock. Devices
should be suspended with interrupts disabled
(/Documenttation/power/devices.txt - 412line)
So I modified musb_suspend() to disable USB interrupt
(I'm planning to send this patch very soon)
I even wrote 0 to PM_WKEN_USBHOST[EN_USBHOST] bit. But our OMAP3430 board
still have woken up by USB interrupt, because disable_irq() didn't mask the
interrupt.
>
>> 2. If there is no better solution, can I be applied this patch to omap-tree?
>
> The patch looks OK to me, assuming the default enable calls unmask?
>
Right, default_enable() function(kernel/irq/chip.c 222line) calls unmask
> Regards,
>
> Tony
>
>>
>> Thank you!
>>
>> commit bbb49321b161e6a9ff2b73326d4012d8eb8bbf23
>> Author: Kim Kyuwon <chammoru@gmail.com>
>> Date: Tue Jan 6 10:11:46 2009 +0900
>>
>> ARM: OMAP3: Mask interrupts when disabling interrupts
>>
>> By Ingo Molnar, interrupts are not masked by default.
>> (refer to 76d2160147f43f982dfe881404cfde9fd0a9da21)
>>
>> But if interrupts are not masked, the processor can wake up while in
>> Suspend-to-RAM state by an external interrupt. For example, if an
>> OMAP3 board
>> is connected to Host PC by USB and entered to Suspend-to-RAM
>> state, it wake up
>> automatically by M_IRQ_92. The disable_irq() function can't disable the
>> interrupt in H/W level, So I modified arch/arm/mach-omap2/irq.c
>>
>> Signed-off-by: Kim Kyuwon <chammoru@gmail.com>
>>
>> diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
>> index 110acb9..b44dcae 100644
>> --- a/arch/arm/mach-omap2/irq.c
>> +++ b/arch/arm/mach-omap2/irq.c
>> @@ -123,6 +123,11 @@ static void omap_unmask_irq(unsigned int irq)
>> intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_CLEAR0 + offset);
>> }
>>
>> +static void omap_disable_irq(unsigned int irq)
>> +{
>> + omap_mask_irq(irq);
>> +}
>> +
>> static void omap_mask_ack_irq(unsigned int irq)
>> {
>> omap_mask_irq(irq);
>> @@ -134,6 +139,7 @@ static struct irq_chip omap_irq_chip = {
>> .ack = omap_mask_ack_irq,
>> .mask = omap_mask_irq,
>> .unmask = omap_unmask_irq,
>> + .disable = omap_disable_irq,
>> };
>>
>> static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
>> --
>> 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
>
Regards,
--
Kim Kyuwon
^ permalink raw reply [flat|nested] 5+ messages in thread* Fwd: Questions about masking interrupts when disabling interrupts
2009-01-08 1:27 ` Kim Kyuwon
@ 2009-01-08 3:57 ` Kim Kyuwon
2009-01-09 12:04 ` Tony Lindgren
1 sibling, 0 replies; 5+ messages in thread
From: Kim Kyuwon @ 2009-01-08 3:57 UTC (permalink / raw)
To: linux-omap
My Gmail account has some problems
I send again.
---------- Forwarded message ----------
From: Kim Kyuwon <chammoru@gmail.com>
Date: 2009/1/8
Subject: Re: Questions about masking interrupts when disabling interrupts
To: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org, 박경민 <kyungmin.park@samsung.com>, 허성관
<sk.heo@samsung.com>
Thanks Tony very much for your reply!
On Wed, Jan 7, 2009 at 10:05 PM, Tony Lindgren <tony@atomide.com> wrote:
> * 김규원 <chammoru@gmail.com> [090106 04:59]:
>> Greetings,
>>
>> I'm enabling the Suspend-to-RAM state in our new OMAP3 Board.
>> But I had some problems because of USB Interrupt.
>>
>> Although I disabled USB interrupt by disable_irq() function while
>> entering the Suspend,
>> M_IRQ_92 irq continuously wake up the OMAP3430 Processor.
>>
>> So, I fixed this problem as following patch.
>>
>> My Questions are:
>> 1. Could anyone suggest the better solution for this problem?
>
> Maybe suspend the USΒ too? :)
I confirmed musb_suspend() function was invoked while entering Suspend-to-RAM
state. musb_suspend() didn't disable USB interrupt, but only USB clock. Devices
should be suspended with interrupts disabled
(/Documenttation/power/devices.txt - 412line)
So I modified musb_suspend() to disable USB interrupt
(I'm planning to send this patch very soon)
I even wrote 0 to PM_WKEN_USBHOST[EN_USBHOST] bit. But our OMAP3430 board
still have woken up by USB interrupt, because disable_irq() didn't mask the
interrupt.
>
>> 2. If there is no better solution, can I be applied this patch to omap-tree?
>
> The patch looks OK to me, assuming the default enable calls unmask?
>
Right, default_enable() function(kernel/irq/chip.c 222line) calls unmask
> Regards,
>
> Tony
>
>>
>> Thank you!
>>
>> commit bbb49321b161e6a9ff2b73326d4012d8eb8bbf23
>> Author: Kim Kyuwon <chammoru@gmail.com>
>> Date: Tue Jan 6 10:11:46 2009 +0900
>>
>> ARM: OMAP3: Mask interrupts when disabling interrupts
>>
>> By Ingo Molnar, interrupts are not masked by default.
>> (refer to 76d2160147f43f982dfe881404cfde9fd0a9da21)
>>
>> But if interrupts are not masked, the processor can wake up while in
>> Suspend-to-RAM state by an external interrupt. For example, if an
>> OMAP3 board
>> is connected to Host PC by USB and entered to Suspend-to-RAM
>> state, it wake up
>> automatically by M_IRQ_92. The disable_irq() function can't disable the
>> interrupt in H/W level, So I modified arch/arm/mach-omap2/irq.c
>>
>> Signed-off-by: Kim Kyuwon <chammoru@gmail.com>
>>
>> diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
>> index 110acb9..b44dcae 100644
>> --- a/arch/arm/mach-omap2/irq.c
>> +++ b/arch/arm/mach-omap2/irq.c
>> @@ -123,6 +123,11 @@ static void omap_unmask_irq(unsigned int irq)
>> intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_CLEAR0 + offset);
>> }
>>
>> +static void omap_disable_irq(unsigned int irq)
>> +{
>> + omap_mask_irq(irq);
>> +}
>> +
>> static void omap_mask_ack_irq(unsigned int irq)
>> {
>> omap_mask_irq(irq);
>> @@ -134,6 +139,7 @@ static struct irq_chip omap_irq_chip = {
>> .ack = omap_mask_ack_irq,
>> .mask = omap_mask_irq,
>> .unmask = omap_unmask_irq,
>> + .disable = omap_disable_irq,
>> };
>>
>> static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
>> --
>> 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
>
Regards,
--
Kim Kyuwon
--
Kim Kyuwon
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Questions about masking interrupts when disabling interrupts
2009-01-08 1:27 ` Kim Kyuwon
2009-01-08 3:57 ` Fwd: " Kim Kyuwon
@ 2009-01-09 12:04 ` Tony Lindgren
1 sibling, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2009-01-09 12:04 UTC (permalink / raw)
To: Kim Kyuwon; +Cc: linux-omap, 박경민, 허성관
* Kim Kyuwon <chammoru@gmail.com> [090108 03:27]:
> Thanks Tony very much for your reply!
>
> On Wed, Jan 7, 2009 at 10:05 PM, Tony Lindgren <tony@atomide.com> wrote:
> > * 김규원 <chammoru@gmail.com> [090106 04:59]:
> >> Greetings,
> >>
> >> I'm enabling the Suspend-to-RAM state in our new OMAP3 Board.
> >> But I had some problems because of USB Interrupt.
> >>
> >> Although I disabled USB interrupt by disable_irq() function while
> >> entering the Suspend,
> >> M_IRQ_92 irq continuously wake up the OMAP3430 Processor.
> >>
> >> So, I fixed this problem as following patch.
> >>
> >> My Questions are:
> >> 1. Could anyone suggest the better solution for this problem?
> >
> > Maybe suspend the USΒ too? :)
>
> I confirmed musb_suspend() function was invoked while entering Suspend-to-RAM
> state. musb_suspend() didn't disable USB interrupt, but only USB clock. Devices
> should be suspended with interrupts disabled
> (/Documenttation/power/devices.txt - 412line)
>
> So I modified musb_suspend() to disable USB interrupt
> (I'm planning to send this patch very soon)
> I even wrote 0 to PM_WKEN_USBHOST[EN_USBHOST] bit. But our OMAP3430 board
> still have woken up by USB interrupt, because disable_irq() didn't mask the
> interrupt.
OK
>
> >
> >> 2. If there is no better solution, can I be applied this patch to omap-tree?
> >
> > The patch looks OK to me, assuming the default enable calls unmask?
> >
>
> Right, default_enable() function(kernel/irq/chip.c 222line) calls unmask
OK, pushing to l-o tree and adding to omap-fixes queue for mainline
kernel.
Tony
>
> > Regards,
> >
> > Tony
> >
> >>
> >> Thank you!
> >>
> >> commit bbb49321b161e6a9ff2b73326d4012d8eb8bbf23
> >> Author: Kim Kyuwon <chammoru@gmail.com>
> >> Date: Tue Jan 6 10:11:46 2009 +0900
> >>
> >> ARM: OMAP3: Mask interrupts when disabling interrupts
> >>
> >> By Ingo Molnar, interrupts are not masked by default.
> >> (refer to 76d2160147f43f982dfe881404cfde9fd0a9da21)
> >>
> >> But if interrupts are not masked, the processor can wake up while in
> >> Suspend-to-RAM state by an external interrupt. For example, if an
> >> OMAP3 board
> >> is connected to Host PC by USB and entered to Suspend-to-RAM
> >> state, it wake up
> >> automatically by M_IRQ_92. The disable_irq() function can't disable the
> >> interrupt in H/W level, So I modified arch/arm/mach-omap2/irq.c
> >>
> >> Signed-off-by: Kim Kyuwon <chammoru@gmail.com>
> >>
> >> diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
> >> index 110acb9..b44dcae 100644
> >> --- a/arch/arm/mach-omap2/irq.c
> >> +++ b/arch/arm/mach-omap2/irq.c
> >> @@ -123,6 +123,11 @@ static void omap_unmask_irq(unsigned int irq)
> >> intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_CLEAR0 + offset);
> >> }
> >>
> >> +static void omap_disable_irq(unsigned int irq)
> >> +{
> >> + omap_mask_irq(irq);
> >> +}
> >> +
> >> static void omap_mask_ack_irq(unsigned int irq)
> >> {
> >> omap_mask_irq(irq);
> >> @@ -134,6 +139,7 @@ static struct irq_chip omap_irq_chip = {
> >> .ack = omap_mask_ack_irq,
> >> .mask = omap_mask_irq,
> >> .unmask = omap_unmask_irq,
> >> + .disable = omap_disable_irq,
> >> };
> >>
> >> static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
> >> --
> >> 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
> >
>
> Regards,
> --
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-01-09 12:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-06 2:59 Questions about masking interrupts when disabling interrupts 김규원
2009-01-07 13:05 ` Tony Lindgren
2009-01-08 1:27 ` Kim Kyuwon
2009-01-08 3:57 ` Fwd: " Kim Kyuwon
2009-01-09 12:04 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox