Re: [PATCH] soc: renesas: rz-sysc: Populate readable_reg/writeable_reg in regmap config

From: Geert Uytterhoeven
Date: Thu Sep 25 2025 - 09:47:24 EST


Hi Claudiu,

On Wed, 24 Sept 2025 at 17:45, Claudiu Beznea <claudiu.beznea@xxxxxxxxx> wrote:
> On 9/24/25 16:44, Geert Uytterhoeven wrote:
> > On Mon, 22 Sept 2025 at 09:41, Claudiu <claudiu.beznea@xxxxxxxxx> wrote:
> >> From: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>
> >>
> >> Not all system controller registers are accessible from Linux. Accessing
> >> such registers generates synchronous external abort. Populate the
> >> readable_reg and writeable_reg members of the regmap config to inform the
> >> regmap core which registers can be accessed. The list will need to be
> >> updated whenever new system controller functionality is exported through
> >> regmap.
> >>
> >> Fixes: 2da2740fb9c8 ("soc: renesas: rz-sysc: Add syscon/regmap support")
> >> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>
> >
> > Thanks for your patch!
> >
> > How can this be triggered?
>
> I found this issue by reading the exported regmap debug file:
>
> cat /sys/kernel/debug/regmap/11020000.system-controller-rz_sysc_regs/registers

Thank you, that was exactly what I was looking for!

> > AFAIU, registers are only accessed as
> > obtained from syscon_regmap_lookup_by_phandle_args(), i.e. based on the
> > register offset stored in the DTB. If the offset in the DTB is wrong,
> > there is not much we can do ("garbage in, garbage out"), and the DTB
> > should be fixed instead.
> >
> > Is there another way the user can access these non-existing registers?
> > Thanks!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds