From: sashiko-bot@kernel.org
To: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH v2 2/2] serial: 8250_port: properly handle runtime PM in IRQ
Date: Thu, 24 Sep 2026 12:40:41 +0000 [thread overview]
Message-ID: <20260924124042.1C4AF1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260924122549.668680-3-andriy.shevchenko@linux.intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] serial: 8250: missing port->dev NULL check in serial8250_default_handle_irq()
--
commit 128116d52224b04215dd65b2f4f799e8c14bdec7
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
serial: 8250_port: properly handle runtime PM in IRQ
This commit updates the 8250 driver IRQ handler to explicitly check the
runtime PM status before processing the interrupt. It returns immediately
if the device is powered off, assuming it is a shared interrupt.
> diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
> index c0bcc0742a60c..1e62460b19ab9 100644
> --- a/drivers/tty/serial/8250/8250_port.c
> +++ b/drivers/tty/serial/8250/8250_port.c
> @@ -1878,13 +1878,22 @@ EXPORT_SYMBOL_GPL(serial8250_handle_irq);
>
> static int serial8250_default_handle_irq(struct uart_port *port)
> {
[ ... ]
> + /* if driver suspended, return, probably shared interrupt */
> + pm_status = pm_runtime_get_if_active(port->dev);
[Severity: High]
Will this trigger a kernel panic if the port has no associated device?
Some ports, such as legacy ISA serial ports, might have a NULL port->dev.
Calling pm_runtime_get_if_active() with a NULL pointer would unconditionally
dereference it.
> + if (!pm_status)
> + return 0;
>
> iir = serial_port_in(port, UART_IIR);
> - return serial8250_handle_irq(port, iir);
> + ret = serial8250_handle_irq(port, iir);
> +
> + if (pm_status > 0)
> + pm_runtime_put_autosuspend(port->dev);
[Severity: High]
Similarly, does this put operation need a check to ensure port->dev is valid
before passing it to pm_runtime_put_autosuspend()?
> +
> + return ret;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260924122549.668680-1-andriy.shevchenko@linux.intel.com?part=2
next prev parent reply other threads:[~2026-09-24 12:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 12:24 [PATCH v2 0/2] serial: 8250_port: Update runtime PM flow Andy Shevchenko
2026-09-24 12:24 ` [PATCH v2 1/2] serial: 8250_port: Remove redundant pm_runtime_mark_last_busy() call Andy Shevchenko
2026-09-24 12:28 ` sashiko-bot
2026-09-24 12:24 ` [PATCH v2 2/2] serial: 8250_port: properly handle runtime PM in IRQ Andy Shevchenko
2026-09-24 12:40 ` sashiko-bot [this message]
2026-09-25 17:00 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260924124042.1C4AF1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-serial@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox