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

From: Rosen Penev

Date: Tue Jul 28 2026 - 18:10:49 EST


On Sun, Jul 19, 2026 at 8:58 AM Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> 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(), which 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 driver
> > > already reserved the region, so the non-overlapping reg requirement was
> > > already satisfied. Drop the now-unused linux/of_address.h include.
> > >
> > > Built for arm64 (defconfig + CONFIG_EDAC_FSL_DDR) with LLVM=1;
> > > drivers/edac/fsl_ddr_edac.o compiles cleanly.
> > >
> > > Assisted-by: opencode:hy3-free
> > > Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
> > > ---
> >
> > Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
>
> 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