Re: [PATCH] EDAC: fsl_ddr: use devm_platform_ioremap_resource()

Rosen Penev <[email protected]> Tue, 28 Jul 2026 15:08:25 -0700
Newsgroups org.kernel.vger.linux-edac,dev.linux.lists.imx,dev.linux.lists.llvm,org.kernel.vger.linux-kernel
Message-ID <CAKxU2N-vMNR+ES2YYuJh+6XASmZ04cnFodb4kP4zRBW0mbEKaw@mail.gmail.com>
On Sun, Jul 19, 2026 at 8:58=E2=80=AFAM Borislav Petkov <[email protected]> wrot=
e:
>
> On Wed, Jul 15, 2026 at 11:00:50PM -0500, Frank Li wrote:
> > On Tue, Jul 14, 2026 at 04:46:09PM -0700, Rosen Penev wrote:
> > > Replace the open-coded of_address_to_resource() plus devm_request_mem=
_region()
> > > and devm_ioremap() sequence with devm_platform_ioremap_resource(), wh=
ich folds
> > > the resource lookup, region reservation and mapping into one step and=
 returns
> > > an ERR_PTR checked with IS_ERR()/PTR_ERR().
> > >
> > > Behaviorally equivalent with respect to region reservation: the drive=
r
> > > already reserved the region, so the non-overlapping reg requirement w=
as
> > > already satisfied. Drop the now-unused linux/of_address.h include.
> > >
> > > Built for arm64 (defconfig + CONFIG_EDAC_FSL_DDR) with LLVM=3D1;
> > > drivers/edac/fsl_ddr_edac.o compiles cleanly.
> > >
> > > Assisted-by: opencode:hy3-free
> > > Signed-off-by: Rosen Penev <[email protected]>
> > > ---
> >
> > Reviewed-by: Frank Li <[email protected]>
>
> Sashiko caught a bunch of preexisting issues:
>
> https://sashiko.dev/#/patchset/20260714234609.902367-1-rosenp%40gmail.com
>
> Let's fix them first please.
The unfortunate part of that is sashiko does not understand v2 patches
and whatnot. Meaning it will always complain about things fixed in
other patches.

There's no practical way to move forward unless done piece by piece.

As an example fixing the first issue causes
 [High] Calling `ddr_out32()` in the `err` cleanup path
unconditionally dereferences unmapped I/O memory pointers if probe
fails early, leading to a kernel crash.

because these functions are split into three.

>
> --
> Regards/Gruss,
>     Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette