[patch 2.6.20-rc4] at91_cf: Unbalanced IRQs in suspend/resume

Andrew Victor andrew at sanpeople.com
Tue Jan 9 06:20:08 EST 2007


This patch fixes the unbalanced calls to enable_irq_wake() and
disable_irq_wake() in the AT91 PCMCIA/Compact Flash driver.

If should resolve these kernel messages:
  Unbalanced IRQ x wake disable
  BUG: warning at kernel/irq/manage.c:167/set_irq_wake()

Original patch from Marc Pignat.


Signed-off-by: Andrew Victor <andrew at sanpeople.com>


diff -urN -x CVS linux-2.6.20-rc4/drivers/pcmcia/at91_cf.c linux-2.6/drivers/pcmcia/at91_cf.c
--- linux-2.6.20-rc4/drivers/pcmcia/at91_cf.c	Tue Jan  9 08:46:02 2007
+++ linux-2.6/drivers/pcmcia/at91_cf.c	Thu Dec 14 16:22:05 2006
@@ -333,20 +333,27 @@
 	struct at91_cf_data	*board = cf->board;
 
 	pcmcia_socket_dev_suspend(&pdev->dev, mesg);
+
 	if (device_may_wakeup(&pdev->dev)) {
 		enable_irq_wake(board->det_pin);
 		if (board->irq_pin)
 			enable_irq_wake(board->irq_pin);
-	} else {
-		disable_irq_wake(board->det_pin);
-		if (board->irq_pin)
-			disable_irq_wake(board->irq_pin);
 	}
+
 	return 0;
 }
 
 static int at91_cf_resume(struct platform_device *pdev)
 {
+	struct at91_cf_socket	*cf = platform_get_drvdata(pdev);
+	struct at91_cf_data	*board = cf->board;
+
+	if (device_may_wakeup(&pdev->dev)) {
+		disable_irq_wake(board->det_pin);
+		if (board->irq_pin)
+			disable_irq_wake(board->irq_pin);
+	}
+
 	pcmcia_socket_dev_resume(&pdev->dev);
 	return 0;
 }






More information about the linux-pcmcia mailing list