From 77a92c7a052e8a159606ec0a6432bbd944c0939f Mon Sep 17 00:00:00 2001 From: Miguel Bernal Marin Date: Tue, 16 Oct 2018 06:15:48 -0500 Subject: [PATCH] fix SERIAL_8250_DETECT_IRQ --- ...rt-properly-handle-runtime-PM-in-IRQ.patch | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 1059-serial-8250_port-properly-handle-runtime-PM-in-IRQ.patch diff --git a/1059-serial-8250_port-properly-handle-runtime-PM-in-IRQ.patch b/1059-serial-8250_port-properly-handle-runtime-PM-in-IRQ.patch new file mode 100644 index 00000000..12727ab4 --- /dev/null +++ b/1059-serial-8250_port-properly-handle-runtime-PM-in-IRQ.patch @@ -0,0 +1,49 @@ +From 07f1a49b166b7e3d03de191f80a94fdd88a696d4 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Mon, 12 Sep 2016 13:55:22 +0300 +Subject: [PATCH 1059/1676] serial: 8250_port: properly handle runtime PM in + IRQ + +We can't and basically don't need to call runtime PM in IRQ handler. If IRQ is +ours, device must be powered on. Otherwise check if the device is powered off +and return immediately. + +Signed-off-by: Andy Shevchenko +--- + drivers/tty/serial/8250/8250_port.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c +index 59b61d8..545411e 100644 +--- a/drivers/tty/serial/8250/8250_port.c ++++ b/drivers/tty/serial/8250/8250_port.c +@@ -1889,17 +1889,19 @@ EXPORT_SYMBOL_GPL(serial8250_handle_irq); + + static int serial8250_default_handle_irq(struct uart_port *port) + { +- struct uart_8250_port *up = up_to_u8250p(port); + unsigned int iir; +- int ret; + +- serial8250_rpm_get(up); ++ /* ++ * The IRQ might be shared with other peripherals so we must first ++ * check that are we RPM suspended or not. If we are we assume that ++ * the IRQ was not for us (we shouldn't be RPM suspended when the ++ * interrupt is enabled). ++ */ ++ if (pm_runtime_suspended(port->dev)) ++ return 0; + + iir = serial_port_in(port, UART_IIR); +- ret = serial8250_handle_irq(port, iir); +- +- serial8250_rpm_put(up); +- return ret; ++ return serial8250_handle_irq(port, iir); + } + + /* +-- +2.7.4 +