From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Arina Kharlamova via B4 Relay
<devnull+arina.kharlamova.mbzuai.ac.ae@kernel.org>
Cc: "Pali Rohár" <pali@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Gregory CLEMENT" <gregory.clement@bootlin.com>,
arina.kharlamova@mbzuai.ac.ae, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: mvebu-uart: do not leave a stale port behind when probe fails
Date: Wed, 02 Dec 2026 12:29:20 +0100 [thread overview]
Message-ID: <874icvor8v.fsf@bootlin.com> (raw)
In-Reply-To: <20261201-v08b-v1-1-add40eb9ffee@mbzuai.ac.ae> (Arina Kharlamova via's message of "Tue, 01 Dec 2026 23:19:52 +0400")
On 01/12/2026 at 23:19:52 +04, Arina Kharlamova via B4 Relay <devnull+arina.kharlamova.mbzuai.ac.ae@kernel.org> wrote:
> From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
>
> mvebu_uart_probe() stores the devm mapping in mvebu_uart_ports[] before
> it gets the clock and the interrupts. If one of them fails or defers,
> devres unmaps the registers and frees the private data, but the static
> port keeps membase, mapbase and private_data.
>
> mvebu_uart_console_setup() only checks membase and mapbase. When
> another port registers the console first, for example with
> console=ttyMV1 and ttyMV1 still waiting for its clock, the setup
> callback uses the stale port and accesses the unmapped registers.
>
> Keep the mapping in a local variable and store it in the port only
> after the last step that can fail before uart_add_one_port().
>
> Fixes: 68a0db1d7da2 ("serial: mvebu-uart: add function to change baudrate")
> Signed-off-by: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
prev parent reply other threads:[~2026-12-02 11:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 19:19 [PATCH] serial: mvebu-uart: do not leave a stale port behind when probe fails Arina Kharlamova via B4 Relay
2026-12-01 19:30 ` sashiko-bot
2026-12-02 11:29 ` Miquel Raynal [this message]
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=874icvor8v.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=arina.kharlamova@mbzuai.ac.ae \
--cc=devnull+arina.kharlamova.mbzuai.ac.ae@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=gregory.clement@bootlin.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=pali@kernel.org \
/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