* Re: [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake()
2011-06-09 6:20 [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() fix Magnus Damm
@ 2011-06-10 2:20 ` Simon Horman
2011-06-10 5:03 ` [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() fix Magnus Damm
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2011-06-10 2:20 UTC (permalink / raw)
To: linux-sh
On Thu, Jun 09, 2011 at 03:20:03PM +0900, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
>
> Initialize ->irq_set_wake() in gic_arch_extn to unbreak wake
> up from the KEYSC device on AG5EVM in case of Suspend-to-RAM.
>
> Without this patch "echo mem > /sys/power/state" and a key
> press results in the following message on resume:
>
> WARNING: at kernel/irq/manage.c:507 irq_set_irq_wake+0x7c/0xd8()
> Unbalanced IRQ 103 wake disable
>
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
>
> arch/arm/mach-shmobile/intc-sh73a0.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> --- 0001/arch/arm/mach-shmobile/intc-sh73a0.c
> +++ work/arch/arm/mach-shmobile/intc-sh73a0.c 2011-06-08 18:42:14.000000000 +0900
> @@ -250,6 +250,11 @@ static irqreturn_t sh73a0_intcs_demux(in
> return IRQ_HANDLED;
> }
>
> +static int sh73a0_set_wake(struct irq_data *data, unsigned int on)
> +{
> + return 0; /* always allow wakeup */
> +}
> +
I wonder if a more generic location and name for this would be worthwhile.
It seems to me that that other hardware may also want to do this.
> void __init sh73a0_init_irq(void)
> {
> void __iomem *gic_dist_base = __io(0xf0001000);
> @@ -257,6 +262,7 @@ void __init sh73a0_init_irq(void)
> void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE);
>
> gic_init(0, 29, gic_dist_base, gic_cpu_base);
> + gic_arch_extn.irq_set_wake = sh73a0_set_wake;
>
> register_intc_controller(&intcs_desc);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" 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: [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() fix
2011-06-09 6:20 [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() fix Magnus Damm
2011-06-10 2:20 ` [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() Simon Horman
@ 2011-06-10 5:03 ` Magnus Damm
2011-06-10 6:00 ` [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() Simon Horman
2011-06-14 6:32 ` [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() fix Paul Mundt
3 siblings, 0 replies; 5+ messages in thread
From: Magnus Damm @ 2011-06-10 5:03 UTC (permalink / raw)
To: linux-sh
On Fri, Jun 10, 2011 at 11:20 AM, Simon Horman <horms@verge.net.au> wrote:
> On Thu, Jun 09, 2011 at 03:20:03PM +0900, Magnus Damm wrote:
>> From: Magnus Damm <damm@opensource.se>
>>
>> Initialize ->irq_set_wake() in gic_arch_extn to unbreak wake
>> up from the KEYSC device on AG5EVM in case of Suspend-to-RAM.
>>
>> Without this patch "echo mem > /sys/power/state" and a key
>> press results in the following message on resume:
>>
>> WARNING: at kernel/irq/manage.c:507 irq_set_irq_wake+0x7c/0xd8()
>> Unbalanced IRQ 103 wake disable
>>
>> Signed-off-by: Magnus Damm <damm@opensource.se>
>> ---
>>
>> arch/arm/mach-shmobile/intc-sh73a0.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> --- 0001/arch/arm/mach-shmobile/intc-sh73a0.c
>> +++ work/arch/arm/mach-shmobile/intc-sh73a0.c 2011-06-08 18:42:14.000000000 +0900
>> @@ -250,6 +250,11 @@ static irqreturn_t sh73a0_intcs_demux(in
>> return IRQ_HANDLED;
>> }
>>
>> +static int sh73a0_set_wake(struct irq_data *data, unsigned int on)
>> +{
>> + return 0; /* always allow wakeup */
>> +}
>> +
>
> I wonder if a more generic location and name for this would be worthwhile.
> It seems to me that that other hardware may also want to do this.
Not so sure about that. It all depends on what other hardware
platforms need to do in their sleep code. Do you have any particular
hardware platform in mind?
Without this callback in place set_irq_wake_real() will return -ENXIO.
Which is fine if you don't support Suspend-to-RAM with IRQ wake up. On
sh73a0 we do support Suspend-to-RAM in linux-3.0-rc and without this
patch we trigger a warning. So to properly support sh73a0 in 3.0-rc we
need some kind of fix.
For now we don't implement deep enough sleep modes to require any
special code in sh73a0_set_wake(). In the future we want to add more
advanced sleep modes, which will require us to extend the
sh73a0_set_wake() function.
Other SH and SH-Mobile ARM SoCs use INTC as interrupt controller
instead of GIC. This kind of fix is not needed for those SoCs.
/ magnus
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake()
2011-06-09 6:20 [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() fix Magnus Damm
2011-06-10 2:20 ` [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() Simon Horman
2011-06-10 5:03 ` [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() fix Magnus Damm
@ 2011-06-10 6:00 ` Simon Horman
2011-06-14 6:32 ` [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() fix Paul Mundt
3 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2011-06-10 6:00 UTC (permalink / raw)
To: linux-sh
On Fri, Jun 10, 2011 at 02:03:43PM +0900, Magnus Damm wrote:
> On Fri, Jun 10, 2011 at 11:20 AM, Simon Horman <horms@verge.net.au> wrote:
> > On Thu, Jun 09, 2011 at 03:20:03PM +0900, Magnus Damm wrote:
> >> From: Magnus Damm <damm@opensource.se>
> >>
> >> Initialize ->irq_set_wake() in gic_arch_extn to unbreak wake
> >> up from the KEYSC device on AG5EVM in case of Suspend-to-RAM.
> >>
> >> Without this patch "echo mem > /sys/power/state" and a key
> >> press results in the following message on resume:
> >>
> >> WARNING: at kernel/irq/manage.c:507 irq_set_irq_wake+0x7c/0xd8()
> >> Unbalanced IRQ 103 wake disable
> >>
> >> Signed-off-by: Magnus Damm <damm@opensource.se>
> >> ---
> >>
> >> arch/arm/mach-shmobile/intc-sh73a0.c | 6 ++++++
> >> 1 file changed, 6 insertions(+)
> >>
> >> --- 0001/arch/arm/mach-shmobile/intc-sh73a0.c
> >> +++ work/arch/arm/mach-shmobile/intc-sh73a0.c 2011-06-08 18:42:14.000000000 +0900
> >> @@ -250,6 +250,11 @@ static irqreturn_t sh73a0_intcs_demux(in
> >> return IRQ_HANDLED;
> >> }
> >>
> >> +static int sh73a0_set_wake(struct irq_data *data, unsigned int on)
> >> +{
> >> + return 0; /* always allow wakeup */
> >> +}
> >> +
> >
> > I wonder if a more generic location and name for this would be worthwhile.
> > It seems to me that that other hardware may also want to do this.
>
> Not so sure about that. It all depends on what other hardware
> platforms need to do in their sleep code. Do you have any particular
> hardware platform in mind?
No, I don't have any other hardware in mind.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() fix
2011-06-09 6:20 [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() fix Magnus Damm
` (2 preceding siblings ...)
2011-06-10 6:00 ` [PATCH] ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() Simon Horman
@ 2011-06-14 6:32 ` Paul Mundt
3 siblings, 0 replies; 5+ messages in thread
From: Paul Mundt @ 2011-06-14 6:32 UTC (permalink / raw)
To: linux-sh
On Thu, Jun 09, 2011 at 03:20:03PM +0900, Magnus Damm wrote:
> Initialize ->irq_set_wake() in gic_arch_extn to unbreak wake
> up from the KEYSC device on AG5EVM in case of Suspend-to-RAM.
>
> Without this patch "echo mem > /sys/power/state" and a key
> press results in the following message on resume:
>
> WARNING: at kernel/irq/manage.c:507 irq_set_irq_wake+0x7c/0xd8()
> Unbalanced IRQ 103 wake disable
On Thu, Jun 09, 2011 at 03:35:08PM +0900, Magnus Damm wrote:
> Fix the recently added SH_DMAC_MAX_CHANNELS handling code in
> 300e5f9 dmaengine: shdma: Fix SH_DMAC_MAX_CHANNELS handling
>
> Without this fix the shdma driver outputs silly messages in
> case SH_DMAC_MAX_CHANNELS happens to match the platform data:
>
> sh-dma-engine sh-dma-engine.0: Attempting to register 20 DMA channels when a max
> imum of 20 are supported.
On Thu, Jun 09, 2011 at 06:02:25PM +0900, Magnus Damm wrote:
> Add a flag for SDHI1 to enable SDIO IRQ, and remove DMA Engine
> slave id:s to disable DMA as a workaround.
>
> Tested on sh73a0/AG5EVM with a BCM4318-based SDIO card.
On Mon, Jun 13, 2011 at 01:42:15PM +0900, Magnus Damm wrote:
> Extend the SH / SH-Mobile ARM clock framework to only
> resume clocks that has been enabled.
>
> Without this fix divide-by-zero is triggering on sh7372
> FSIDIV during system wide resume of Suspend-to-RAM.
All applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread