All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] serial: 8250_pci: Remove empty stub pci_quatech_exit()
@ 2021-10-25 12:41 Andy Shevchenko
  2021-10-25 12:41 ` [PATCH v1 2/2] serial: 8250_port: properly handle runtime PM in IRQ Andy Shevchenko
  2021-10-25 12:43 ` [PATCH v1 1/2] serial: 8250_pci: Remove empty stub pci_quatech_exit() Andy Shevchenko
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2021-10-25 12:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-serial, linux-kernel
  Cc: Jiri Slaby, Andy Shevchenko

The ->exit() callback is checked for presence anyway,
no need to have an empty stub.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/tty/serial/8250/8250_pci.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 1d5579143fc8..80ac3235ec35 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -1298,10 +1298,6 @@ static int pci_quatech_setup(struct serial_private *priv,
 	return pci_default_setup(priv, board, port, idx);
 }
 
-static void pci_quatech_exit(struct pci_dev *dev)
-{
-}
-
 static int pci_default_setup(struct serial_private *priv,
 		  const struct pciserial_board *board,
 		  struct uart_8250_port *port, int idx)
@@ -2176,7 +2172,6 @@ static struct pci_serial_quirk pci_serial_quirks[] = {
 		.subdevice	= PCI_ANY_ID,
 		.init		= pci_quatech_init,
 		.setup		= pci_quatech_setup,
-		.exit		= pci_quatech_exit,
 	},
 	/*
 	 * Panacom
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v1 2/2] serial: 8250_port: properly handle runtime PM in IRQ
  2021-10-25 12:41 [PATCH v1 1/2] serial: 8250_pci: Remove empty stub pci_quatech_exit() Andy Shevchenko
@ 2021-10-25 12:41 ` Andy Shevchenko
  2021-10-25 12:43   ` Andy Shevchenko
  2021-10-25 12:43 ` [PATCH v1 1/2] serial: 8250_pci: Remove empty stub pci_quatech_exit() Andy Shevchenko
  1 sibling, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2021-10-25 12:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-serial, linux-kernel
  Cc: Jiri Slaby, Andy Shevchenko

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 <andriy.shevchenko@linux.intel.com>
---
 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 5775cbff8f6e..89387d86d495 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -1939,17 +1939,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.33.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/2] serial: 8250_pci: Remove empty stub pci_quatech_exit()
  2021-10-25 12:41 [PATCH v1 1/2] serial: 8250_pci: Remove empty stub pci_quatech_exit() Andy Shevchenko
  2021-10-25 12:41 ` [PATCH v1 2/2] serial: 8250_port: properly handle runtime PM in IRQ Andy Shevchenko
@ 2021-10-25 12:43 ` Andy Shevchenko
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2021-10-25 12:43 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Greg Kroah-Hartman, open list:SERIAL DRIVERS,
	Linux Kernel Mailing List, Jiri Slaby

On Mon, Oct 25, 2021 at 3:42 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> The ->exit() callback is checked for presence anyway,
> no need to have an empty stub.

Sorry, wrong set, please ignore both patches.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 2/2] serial: 8250_port: properly handle runtime PM in IRQ
  2021-10-25 12:41 ` [PATCH v1 2/2] serial: 8250_port: properly handle runtime PM in IRQ Andy Shevchenko
@ 2021-10-25 12:43   ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2021-10-25 12:43 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Greg Kroah-Hartman, open list:SERIAL DRIVERS,
	Linux Kernel Mailing List, Jiri Slaby

On Mon, Oct 25, 2021 at 3:42 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> 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.

Please, ignore.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-25 12:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 12:41 [PATCH v1 1/2] serial: 8250_pci: Remove empty stub pci_quatech_exit() Andy Shevchenko
2021-10-25 12:41 ` [PATCH v1 2/2] serial: 8250_port: properly handle runtime PM in IRQ Andy Shevchenko
2021-10-25 12:43   ` Andy Shevchenko
2021-10-25 12:43 ` [PATCH v1 1/2] serial: 8250_pci: Remove empty stub pci_quatech_exit() Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.