diff mbox

Unbalanced IRQ wake disable during resume from static suspend

Message ID AANLkTinrU4nSkoDJNRb57y-WoVd9dqYce4h9sQNYfpgX@mail.gmail.com (mailing list archive)
State Accepted
Delegated to: Kevin Hilman
Headers show

Commit Message

Govindraj R Dec. 3, 2010, 11:20 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index cd85112..0466815 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1990,7 +1990,8 @@  int uart_suspend_port(struct uart_driver *drv,
struct uart_port *uport)

 	tty_dev = device_find_child(uport->dev, &match, serial_match_port);
 	if (device_may_wakeup(tty_dev)) {
-		enable_irq_wake(uport->irq);
+		if (!enable_irq_wake(uport->irq))
+			uport->irq_wake = 1;
 		put_device(tty_dev);
 		mutex_unlock(&port->mutex);
 		return 0;
@@ -2056,7 +2057,8 @@  int uart_resume_port(struct uart_driver *drv,
struct uart_port *uport)

 	tty_dev = device_find_child(uport->dev, &match, serial_match_port);
 	if (!uport->suspended && device_may_wakeup(tty_dev)) {
-		disable_irq_wake(uport->irq);
+		if (uport->irq_wake)
+			disable_irq_wake(uport->irq);
 		mutex_unlock(&port->mutex);
 		return 0;
 	}
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 295e898..88e73c3 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -359,6 +359,7 @@  struct uart_port {
 	struct device		*dev;			/* parent device */
 	unsigned char		hub6;			/* this should be in the 8250 driver */
 	unsigned char		suspended;
+	unsigned char		irq_wake;		/* Irq_wakeup Available */
 	unsigned char		unused[2];
 	void			*private_data;		/* generic platform data pointer */
 };