Linux Serial subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rosen Penev" <rosenp@gmail.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: ucc_uart: Use platform IRQ helper
Date: Fri, 25 Sep 2026 18:33:07 +0000	[thread overview]
Message-ID: <20260925183307.8F8961F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260925182504.54976-1-rosenp@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] probe deferral: leak of async firmware load due to platform_get_irq() ordering
--

commit 887c64b890c9273da1e7e1715e89bca754adbfb0
Author: Rosen Penev <rosenp@gmail.com>

serial: ucc_uart: Use platform IRQ helper

This commit updates the driver to use platform_get_irq() instead of
irq_of_parse_and_map() to obtain the IRQ. The IRQ lookup is moved earlier
in the probe function to simplify error handling and explicitly handle
probe deferral.

> diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
> index 6b7dcbbacd13d..c3c83a59dcce7 100644
> --- a/drivers/tty/serial/ucc_uart.c
> +++ b/drivers/tty/serial/ucc_uart.c
> @@ -1238,6 +1238,7 @@ static int ucc_uart_probe(struct platform_device *ofdev)
>  	struct uart_qe_port *qe_port = NULL;
>  	struct resource res;
>  	u32 val;
> +	int irq;
>  	int ret;
>  
>  	/*
> @@ -1247,6 +1248,10 @@ static int ucc_uart_probe(struct platform_device *ofdev)
>  	if (ret)
>  		return ret;
>  
> +	irq = platform_get_irq(ofdev, 0);
> +	if (irq < 0)
> +		return irq;
> +

[Severity: High]
If platform_get_irq() returns -EPROBE_DEFER here, does this leak the
asynchronous firmware load initiated by the preceding call to
soft_uart_init()?

Looking at soft_uart_init(), an async load is triggered like this:

    ret = request_firmware_nowait(THIS_MODULE,
                                  FW_ACTION_UEVENT, filename, &ofdev->dev,
                                  GFP_KERNEL, &ofdev->dev, uart_firmware_cont);

Since the async firmware load is not cancelled on probe deferral, the probe 
will eventually be retried and will call soft_uart_init() a second time. 

Could this lead to duplicated asynchronous firmware loads and concurrent
execution of qe_upload_firmware() upon probe retry, potentially causing
data races or hardware state corruption?

Would it make sense to move platform_get_irq() even earlier in the
probe function, before soft_uart_init(), to prevent this probe deferral
side effect?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260925182504.54976-1-rosenp@gmail.com?part=1

  reply	other threads:[~2026-09-25 18:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 18:25 [PATCH] serial: ucc_uart: Use platform IRQ helper Rosen Penev
2026-09-25 18:33 ` sashiko-bot [this message]
2026-09-25 18:50   ` Rosen Penev

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=20260925183307.8F8961F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rosenp@gmail.com \
    --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