public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation•org>
To: Rosen Penev <rosenp@gmail•com>
Cc: linux-serial@vger•kernel.org, Jiri Slaby <jirislaby@kernel•org>,
	Frank Li <Frank.Li@nxp•com>,
	Sascha Hauer <s.hauer@pengutronix•de>,
	Pengutronix Kernel Team <kernel@pengutronix•de>,
	Fabio Estevam <festevam@gmail•com>,
	"open list:TTY LAYER AND SERIAL DRIVERS"
	<linux-kernel@vger•kernel.org>,
	"open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
	<imx@lists•linux.dev>,
	"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
	<linux-arm-kernel@lists•infradead.org>
Subject: Re: [PATCH] serial: mxs-auart: fix probe error paths and clock handling
Date: Sat, 30 May 2026 07:21:52 +0200	[thread overview]
Message-ID: <2026053046-bonanza-bobcat-6ed1@gregkh> (raw)
In-Reply-To: <20260528230616.186792-1-rosenp@gmail.com>

On Thu, May 28, 2026 at 04:06:16PM -0700, Rosen Penev wrote:
> Sashiko reported three pre-existing bugs in the mxs-auart driver:
> 
> - For non-ASM9260 variants, mxs_get_clks() obtained the clock but never
>   prepared/enabled it, leaving register accesses in probe at risk of
>   faulting if the bootloader had gated the clock.
> - The error path and remove function used pdev->id instead of
>   s->port.line to clear the auart_port[] slot.  For DT-probed devices
>   pdev->id is -1, causing an out-of-bounds write and leaving a dangling
>   pointer in the array.

This feels like it should be a different patch, and not burried in this
change, right?

> - The probe error path called iounmap() while the IRQ was still
>   registered. An interrupt during that window would dereference the
>   unmapped membase.
> 
> All of this is a consequence of using mixed devm and non devm. Instead
> of working around these issues, go full devm so that everything can be
> cleaned up properly.

Are you sure that devm and irq code is going to work properly?  That's
always a very tricky code path, was this tested with the hardware to
ensure it still works on teardown correctly?

thanks,

greg k-h


  reply	other threads:[~2026-05-30 10:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28 23:06 [PATCH] serial: mxs-auart: fix probe error paths and clock handling Rosen Penev
2026-05-30  5:21 ` Greg Kroah-Hartman [this message]
2026-05-30 19:33   ` 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=2026053046-bonanza-bobcat-6ed1@gregkh \
    --to=gregkh@linuxfoundation$(echo .)org \
    --cc=Frank.Li@nxp$(echo .)com \
    --cc=festevam@gmail$(echo .)com \
    --cc=imx@lists$(echo .)linux.dev \
    --cc=jirislaby@kernel$(echo .)org \
    --cc=kernel@pengutronix$(echo .)de \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-serial@vger$(echo .)kernel.org \
    --cc=rosenp@gmail$(echo .)com \
    --cc=s.hauer@pengutronix$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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