Skip to contentSkip to conversation

resume regression in 2.6.37

PATCH In review Sven Neumann 6 participants 21 messages Jan 13, 2011 – Jan 20, 2011

Subsystems (3)
lore
Share & tools
lore

Sven Neumann

author Reviewed-by H. Peter Anvin Reviewed-by Ingo Molnar
#0 lore raw

Hi,

we are using devices based on an PXA300 and are successfully using the 2.6.36.2 kernel (vanilla, basically unpatched). You can find the platform-specific code that describes our devices
in /arch/arm/mach-pxa/raumfeld.c.

Now I've tried to update the kernel to 2.6.37. After fixing the already reported NULL pointer dereference on bootup in pxa3xx_nand_probe(), the device seems to work fine until I suspend it and then try to wake it up from suspend. Suspend seems to work fine, no warnings whatsoever. However there is absolutely no sign of resume.

I've used git bisect to track this down to the following commit:

commit 2f7e99bb9be6a2d8d7b808dc86037710cc8b7bf1

Author: Thomas Gleixner <[email protected]>
Date:   Mon Sep 27 12:45:50 2010 +0000

genirq: Provide compat handling for chip->set_wake()

Wrap the old chip function set_wake() until the migration is complete and the old chip functions are removed.

LKML-Reference: <[email protected]>

Any idea on how to proceed from here? I don't think I can just revert this commit and expect things to work, right?

Regards,
Sven

Signature · 5 lines
Sven Neumann
Head of RAUMFELD Software Development

Lautsprecher Teufel GmbH | B?lowstr. 66 | 10783 Berlin | Germany
Tel: +49 (0)30-300 930 153 | s.neumann at raumfeld.com
#1 lore raw
Quoted 20 lines · Sven Neumann

Now I've tried to update the kernel to 2.6.37. After fixing the already reported NULL pointer dereference on bootup in pxa3xx_nand_probe(), the device seems to work fine until I suspend it and then try to wake it up from suspend. Suspend seems to work fine, no warnings whatsoever. However there is absolutely no sign of resume.

I've used git bisect to track this down to the following commit:

commit 2f7e99bb9be6a2d8d7b808dc86037710cc8b7bf1

Author: Thomas Gleixner <[email protected]>
Date:   Mon Sep 27 12:45:50 2010 +0000

genirq: Provide compat handling for chip->set_wake()

Wrap the old chip function set_wake() until the migration is complete and the old chip functions are removed.

Quoted 7 lines

LKML-Reference: <[email protected]>

Any idea on how to proceed from here? I don't think I can just revert this commit and expect things to work, right?

Well, I somehow doubt, that this is the real culprit. The patch does not change anything of the set_wake() functionality. It's a functional equivivalent wrapper, nothing else.

Can you revert it on top of 2.6.37 and verify that it helps ?

Thanks,

tglx

#2 lore raw
Quoted 26 lines · Thomas Gleixner
Quoted 25 lines · Sven Neumann

Now I've tried to update the kernel to 2.6.37. After fixing the already reported NULL pointer dereference on bootup in pxa3xx_nand_probe(), the device seems to work fine until I suspend it and then try to wake it up from suspend. Suspend seems to work fine, no warnings whatsoever. However there is absolutely no sign of resume.

I've used git bisect to track this down to the following commit:

commit 2f7e99bb9be6a2d8d7b808dc86037710cc8b7bf1

Author: Thomas Gleixner <[email protected]>
Date:   Mon Sep 27 12:45:50 2010 +0000

genirq: Provide compat handling for chip->set_wake()

Wrap the old chip function set_wake() until the migration is complete and the old chip functions are removed.

LKML-Reference: <[email protected]>

Quoted 8 lines
Quoted 2 lines

Any idea on how to proceed from here? I don't think I can just revert this commit and expect things to work, right?

Well, I somehow doubt, that this is the real culprit. The patch does not change anything of the set_wake() functionality. It's a functional equivivalent wrapper, nothing else.

Can you revert it on top of 2.6.37 and verify that it helps ?

I've done that now and while it doesn't solve the problem completely, I can definitely say that reverting the change does make a difference.

Without the revert there is absolutely no sign of resume. With the change reverted I can see that the PXA powers up again, there's an LED showing that the USB controller has power again. Unfortunately there's seems to be another problem and the resume doesn't complete. I've tried to get console output by using no_console_suspend, but there's just gibberish on the console after resume :(

Any idea on how to proceed from here? I could perhaps ask our hardware engineer to try find out where exactly we are stuck in the resume. But I'd like to avoid that if possible.

Thanks,
Sven

#3 lore raw
Quoted 5 lines · Sven Neumann
Quoted 4 lines · Thomas Gleixner
Quoted 2 lines · Sven Neumann

Any idea on how to proceed from here? I don't think I can just revert this commit and expect things to work, right?

Quoted 8 lines
Quoted 5 lines

Well, I somehow doubt, that this is the real culprit. The patch does not change anything of the set_wake() functionality. It's a functional equivivalent wrapper, nothing else.

Can you revert it on top of 2.6.37 and verify that it helps ?

I've done that now and while it doesn't solve the problem completely, I can definitely say that reverting the change does make a difference.

Hmm. I have to admit that this confuses the hell out of me.

Quoted 10 lines

Without the revert there is absolutely no sign of resume. With the change reverted I can see that the PXA powers up again, there's an LED showing that the USB controller has power again. Unfortunately there's seems to be another problem and the resume doesn't complete. I've tried to get console output by using no_console_suspend, but there's just gibberish on the console after resume :(

Any idea on how to proceed from here? I could perhaps ask our hardware engineer to try find out where exactly we are stuck in the resume. But I'd like to avoid that if possible.

Can you stick a printk into the set_wake() function of that irq chip and print the irq and on arguments and the return value . Run that with both stock 2.6.37 and the patch reverted.

Thanks,

tglx

#4 lore raw
Quoted 7 lines · Thomas Gleixner
Quoted 7 lines

Without the revert there is absolutely no sign of resume. With the change reverted I can see that the PXA powers up again, there's an LED showing that the USB controller has power again. Unfortunately there's seems to be another problem and the resume doesn't complete. I've tried to get console output by using no_console_suspend, but there's just gibberish on the console after resume :(

Quoted 7 lines
Quoted 3 lines

Any idea on how to proceed from here? I could perhaps ask our hardware engineer to try find out where exactly we are stuck in the resume. But I'd like to avoid that if possible.

Can you stick a printk into the set_wake() function of that irq chip and print the irq and on arguments and the return value . Run that with both stock 2.6.37 and the patch reverted.

pxa3xx_set_wake(31, 1) returns 0

Same result with stock 2.6.37 and the patch reverted. Except that without the patch reverted, the device doesn't power up again.

Sven

#5 lore raw
Quoted 13 lines · Sven Neumann
Quoted 11 lines · Thomas Gleixner
Quoted 10 lines

Without the revert there is absolutely no sign of resume. With the change reverted I can see that the PXA powers up again, there's an LED showing that the USB controller has power again. Unfortunately there's seems to be another problem and the resume doesn't complete. I've tried to get console output by using no_console_suspend, but there's just gibberish on the console after resume :(

Any idea on how to proceed from here? I could perhaps ask our hardware engineer to try find out where exactly we are stuck in the resume. But I'd like to avoid that if possible.

Quoted 8 lines
Quoted 3 lines

Can you stick a printk into the set_wake() function of that irq chip and print the irq and on arguments and the return value . Run that with both stock 2.6.37 and the patch reverted.

pxa3xx_set_wake(31, 1) returns 0

Same result with stock 2.6.37 and the patch reverted. Except that without the patch reverted, the device doesn't power up again.

Ok, can we agree that the patch has no functional impact on the set_wake function? And I don't see a reason why reverting that patch results in a working resume. That does not make sense at all. Which compiler version are you using ?

Thanks,

tglx

#6 lore raw
Quoted 21 lines · Thomas Gleixner
Quoted 19 lines · Sven Neumann
Quoted 7 lines · Thomas Gleixner
Quoted 7 lines

Without the revert there is absolutely no sign of resume. With the change reverted I can see that the PXA powers up again, there's an LED showing that the USB controller has power again. Unfortunately there's seems to be another problem and the resume doesn't complete. I've tried to get console output by using no_console_suspend, but there's just gibberish on the console after resume :(

Quoted 7 lines
Quoted 3 lines

Any idea on how to proceed from here? I could perhaps ask our hardware engineer to try find out where exactly we are stuck in the resume. But I'd like to avoid that if possible.

Can you stick a printk into the set_wake() function of that irq chip and print the irq and on arguments and the return value . Run that with both stock 2.6.37 and the patch reverted.

pxa3xx_set_wake(31, 1) returns 0

Quoted 7 lines
Quoted 2 lines

Same result with stock 2.6.37 and the patch reverted. Except that without the patch reverted, the device doesn't power up again.

Ok, can we agree that the patch has no functional impact on the set_wake function? And I don't see a reason why reverting that patch results in a working resume. That does not make sense at all. Which compiler version are you using ?

I agree that this is all very weird and as far as I understand the patch it should have no functional impact. Unfortunately reverting the patch does not result in a working resume, but at least it makes a difference and at the moment it's the only trace I have.

My cross-compile tool-chain uses GCC 4.3.5.

Sven

#7 lore raw
Quoted 30 lines · Sven Neumann
Quoted 21 lines · Thomas Gleixner
Quoted 19 lines · Sven Neumann
Quoted 7 lines · Thomas Gleixner
Quoted 7 lines

Without the revert there is absolutely no sign of resume. With the change reverted I can see that the PXA powers up again, there's an LED showing that the USB controller has power again. Unfortunately there's seems to be another problem and the resume doesn't complete. I've tried to get console output by using no_console_suspend, but there's just gibberish on the console after resume :(

Quoted 7 lines
Quoted 3 lines

Any idea on how to proceed from here? I could perhaps ask our hardware engineer to try find out where exactly we are stuck in the resume. But I'd like to avoid that if possible.

Can you stick a printk into the set_wake() function of that irq chip and print the irq and on arguments and the return value . Run that with both stock 2.6.37 and the patch reverted.

pxa3xx_set_wake(31, 1) returns 0

Quoted 7 lines
Quoted 2 lines

Same result with stock 2.6.37 and the patch reverted. Except that without the patch reverted, the device doesn't power up again.

Ok, can we agree that the patch has no functional impact on the set_wake function? And I don't see a reason why reverting that patch results in a working resume. That does not make sense at all. Which compiler version are you using ?

Quoted 6 lines

I agree that this is all very weird and as far as I understand the patch it should have no functional impact. Unfortunately reverting the patch does not result in a working resume, but at least it makes a difference and at the moment it's the only trace I have.

My cross-compile tool-chain uses GCC 4.3.5.

Can you try a different compiler ?

Thanks,

tglx

#8 lore raw
In reply to Thomas Gleixner

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 24 lines · Thomas Gleixner
Quoted 13 lines · Sven Neumann
Quoted 11 lines · Thomas Gleixner
Quoted 10 lines

Without the revert there is absolutely no sign of resume. With the change reverted I can see that the PXA powers up again, there's an LED showing that the USB controller has power again. Unfortunately there's seems to be another problem and the resume doesn't complete. I've tried to get console output by using no_console_suspend, but there's just gibberish on the console after resume :(

Any idea on how to proceed from here? I could perhaps ask our hardware engineer to try find out where exactly we are stuck in the resume. But I'd like to avoid that if possible.

Quoted 8 lines
Quoted 3 lines

Can you stick a printk into the set_wake() function of that irq chip and print the irq and on arguments and the return value . Run that with both stock 2.6.37 and the patch reverted.

pxa3xx_set_wake(31, 1) returns 0

Same result with stock 2.6.37 and the patch reverted. Except that without the patch reverted, the device doesn't power up again.

Quoted 9 lines

Ok, can we agree that the patch has no functional impact on the set_wake function? And I don't see a reason why reverting that patch results in a working resume. That does not make sense at all. Which compiler version are you using ?

Thanks,

tglx

Hi

If you take a look at the pxa gpio irq handling you'll see that it sets the "set_wake" field of it's irq_chip after calling set_irq_chip for all of the irqs, so the compat handler gets never installed.

So I guess the following patch fixes it:

arch/arm/mach-pxa/irq.c +0 -0

- --- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -111,13 +111,13 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
GRER0 &= ~0x3;
GEDR0 = 0x3;

+ pxa_low_gpio_chip.set_wake = fn;
+
for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
set_irq_chip(irq, &pxa_low_gpio_chip); set_irq_handler(irq, handle_edge_irq); set_irq_flags(irq, IRQF_VALID);
}
- -
- - pxa_low_gpio_chip.set_wake = fn;
}

void __init pxa_init_irq(int irq_nr, set_wake_t fn)
@@ -142,13 +142,14 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
/* only unmasked interrupts kick us out of idle */ ICCR = 1;

+ pxa_internal_irq_chip.set_wake = fn;
+
for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq++) {
set_irq_chip(irq, &pxa_internal_irq_chip); set_irq_handler(irq, handle_level_irq); set_irq_flags(irq, IRQF_VALID);
}

- - pxa_internal_irq_chip.set_wake = fn;
pxa_init_low_gpio_irq(fn);
}

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk00l4cACgkQBX4mSR26RiMTMQCdGCiu3ALAIEe0dUkX3u5xeHmz dggAnj2cePanr6HFi+6KQ4tF7cT6xoq0
=yxJs
-----END PGP SIGNATURE-----

#9 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 68 lines · Lars-Peter Clausen
Quoted 24 lines · Thomas Gleixner
Quoted 13 lines · Sven Neumann
Quoted 11 lines · Thomas Gleixner
Quoted 10 lines

Without the revert there is absolutely no sign of resume. With the change reverted I can see that the PXA powers up again, there's an LED showing that the USB controller has power again. Unfortunately there's seems to be another problem and the resume doesn't complete. I've tried to get console output by using no_console_suspend, but there's just gibberish on the console after resume :(

Any idea on how to proceed from here? I could perhaps ask our hardware engineer to try find out where exactly we are stuck in the resume. But I'd like to avoid that if possible.

Quoted 8 lines
Quoted 3 lines

Can you stick a printk into the set_wake() function of that irq chip and print the irq and on arguments and the return value . Run that with both stock 2.6.37 and the patch reverted.

pxa3xx_set_wake(31, 1) returns 0

Same result with stock 2.6.37 and the patch reverted. Except that without the patch reverted, the device doesn't power up again.

Quoted 8 lines

Ok, can we agree that the patch has no functional impact on the set_wake function? And I don't see a reason why reverting that patch results in a working resume. That does not make sense at all. Which compiler version are you using ?

Thanks,

tglx

Hi

If you take a look at the pxa gpio irq handling you'll see that it sets the "set_wake" field of it's irq_chip after calling set_irq_chip for all of the irqs, so the compat handler gets never installed.

So I guess the following patch fixes it:

arch/arm/mach-pxa/irq.c +4 -2
@@ -111,13 +111,13 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
 	GRER0 &= ~0x3;
 	GEDR0 = 0x3;
 
+	pxa_low_gpio_chip.set_wake = fn;
+
 	for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
 		set_irq_chip(irq, &pxa_low_gpio_chip);
 		set_irq_handler(irq, handle_edge_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
-
-	pxa_low_gpio_chip.set_wake = fn;
 }
 
 void __init pxa_init_irq(int irq_nr, set_wake_t fn)
@@ -142,13 +142,14 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 	/* only unmasked interrupts kick us out of idle */
 	ICCR = 1;
 
+	pxa_internal_irq_chip.set_wake = fn;
+

arch/arm/mach-pxa/irq.c void __init pxa_init_irq(int irq_nr, set_wake_t fn) · line 155

Quoted 10 lines
arch/arm/mach-pxa/irq.c +0 -1
 	for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq++) {
 		set_irq_chip(irq, &pxa_internal_irq_chip);
 		set_irq_handler(irq, handle_level_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
 
-	pxa_internal_irq_chip.set_wake = fn;
 	pxa_init_low_gpio_irq(fn);
 }
 

and

arch/arm/mach-pxa/pxa3xx.c +0 -0
index d1c747c..6fc8281 100644

- --- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -558,13 +558,13 @@ static void __init pxa_init_ext_wakeup_irq(set_wake_t fn)
{
int irq;

+ pxa_ext_wakeup_chip.set_wake = fn;
+
for (irq = IRQ_WAKEUP0; irq <= IRQ_WAKEUP1; irq++) {
set_irq_chip(irq, &pxa_ext_wakeup_chip); set_irq_handler(irq, handle_edge_irq); set_irq_flags(irq, IRQF_VALID);
}
- -
- - pxa_ext_wakeup_chip.set_wake = fn;
}

void __init pxa3xx_init_irq(void)
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk00n7wACgkQBX4mSR26RiO1lgCfRblXeDhxuXHe7sKzQEApzyS7 wjgAniUvOc9RdV5jms1SU5ivQ0T3NogK
=heYm
-----END PGP SIGNATURE-----

#10 lore raw

Hi,

Quoted 53 lines · Lars-Peter Clausen
Quoted 31 lines

If you take a look at the pxa gpio irq handling you'll see that it sets the "set_wake" field of it's irq_chip after calling set_irq_chip for all of the irqs, so the compat handler gets never installed.

So I guess the following patch fixes it:

arch/arm/mach-pxa/irq.c +4 -2
@@ -111,13 +111,13 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
 	GRER0 &= ~0x3;
 	GEDR0 = 0x3;
 
+	pxa_low_gpio_chip.set_wake = fn;
+
 	for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
 		set_irq_chip(irq, &pxa_low_gpio_chip);
 		set_irq_handler(irq, handle_edge_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
-
-	pxa_low_gpio_chip.set_wake = fn;
 }
 
 void __init pxa_init_irq(int irq_nr, set_wake_t fn)
@@ -142,13 +142,14 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 	/* only unmasked interrupts kick us out of idle */
 	ICCR = 1;
 
+	pxa_internal_irq_chip.set_wake = fn;
+

arch/arm/mach-pxa/irq.c void __init pxa_init_irq(int irq_nr, set_wake_t fn) · line 155

Quoted 10 lines
arch/arm/mach-pxa/irq.c +0 -1
 	for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq++) {
 		set_irq_chip(irq, &pxa_internal_irq_chip);
 		set_irq_handler(irq, handle_level_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
 
-	pxa_internal_irq_chip.set_wake = fn;
 	pxa_init_low_gpio_irq(fn);
 }
 

and

arch/arm/mach-pxa/pxa3xx.c +3 -1
index d1c747c..6fc8281 100644
- --- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -558,13 +558,13 @@ static void __init pxa_init_ext_wakeup_irq(set_wake_t fn)
 {
 	int irq;
 
+	pxa_ext_wakeup_chip.set_wake = fn;
+

arch/arm/mach-pxa/pxa3xx.c static void __init pxa_init_ext_wakeup_irq(set_wake_t fn) · line 570

Quoted 10 lines
arch/arm/mach-pxa/pxa3xx.c +0 -2
 	for (irq = IRQ_WAKEUP0; irq <= IRQ_WAKEUP1; irq++) {
 		set_irq_chip(irq, &pxa_ext_wakeup_chip);
 		set_irq_handler(irq, handle_edge_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
- -
- -	pxa_ext_wakeup_chip.set_wake = fn;
 }
 
 void __init pxa3xx_init_irq(void)

Indeed, that does fix it. It doesn't fix all my problems, but at least the device shows the same behavior now as with commit 2f7e99bb9be reverted. It powers up again and then outputs gibberish to the console. I will try another bisect to find out what else is broken.

I will send another mail with your two patches combined into a single commit. Please consider to sign-off that patch and send it upstream and to stable.

Thanks a lot for your help,
Sven

#11 lore raw

PATCH 1/1 pxa3xx: fix PXA GPIO IRQ handling

From: Lars-Peter Clausen <[email protected]>

Set the "set_wake" field of the irq_chip struct before calling set_irq_chip() for all of the IRQs, so that the compat handler actually gets installed.

---
 arch/arm/mach-pxa/irq.c    |    7 ++++---
 arch/arm/mach-pxa/pxa3xx.c |    4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)
arch/arm/mach-pxa/irq.c +4 -3
index 1beb40f..a5b42a7 100644
@@ -111,13 +111,13 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
 	GRER0 &= ~0x3;
 	GEDR0 = 0x3;
 
+	pxa_low_gpio_chip.set_wake = fn;
+
 	for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
 		set_irq_chip(irq, &pxa_low_gpio_chip);
 		set_irq_handler(irq, handle_edge_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
-
-	pxa_low_gpio_chip.set_wake = fn;
 }
 
 void __init pxa_init_irq(int irq_nr, set_wake_t fn)
@@ -142,13 +142,14 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 	/* only unmasked interrupts kick us out of idle */
 	ICCR = 1;
 
+	pxa_internal_irq_chip.set_wake = fn;
+
 	for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq++) {
 		set_irq_chip(irq, &pxa_internal_irq_chip);
 		set_irq_handler(irq, handle_level_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
 
-	pxa_internal_irq_chip.set_wake = fn;
 	pxa_init_low_gpio_irq(fn);
 }
 
arch/arm/mach-pxa/pxa3xx.c +2 -2
index 276e8fb..5a8fe5c 100644
@@ -567,13 +567,13 @@ static void __init pxa_init_ext_wakeup_irq(set_wake_t fn)
 {
 	int irq;
 
+	pxa_ext_wakeup_chip.set_wake = fn;
+
 	for (irq = IRQ_WAKEUP0; irq <= IRQ_WAKEUP1; irq++) {
 		set_irq_chip(irq, &pxa_ext_wakeup_chip);
 		set_irq_handler(irq, handle_edge_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
-
-	pxa_ext_wakeup_chip.set_wake = fn;
 }
 
 void __init pxa3xx_init_irq(void)
Signature · 1 line
1.7.1
#12 lore raw

Re: [PATCH] pxa3xx: fix PXA GPIO IRQ handling

Quoted 7 lines · Sven Neumann

From: Lars-Peter Clausen <[email protected]>

Set the "set_wake" field of the irq_chip struct before calling set_irq_chip() for all of the IRQs, so that the compat handler actually gets installed.

If you send the patch out it needs your S-o-b, too.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#13 lore raw

Re: [PATCH] pxa3xx: fix PXA GPIO IRQ handling

In reply to Sven Neumann
Quoted 7 lines · Sven Neumann

From: Lars-Peter Clausen <[email protected]>

Set the "set_wake" field of the irq_chip struct before calling set_irq_chip() for all of the IRQs, so that the compat handler actually gets installed.

Quoted 61 lines
---
 arch/arm/mach-pxa/irq.c    |    7 ++++---
 arch/arm/mach-pxa/pxa3xx.c |    4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)
arch/arm/mach-pxa/irq.c +4 -3
index 1beb40f..a5b42a7 100644
@@ -111,13 +111,13 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
 	GRER0 &= ~0x3;
 	GEDR0 = 0x3;
 
+	pxa_low_gpio_chip.set_wake = fn;
+
 	for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
 		set_irq_chip(irq, &pxa_low_gpio_chip);
 		set_irq_handler(irq, handle_edge_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
-
-	pxa_low_gpio_chip.set_wake = fn;
 }
 
 void __init pxa_init_irq(int irq_nr, set_wake_t fn)
@@ -142,13 +142,14 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 	/* only unmasked interrupts kick us out of idle */
 	ICCR = 1;
 
+	pxa_internal_irq_chip.set_wake = fn;
+
 	for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq++) {
 		set_irq_chip(irq, &pxa_internal_irq_chip);
 		set_irq_handler(irq, handle_level_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
 
-	pxa_internal_irq_chip.set_wake = fn;
 	pxa_init_low_gpio_irq(fn);
 }
 
arch/arm/mach-pxa/pxa3xx.c +2 -2
index 276e8fb..5a8fe5c 100644
@@ -567,13 +567,13 @@ static void __init pxa_init_ext_wakeup_irq(set_wake_t fn)
 {
 	int irq;
 
+	pxa_ext_wakeup_chip.set_wake = fn;
+
 	for (irq = IRQ_WAKEUP0; irq <= IRQ_WAKEUP1; irq++) {
 		set_irq_chip(irq, &pxa_ext_wakeup_chip);
 		set_irq_handler(irq, handle_edge_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
-
-	pxa_ext_wakeup_chip.set_wake = fn;
 }
 
 void __init pxa3xx_init_irq(void)
#14 lore raw

PATCH 1/1 ARM: pxa: fix GPIO IRQ handling

From: Lars-Peter Clausen <[email protected]>

Set the "set_wake" field of the irq_chip struct before calling set_irq_chip() for all of the IRQs, so that the compat handler actually gets installed.

Cc stable at kernel.org (for 2.6.37 only)
---
 arch/arm/mach-pxa/irq.c    |    7 ++++---
 arch/arm/mach-pxa/pxa3xx.c |    4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)
arch/arm/mach-pxa/irq.c +4 -3
index 1beb40f..a5b42a7 100644
@@ -111,13 +111,13 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
 	GRER0 &= ~0x3;
 	GEDR0 = 0x3;
 
+	pxa_low_gpio_chip.set_wake = fn;
+
 	for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
 		set_irq_chip(irq, &pxa_low_gpio_chip);
 		set_irq_handler(irq, handle_edge_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
-
-	pxa_low_gpio_chip.set_wake = fn;
 }
 
 void __init pxa_init_irq(int irq_nr, set_wake_t fn)
@@ -142,13 +142,14 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 	/* only unmasked interrupts kick us out of idle */
 	ICCR = 1;
 
+	pxa_internal_irq_chip.set_wake = fn;
+
 	for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq++) {
 		set_irq_chip(irq, &pxa_internal_irq_chip);
 		set_irq_handler(irq, handle_level_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
 
-	pxa_internal_irq_chip.set_wake = fn;
 	pxa_init_low_gpio_irq(fn);
 }
 
arch/arm/mach-pxa/pxa3xx.c +2 -2
index 276e8fb..5a8fe5c 100644
@@ -567,13 +567,13 @@ static void __init pxa_init_ext_wakeup_irq(set_wake_t fn)
 {
 	int irq;
 
+	pxa_ext_wakeup_chip.set_wake = fn;
+
 	for (irq = IRQ_WAKEUP0; irq <= IRQ_WAKEUP1; irq++) {
 		set_irq_chip(irq, &pxa_ext_wakeup_chip);
 		set_irq_handler(irq, handle_edge_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
-
-	pxa_ext_wakeup_chip.set_wake = fn;
 }
 
 void __init pxa3xx_init_irq(void)
Signature · 1 line
1.7.1
#15 lore raw

Re: [PATCH] pxa3xx: fix PXA GPIO IRQ handling

In reply to Lars-Peter Clausen
Quoted 6 lines · Lars-Peter Clausen
Quoted 5 lines · Sven Neumann

From: Lars-Peter Clausen <[email protected]>

Set the "set_wake" field of the irq_chip struct before calling set_irq_chip() for all of the IRQs, so that the compat handler actually gets installed.

Not really sure if this is necessary. Lennert has done the transition to irq_data to those _set_wake() functions as well, so it should be OK that compat handler doesn't get installed.

Now I'm not against moving this above, just wondering if there were any consequences/errors coming out?

Quoted 73 lines
Quoted 2 lines
Quoted 51 lines

---
?arch/arm/mach-pxa/irq.c ? ?| ? ?7 ++++---
?arch/arm/mach-pxa/pxa3xx.c | ? ?4 ++--
?2 files changed, 6 insertions(+), 5 deletions(-)

arch/arm/mach-pxa/irq.c +2 -2
index 1beb40f..a5b42a7 100644
@@ -111,13 +111,13 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
 ? ? ? GRER0 &= ~0x3;
 ? ? ? GEDR0 = 0x3;
 
+ ? ? pxa_low_gpio_chip.set_wake = fn;
+
 ? ? ? for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
 ? ? ? ? ? ? ? set_irq_chip(irq, &pxa_low_gpio_chip);
 ? ? ? ? ? ? ? set_irq_handler(irq, handle_edge_irq);
 ? ? ? ? ? ? ? set_irq_flags(irq, IRQF_VALID);
 ? ? ? }
-
- ? ? pxa_low_gpio_chip.set_wake = fn;
 ?}
 
 ?void __init pxa_init_irq(int irq_nr, set_wake_t fn)
@@ -142,13 +142,14 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)

? ? ? /* only unmasked interrupts kick us out of idle */ ? ? ? ICCR = 1;

+ ? ? pxa_internal_irq_chip.set_wake = fn;
+
? ? ? for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq++) { ? ? ? ? ? ? ? set_irq_chip(irq, &pxa_internal_irq_chip); ? ? ? ? ? ? ? set_irq_handler(irq, handle_level_irq); ? ? ? ? ? ? ? set_irq_flags(irq, IRQF_VALID);
? ? ? }

- ? ? pxa_internal_irq_chip.set_wake = fn;
? ? ? pxa_init_low_gpio_irq(fn);
?}

arch/arm/mach-pxa/pxa3xx.c +2 -0
index 276e8fb..5a8fe5c 100644
@@ -567,13 +567,13 @@ static void __init pxa_init_ext_wakeup_irq(set_wake_t fn)
 ?{
 ? ? ? int irq;
 
+ ? ? pxa_ext_wakeup_chip.set_wake = fn;
+

arch/arm/mach-pxa/pxa3xx.c static void __init pxa_init_ext_wakeup_irq(set_wake_t fn) · line 579

Quoted 10 lines
arch/arm/mach-pxa/pxa3xx.c +0 -2
 ? ? ? for (irq = IRQ_WAKEUP0; irq <= IRQ_WAKEUP1; irq++) {
 ? ? ? ? ? ? ? set_irq_chip(irq, &pxa_ext_wakeup_chip);
 ? ? ? ? ? ? ? set_irq_handler(irq, handle_edge_irq);
 ? ? ? ? ? ? ? set_irq_flags(irq, IRQF_VALID);
 ? ? ? }
-
- ? ? pxa_ext_wakeup_chip.set_wake = fn;
 ?}
 
 ?void __init pxa3xx_init_irq(void)

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#16 lore raw

Re: [PATCH] pxa3xx: fix PXA GPIO IRQ handling

Quoted 7 lines · Eric Miao
Quoted 3 lines
Quoted 3 lines

Set the "set_wake" field of the irq_chip struct before calling set_irq_chip() for all of the IRQs, so that the compat handler actually gets installed.

Not really sure if this is necessary. Lennert has done the transition to irq_data to those _set_wake() functions as well, so it should be OK that compat handler doesn't get installed.

Yeah, this has been dealt with upstream, and this patch won't apply.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
arch/arm/mach-pxa/irq.c +0 -0
index 1beb40f..a5b42a7 100644
@@ -111,13 +111,13 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
 ? ? ? GRER0 &= ~0x3;
 ? ? ? GEDR0 = 0x3;
 
Quoted 9 lines
Quoted 9 lines

arch/arm/mach-pxa/irq.c static void __init pxa_init_low_gpio_irq(set_wake_t fn) · line 120

Quoted 9 lines
arch/arm/mach-pxa/irq.c +2 -2
+ ? ? pxa_low_gpio_chip.set_wake = fn;
+
 ? ? ? for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
 ? ? ? ? ? ? ? set_irq_chip(irq, &pxa_low_gpio_chip);
 ? ? ? ? ? ? ? set_irq_handler(irq, handle_edge_irq);
 ? ? ? ? ? ? ? set_irq_flags(irq, IRQF_VALID);
 ? ? ? }
-
- ? ? pxa_low_gpio_chip.set_wake = fn;

Upstream has:

        pxa_low_gpio_chip.irq_set_wake = fn;
#17 lore raw

Re: [PATCH] pxa3xx: fix PXA GPIO IRQ handling

In reply to Eric Miao
Quoted 8 lines · Eric Miao
Quoted 6 lines · Lars-Peter Clausen
Quoted 5 lines · Sven Neumann

From: Lars-Peter Clausen <[email protected]>

Set the "set_wake" field of the irq_chip struct before calling set_irq_chip() for all of the IRQs, so that the compat handler actually gets installed.

Quoted 6 lines

Not really sure if this is necessary. Lennert has done the transition to irq_data to those _set_wake() functions as well, so it should be OK that compat handler doesn't get installed.

Now I'm not against moving this above, just wondering if there were any consequences/errors coming out?

Well, our PXA300 device doesn't power up again when it should resume from suspend. Fine with me if this has been fixed upstream, but I would still like to get this patch into 2.6.37. I'll try to test upstream as soon as Linus releases 2.6.38-rc1...

Sven

#18 lore raw

Re: [PATCH] pxa3xx: fix PXA GPIO IRQ handling

Quoted 13 lines · Sven Neumann
Quoted 12 lines · Eric Miao
Quoted 6 lines · Lars-Peter Clausen
Quoted 5 lines · Sven Neumann

From: Lars-Peter Clausen <[email protected]>

Set the "set_wake" field of the irq_chip struct before calling set_irq_chip() for all of the IRQs, so that the compat handler actually gets installed.

Not really sure if this is necessary. Lennert has done the transition to irq_data to those _set_wake() functions as well, so it should be OK that compat handler doesn't get installed.

Quoted 5 lines
Quoted 2 lines

Now I'm not against moving this above, just wondering if there were any consequences/errors coming out?

Well, our PXA300 device doesn't power up again when it should resume from suspend. Fine with me if this has been fixed upstream,

Yeah, that's true. Mind re-post with your SOB?

Quoted 9 lines

but I would
still like to get this patch into 2.6.37. I'll try to test upstream as soon as Linus releases 2.6.38-rc1...

Sven

#19 lore raw

Re: [PATCH] pxa3xx: fix PXA GPIO IRQ handling

Quoted 14 lines · Eric Miao
Quoted 13 lines · Sven Neumann
Quoted 12 lines · Eric Miao
Quoted 6 lines · Lars-Peter Clausen
Quoted 5 lines · Sven Neumann

From: Lars-Peter Clausen <[email protected]>

Set the "set_wake" field of the irq_chip struct before calling set_irq_chip() for all of the IRQs, so that the compat handler actually gets installed.

Not really sure if this is necessary. Lennert has done the transition to irq_data to those _set_wake() functions as well, so it should be OK that compat handler doesn't get installed.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Now I'm not against moving this above, just wondering if there were any consequences/errors coming out?

Well, our PXA300 device doesn't power up again when it should resume from suspend. Fine with me if this has been fixed upstream,

Yeah, that's true. Mind re-post with your SOB?

And Cc linux-stable.

Quoted 4 lines
Quoted 4 lines

but I would
still like to get this patch into 2.6.37. I'll try to test upstream as soon as Linus releases 2.6.38-rc1...

That's will be great help.

Quoted 7 lines
Quoted 6 lines

Sven

#20 lore raw
In reply to Lars-Peter Clausen
Quoted 3 lines · Lars-Peter Clausen

If you take a look at the pxa gpio irq handling you'll see that it sets the "set_wake" field of it's irq_chip after calling set_irq_chip for all of the irqs, so the compat handler gets never installed.

Good catch. Can you please resend with a proper changelog and SOB? Please add

Cc stable at kernel.org

after the Signed-off-by line.

Also feel free to add: