diff options
author | Felipe Balbi <balbi@ti.com> | 2012-09-06 08:45:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-06 12:17:02 -0400 |
commit | a6b19c333c2f100f32e07d5209cf9f0b4f81b6eb (patch) | |
tree | 0b37879e1146499c176571b53e4addd094e0ecce /drivers/tty/serial/omap-serial.c | |
parent | 9727faf4706eb49ce88e3f2bb961278a84eac080 (diff) |
serial: omap: make sure to put() on poll_get_char
if we would reach serial_omap_get_char() while
Data Ready bit isn't set, we would return from
it without kicking our pm timer. This would mean
we would, eventually, have an unbalanced
pm_runtime_get on our device which would prevent
it from ever sleeping again.
Tested-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/omap-serial.c')
-rw-r--r-- | drivers/tty/serial/omap-serial.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 7531147fbd38..6a58f4f64f81 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c | |||
@@ -1005,12 +1005,17 @@ static int serial_omap_poll_get_char(struct uart_port *port) | |||
1005 | 1005 | ||
1006 | pm_runtime_get_sync(up->dev); | 1006 | pm_runtime_get_sync(up->dev); |
1007 | status = serial_in(up, UART_LSR); | 1007 | status = serial_in(up, UART_LSR); |
1008 | if (!(status & UART_LSR_DR)) | 1008 | if (!(status & UART_LSR_DR)) { |
1009 | return NO_POLL_CHAR; | 1009 | status = NO_POLL_CHAR; |
1010 | goto out; | ||
1011 | } | ||
1010 | 1012 | ||
1011 | status = serial_in(up, UART_RX); | 1013 | status = serial_in(up, UART_RX); |
1014 | |||
1015 | out: | ||
1012 | pm_runtime_mark_last_busy(up->dev); | 1016 | pm_runtime_mark_last_busy(up->dev); |
1013 | pm_runtime_put_autosuspend(up->dev); | 1017 | pm_runtime_put_autosuspend(up->dev); |
1018 | |||
1014 | return status; | 1019 | return status; |
1015 | } | 1020 | } |
1016 | 1021 | ||