diff options
author | Govindraj.R <govindraj.raja@ti.com> | 2010-12-16 18:12:47 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-16 13:14:32 -0800 |
commit | 3f960dbb9dfe29ff283810624c4340c79fde87f5 (patch) | |
tree | c64865f846f4adf28bdebe0568ce7e571c12a372 /drivers/serial | |
parent | 6ce5b1ce5f6922db32599e73bcb22f5cdcbf241f (diff) |
Serial: Avoid unbalanced IRQ wake disable during resume
To avoid unbalanced IRQ wake disable, ensure that wakeups are disabled
only when wakeups have been successfully enabled.
Tested on OMAP3630SDP/ZOOM3.
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Reported-by: Paul Walmsley <paul@pwsan.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/serial_core.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 2835e29298e..76418c139ff 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -1986,7 +1986,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; @@ -2052,7 +2053,10 @@ 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); + uport->irq_wake = 0; + } mutex_unlock(&port->mutex); return 0; } |