diff mbox

[v2,3/4] ARM: mvebu: Allow using the GIC for wakeup in standby mode

Message ID 1435684740-24912-4-git-send-email-gregory.clement@free-electrons.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Gregory CLEMENT June 30, 2015, 5:18 p.m. UTC
On the Armada 375/38x/39x SoCs, in standby mode the SoCs stay powered
and it is possible to wake-up from any interrupt sources. This patch
adds flag to the GIC irqchip driver to let linux know this.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 arch/arm/mach-mvebu/board-v7.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Thomas Petazzoni July 1, 2015, 3:54 p.m. UTC | #1
Dear Gregory CLEMENT,

On Tue, 30 Jun 2015 19:18:59 +0200, Gregory CLEMENT wrote:

>  static void __init mvebu_init_irq(void)
>  {
> +	if (of_machine_is_compatible("marvell,armada375") ||
> +	    of_machine_is_compatible("marvell,armada380") ||
> +	    of_machine_is_compatible("marvell,armada390"))

What we really want to know is if we're using the GIC, so what about
instead:

	np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic");
	if (np)
		gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE |
				      IRQCHIP_MASK_ON_SUSPEND);
	of_node_put(np);

(Not even compile-tested).

Thanks,

Thomas
Sudeep Holla July 1, 2015, 4:05 p.m. UTC | #2
On 30/06/15 18:18, Gregory CLEMENT wrote:
> On the Armada 375/38x/39x SoCs, in standby mode the SoCs stay powered
> and it is possible to wake-up from any interrupt sources. This patch
> adds flag to the GIC irqchip driver to let linux know this.
>
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> ---
>   arch/arm/mach-mvebu/board-v7.c | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
> index e5911defccac..f446230e7416 100644
> --- a/arch/arm/mach-mvebu/board-v7.c
> +++ b/arch/arm/mach-mvebu/board-v7.c
> @@ -18,6 +18,7 @@
>   #include <linux/of_address.h>
>   #include <linux/of_fdt.h>
>   #include <linux/of_platform.h>
> +#include <linux/irq.h>
>   #include <linux/io.h>
>   #include <linux/clocksource.h>
>   #include <linux/dma-mapping.h>
> @@ -26,6 +27,7 @@
>   #include <linux/signal.h>
>   #include <linux/slab.h>
>   #include <linux/irqchip.h>
> +#include <linux/irqchip/arm-gic.h>
>   #include <asm/hardware/cache-l2x0.h>
>   #include <asm/mach/arch.h>
>   #include <asm/mach/map.h>
> @@ -129,6 +131,11 @@ static int armada_375_external_abort_wa(unsigned long addr, unsigned int fsr,
>
>   static void __init mvebu_init_irq(void)
>   {
> +	if (of_machine_is_compatible("marvell,armada375") ||
> +	    of_machine_is_compatible("marvell,armada380") ||
> +	    of_machine_is_compatible("marvell,armada390"))
> +		gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE |
> +				      IRQCHIP_MASK_ON_SUSPEND);

I am planning to add these flags in the GIC driver itself and remove
this function. I will post the patch next week once merge window closes
next, so based on how that discussion proceeds you may have drop this
patch, just heads up.

Regards,
Sudeep
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven July 1, 2015, 4:56 p.m. UTC | #3
On Wed, Jul 1, 2015 at 6:05 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
> On 30/06/15 18:18, Gregory CLEMENT wrote:
>> On the Armada 375/38x/39x SoCs, in standby mode the SoCs stay powered
>> and it is possible to wake-up from any interrupt sources. This patch
>> adds flag to the GIC irqchip driver to let linux know this.
>>
>> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
>> ---
>>   arch/arm/mach-mvebu/board-v7.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/arch/arm/mach-mvebu/board-v7.c
>> b/arch/arm/mach-mvebu/board-v7.c
>> index e5911defccac..f446230e7416 100644
>> --- a/arch/arm/mach-mvebu/board-v7.c
>> +++ b/arch/arm/mach-mvebu/board-v7.c

>> @@ -129,6 +131,11 @@ static int armada_375_external_abort_wa(unsigned long
>> addr, unsigned int fsr,
>>
>>   static void __init mvebu_init_irq(void)
>>   {
>> +       if (of_machine_is_compatible("marvell,armada375") ||
>> +           of_machine_is_compatible("marvell,armada380") ||
>> +           of_machine_is_compatible("marvell,armada390"))
>> +               gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE |
>> +                                     IRQCHIP_MASK_ON_SUSPEND);
>
>
> I am planning to add these flags in the GIC driver itself and remove
> this function. I will post the patch next week once merge window closes
> next, so based on how that discussion proceeds you may have drop this
> patch, just heads up.

Tried that before...

http://lists.infradead.org/pipermail/linux-arm-kernel/2015-March/331813.html

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Gregory CLEMENT July 3, 2015, 7:18 a.m. UTC | #4
Hi Thomas,

On 01/07/2015 17:54, Thomas Petazzoni wrote:
> Dear Gregory CLEMENT,
> 
> On Tue, 30 Jun 2015 19:18:59 +0200, Gregory CLEMENT wrote:
> 
>>  static void __init mvebu_init_irq(void)
>>  {
>> +	if (of_machine_is_compatible("marvell,armada375") ||
>> +	    of_machine_is_compatible("marvell,armada380") ||
>> +	    of_machine_is_compatible("marvell,armada390"))
> 
> What we really want to know is if we're using the GIC, so what about
> instead:
> 
> 	np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic");
> 	if (np)
> 		gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE |
> 				      IRQCHIP_MASK_ON_SUSPEND);
> 	of_node_put(np);
> 
> (Not even compile-tested).

Indeed it is better. I will make the change.

Thanks,

Gregory


> 
> Thanks,
> 
> Thomas
>
Sudeep Holla July 27, 2015, 11:02 a.m. UTC | #5
Hi Thomas/Gregory,

On 01/07/15 16:54, Thomas Petazzoni wrote:
> Dear Gregory CLEMENT,
>
> On Tue, 30 Jun 2015 19:18:59 +0200, Gregory CLEMENT wrote:
>
>>   static void __init mvebu_init_irq(void)
>>   {
>> +	if (of_machine_is_compatible("marvell,armada375") ||
>> +	    of_machine_is_compatible("marvell,armada380") ||
>> +	    of_machine_is_compatible("marvell,armada390"))
>
> What we really want to know is if we're using the GIC, so what about
> instead:
>
> 	np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic");
> 	if (np)
> 		gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE |
> 				      IRQCHIP_MASK_ON_SUSPEND);

As I had mentioned before, this function was planned to be removed. tglx
has now pulled in the patch into tip/core[1]. If this patch is already
pulled in, it's better to revert so that it won't break the build in
linux-next. Since the flags are now moved to GIC driver, this patch is
no longer required. Sorry for the trouble.

Regards,
Sudeep

[1] 
https://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/commit/?h=irq/core&id=0d3f2c92e004c67404fabea19728c1962b777bd6
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Gregory CLEMENT July 28, 2015, 9:42 a.m. UTC | #6
Hi Sudeep,

On 27/07/2015 13:02, Sudeep Holla wrote:
> Hi Thomas/Gregory,
> 
> On 01/07/15 16:54, Thomas Petazzoni wrote:
>> Dear Gregory CLEMENT,
>>
>> On Tue, 30 Jun 2015 19:18:59 +0200, Gregory CLEMENT wrote:
>>
>>>   static void __init mvebu_init_irq(void)
>>>   {
>>> +	if (of_machine_is_compatible("marvell,armada375") ||
>>> +	    of_machine_is_compatible("marvell,armada380") ||
>>> +	    of_machine_is_compatible("marvell,armada390"))
>>
>> What we really want to know is if we're using the GIC, so what about
>> instead:
>>
>> 	np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic");
>> 	if (np)
>> 		gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE |
>> 				      IRQCHIP_MASK_ON_SUSPEND);
> 
> As I had mentioned before, this function was planned to be removed. tglx
> has now pulled in the patch into tip/core[1]. If this patch is already
> pulled in, it's better to revert so that it won't break the build in
> linux-next. Since the flags are now moved to GIC driver, this patch is
> no longer required. Sorry for the trouble.

Your patch has been merged in th irq branch just a few day after I merged this one.
But fortunately I can remove the commit from my branch without any trouble.

It is done now.


Thanks,

Gregory



> 
> Regards,
> Sudeep
> 
> [1] 
> https://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/commit/?h=irq/core&id=0d3f2c92e004c67404fabea19728c1962b777bd6
>
diff mbox

Patch

diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
index e5911defccac..f446230e7416 100644
--- a/arch/arm/mach-mvebu/board-v7.c
+++ b/arch/arm/mach-mvebu/board-v7.c
@@ -18,6 +18,7 @@ 
 #include <linux/of_address.h>
 #include <linux/of_fdt.h>
 #include <linux/of_platform.h>
+#include <linux/irq.h>
 #include <linux/io.h>
 #include <linux/clocksource.h>
 #include <linux/dma-mapping.h>
@@ -26,6 +27,7 @@ 
 #include <linux/signal.h>
 #include <linux/slab.h>
 #include <linux/irqchip.h>
+#include <linux/irqchip/arm-gic.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -129,6 +131,11 @@  static int armada_375_external_abort_wa(unsigned long addr, unsigned int fsr,
 
 static void __init mvebu_init_irq(void)
 {
+	if (of_machine_is_compatible("marvell,armada375") ||
+	    of_machine_is_compatible("marvell,armada380") ||
+	    of_machine_is_compatible("marvell,armada390"))
+		gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE |
+				      IRQCHIP_MASK_ON_SUSPEND);
 	irqchip_init();
 	mvebu_scu_enable();
 	coherency_init();