aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorGovindraj.R <govindraj.raja@ti.com>2010-12-16 07:42:47 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-12-16 16:14:32 -0500
commit3f960dbb9dfe29ff283810624c4340c79fde87f5 (patch)
treec64865f846f4adf28bdebe0568ce7e571c12a372 /drivers/serial
parent6ce5b1ce5f6922db32599e73bcb22f5cdcbf241f (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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 2835e29298ed..76418c139ffa 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)
1986 1986
1987 tty_dev = device_find_child(uport->dev, &match, serial_match_port); 1987 tty_dev = device_find_child(uport->dev, &match, serial_match_port);
1988 if (device_may_wakeup(tty_dev)) { 1988 if (device_may_wakeup(tty_dev)) {
1989 enable_irq_wake(uport->irq); 1989 if (!enable_irq_wake(uport->irq))
1990 uport->irq_wake = 1;
1990 put_device(tty_dev); 1991 put_device(tty_dev);
1991 mutex_unlock(&port->mutex); 1992 mutex_unlock(&port->mutex);
1992 return 0; 1993 return 0;
@@ -2052,7 +2053,10 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
2052 2053
2053 tty_dev = device_find_child(uport->dev, &match, serial_match_port); 2054 tty_dev = device_find_child(uport->dev, &match, serial_match_port);
2054 if (!uport->suspended && device_may_wakeup(tty_dev)) { 2055 if (!uport->suspended && device_may_wakeup(tty_dev)) {
2055 disable_irq_wake(uport->irq); 2056 if (uport->irq_wake) {
2057 disable_irq_wake(uport->irq);
2058 uport->irq_wake = 0;
2059 }
2056 mutex_unlock(&port->mutex); 2060 mutex_unlock(&port->mutex);
2057 return 0; 2061 return 0;
2058 } 2062 }