From: sashiko-bot@kernel.org
To: "Kendall Willis" <k-willis@ti.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: 8250_omap: fix wake irq cleared during suspend
Date: Mon, 24 Aug 2026 16:41:33 +0000 [thread overview]
Message-ID: <20260824164133.A68561F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260824-uart-wakeirq-fix-v1-1-6d81a230a1c4@ti.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [Medium] Calling `dev_pm_clear_wake_irq()` after `pm_runtime_put_sync()` in the teardown paths creates a race window that can leave the device permanently active.
Pre-existing issues:
- [High] Invalid hardware access via `pm_runtime_get_noresume()` in the IRQ handler allows access to powered-off hardware.
--
--- Patch [1]: [PATCH] serial: 8250_omap: fix wake irq cleared during suspend ---
commit 69c0ce16c163036cdb1ba2600546648c535da1c2
Author: Kendall Willis <k-willis@ti.com>
serial: 8250_omap: fix wake irq cleared during suspend
The wake irq was cleared in shutdown(), which runs during the suspend
sequence, making it impossible to wake the system via UART. Move wake
irq setup to probe() and teardown to remove() so the irq remains armed
during suspend when the UART is a wakeup source.
> diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
> index 3c7775df27eff..9cc88d2c510ce 100644
> --- a/drivers/tty/serial/8250/8250_omap.c
> +++ b/drivers/tty/serial/8250/8250_omap.c
[ ... ]
> @@ -1608,6 +1607,7 @@ static int omap8250_probe(struct platform_device *pdev)
> flush_work(&priv->qos_work);
> pm_runtime_disable(&pdev->dev);
> cpu_latency_qos_remove_request(&priv->pm_qos_request);
> + dev_pm_clear_wake_irq(&pdev->dev);
[Severity: Medium]
Does calling dev_pm_clear_wake_irq() after pm_runtime_put_sync() create a
race condition?
When pm_runtime_put_sync() synchronously suspends the device earlier in the
cleanup path, the PM core enables the wake IRQ. If the wake IRQ fires before
dev_pm_clear_wake_irq() can disable it, the threaded handler may call
pm_runtime_resume().
The subsequent pm_runtime_disable() will then wait for the resume to finish,
leaving the device permanently locked in the RPM_ACTIVE state.
> return ret;
> }
>
> @@ -1630,6 +1630,7 @@ static void omap8250_remove(struct platform_device *pdev)
> flush_work(&priv->qos_work);
> pm_runtime_disable(&pdev->dev);
> cpu_latency_qos_remove_request(&priv->pm_qos_request);
> + dev_pm_clear_wake_irq(&pdev->dev);
[Severity: Medium]
Could this teardown order leave the device permanently active here as well?
Similarly to the probe error path above, calling dev_pm_clear_wake_irq()
after pm_runtime_put_sync() opens a window where a wake IRQ could cause the
device to resume.
The pm_runtime_disable() would then wait for the resume to finish, locking
the device in RPM_ACTIVE.
> device_set_wakeup_capable(&pdev->dev, false);
> }
[Severity: High]
This is a pre-existing issue, but does using pm_runtime_get_noresume() in
the interrupt handler allow access to powered-off hardware?
Looking at omap8250_irq() in drivers/tty/serial/8250/8250_omap.c:
omap8250_irq() {
pm_runtime_get_noresume(port->dev);
/* Shallow idle state wake-up to an IO interrupt? */
...
lsr = serial_port_in(port, UART_LSR);
iir = serial_port_in(port, UART_IIR);
...
}
pm_runtime_get_noresume() only increments the usage counter but does not
initiate a resume or check the runtime status.
If the IO interrupt fires while the device is in a shallow idle state, the
code may proceed to read registers while the hardware is suspended or has
lost context.
Should this use pm_runtime_get_if_active() to verify the device is actually
active before accessing hardware registers?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260824-uart-wakeirq-fix-v1-1-6d81a230a1c4@ti.com?part=1
next prev parent reply other threads:[~2026-08-24 16:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 16:28 [PATCH] serial: 8250_omap: fix wake irq cleared during suspend Kendall Willis
2026-08-24 16:41 ` sashiko-bot [this message]
2026-08-25 7:27 ` Sebastian Andrzej Siewior
2026-08-25 14:52 ` Kendall Willis
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=20260824164133.A68561F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=k-willis@ti.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 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.