Re: [PATCH] serial: amba-pl011: publish amba_ports[] entries with release semantics

From: Greg Kroah-Hartman

Date: Wed Sep 23 2026 - 08:12:49 EST


On Mon, Sep 21, 2026 at 09:20:12PM -0400, Jaidev Shastri via B4 Relay wrote:
> From: Jaidev Shastri <jaidevshastri@xxxxxx>
>
> pl011_setup_port() fills the port structure and then stores its address
> into amba_ports[] with a plain store. The console callbacks read the
> slot through co->index with plain loads.
>
> Store the slot with smp_store_release() and read it with
> smp_load_acquire().
>
> Found with MBCheck, a static herd7-based memory consistency checker.
>
> Signed-off-by: Jaidev Shastri <jaidevshastri@xxxxxx>
> ---
> drivers/tty/serial/amba-pl011.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index c4824c201..696c12ca9 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
> @@ -2536,7 +2536,8 @@ static int pl011_console_setup(struct console *co, char *options)
> */
> if (co->index >= UART_NR)
> co->index = 0;
> - uap = amba_ports[co->index];
> + /* Pairs with the smp_store_release() in pl011_setup_port(). */
> + uap = smp_load_acquire(&amba_ports[co->index]);

That is usually wrong and not how to do this :(

Pleaase fix this properly, if it actually is a real issue.

thanks,

greg k-h