diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2016-08-31 19:46:55 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-22 12:06:46 +0200 |
commit | fedf90584600c18be041d8a38c0024e4590c9643 (patch) | |
tree | 93281b338c2cfe7d68d7d8deb98506067a01a859 /drivers/ras | |
parent | 0c33f651585ccd1d07875d2a3a71a0c11520cb3b (diff) |
serial: 8250_port: fix runtime PM use in __do_stop_tx_rs485()
commit b3965767d86cf4534dfe1affbde0453d3224ed7f upstream.
There are calls to serial8250_rpm_{get|put}() in __do_stop_tx_rs485() that are
certainly placed in a wrong location. I dunno how it had been tested with
runtime PM enabled because it is obvious "sleep in atomic context" error.
Besides that serial8250_rpm_get() is called immediately after an IO just
happened. It implies that the device is already powered on, see implementation
of serial8250_em485_rts_after_send() and serial8250_clear_fifos() for the
details.
There is no bug have been seen due to, as I can guess, use of auto suspend mode
when scheduled transaction to suspend is invoked quite lately than it's needed
for a few writes to the port. It might be possible to trigger a warning if
stop_tx_timer fires when device is suspended.
Refactor the code to use runtime PM only in case of timer function.
Fixes: 0c66940d584d ("tty/serial/8250: fix RS485 half-duplex RX")
Cc: "Matwey V. Kornilov" <matwey@sai.msu.ru>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/ras')
0 files changed, 0 insertions, 0 deletions