summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-02-17 13:40:16 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-17 15:58:00 +0100
commit089b6d36549160b535e109cd07ed6d578b81de46 (patch)
tree244947c9adff5f57b4666c254467f095a95b673c /drivers/tty
parentbedb404e91bb2908d9921fc736a518a9d89525fc (diff)
serial: 8250_port: Disable DMA operations for kernel console
It would be too tricky and error prone to allow DMA operations on kernel console. One of the concern is when DMA is a separate device, for example on Intel CherryTrail platforms, and might need special work around to be functional, see the commit eebb3e8d8aaf ("ACPI / LPSS: override power state for LPSS DMA device") for more information. Another one is that kernel console is used in atomic context, e.g. when printing crucial information to the user (Oops or crash), and DMA may not serve due to power management complications including non-atomic ACPI calls but not limited to it (see above). Besides that, other concerns are described in the commit 84b40e3b57ee ("serial: 8250: omap: Disable DMA for console UART") done for OMAP UART and may be repeated here. Disable any kind of DMA operations on kernel console due to above concerns. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20200217114016.49856-7-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/8250/8250_port.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index c156a30c4dec..4440867b7d20 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -2367,9 +2367,14 @@ dont_test_tx_en:
* Request DMA channels for both RX and TX.
*/
if (up->dma) {
- retval = serial8250_request_dma(up);
- if (retval) {
- dev_warn_ratelimited(port->dev, "failed to request DMA\n");
+ const char *msg = NULL;
+
+ if (uart_console(port))
+ msg = "forbid DMA for kernel console";
+ else if (serial8250_request_dma(up))
+ msg = "failed to request DMA";
+ if (msg) {
+ dev_warn_ratelimited(port->dev, "%s\n", msg);
up->dma = NULL;
}
}