[PATCH 0/4] Add tooling to disable debugfs on OMAP based systems

Richard Weinberger posted 4 patches 2 days, 7 hours ago
.../devicetree/bindings/common-properties.txt        | 12 ++++++++++++
arch/arm/boot/dts/ti/omap/dra7-l4.dtsi               |  4 ++++
arch/arm/boot/dts/ti/omap/dra7.dtsi                  |  1 +
arch/arm/boot/dts/ti/omap/dra74x.dtsi                |  1 +
drivers/base/regmap/regmap.c                         |  2 ++
drivers/mfd/syscon.c                                 | 10 ++++++++++
include/linux/regmap.h                               |  3 +++
7 files changed, 33 insertions(+)
[PATCH 0/4] Add tooling to disable debugfs on OMAP based systems
Posted by Richard Weinberger 2 days, 7 hours ago
It came to my attention that commands such as `grep -r / -e ...` can cause
crashes on an AM572x based system.
An investigation found that reading from various files in /sys/kernel/debug/regmap
causes imprecise async data aborts.

One of these register maps is the CTRL_MODULE_CORE register map at 0x4A002000.
It contains various registers marked as reserved, but the manual indicates
that read access is still allowed.
On said system, reading from most registers seems to work, but for some
an async data abort happens. So it's not entirely clear what registers are safe
and which are not.

So, add tooling to allow disabling debugfs access to such dangerous registers.
Splitting the register map definitions in the device tree seemed less practical to
me since it would unnecessarily make the device trees more complicated.

Richard Weinberger (4):
  dt-bindings: Document new common property: has-inaccessible-regs
  regmap: Allow disabling debugfs via regmap_config
  syscon: Wire up has-inaccessible-regs
  arm: dts: omap: Mark various register maps as dangerous

 .../devicetree/bindings/common-properties.txt        | 12 ++++++++++++
 arch/arm/boot/dts/ti/omap/dra7-l4.dtsi               |  4 ++++
 arch/arm/boot/dts/ti/omap/dra7.dtsi                  |  1 +
 arch/arm/boot/dts/ti/omap/dra74x.dtsi                |  1 +
 drivers/base/regmap/regmap.c                         |  2 ++
 drivers/mfd/syscon.c                                 | 10 ++++++++++
 include/linux/regmap.h                               |  3 +++
 7 files changed, 33 insertions(+)

-- 
2.51.0
Re: [PATCH 0/4] Add tooling to disable debugfs on OMAP based systems
Posted by Rob Herring 9 hours ago
On Sat, 29 Nov 2025 15:20:38 +0100, Richard Weinberger wrote:
> It came to my attention that commands such as `grep -r / -e ...` can cause
> crashes on an AM572x based system.
> An investigation found that reading from various files in /sys/kernel/debug/regmap
> causes imprecise async data aborts.
> 
> One of these register maps is the CTRL_MODULE_CORE register map at 0x4A002000.
> It contains various registers marked as reserved, but the manual indicates
> that read access is still allowed.
> On said system, reading from most registers seems to work, but for some
> an async data abort happens. So it's not entirely clear what registers are safe
> and which are not.
> 
> So, add tooling to allow disabling debugfs access to such dangerous registers.
> Splitting the register map definitions in the device tree seemed less practical to
> me since it would unnecessarily make the device trees more complicated.
> 
> Richard Weinberger (4):
>   dt-bindings: Document new common property: has-inaccessible-regs
>   regmap: Allow disabling debugfs via regmap_config
>   syscon: Wire up has-inaccessible-regs
>   arm: dts: omap: Mark various register maps as dangerous
> 
>  .../devicetree/bindings/common-properties.txt        | 12 ++++++++++++
>  arch/arm/boot/dts/ti/omap/dra7-l4.dtsi               |  4 ++++
>  arch/arm/boot/dts/ti/omap/dra7.dtsi                  |  1 +
>  arch/arm/boot/dts/ti/omap/dra74x.dtsi                |  1 +
>  drivers/base/regmap/regmap.c                         |  2 ++
>  drivers/mfd/syscon.c                                 | 10 ++++++++++
>  include/linux/regmap.h                               |  3 +++
>  7 files changed, 33 insertions(+)
> 
> --
> 2.51.0
> 
> 
> 


My bot found new DTB warnings on the .dts files added or changed in this
series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:

  pip3 install dtschema --upgrade


This patch series was applied (using b4) to base:
 Base: attempting to guess base-commit...
 Base: tags/v6.18-rc7-1539-gff736a286116 (exact match)
 Base: tags/v6.18-rc7-1539-gff736a286116 (use --merge-base to override)

If this is not the correct base, please add 'base-commit' tag
(or use b4 which does this automatically)

New warnings running 'make CHECK_DTBS=y for arch/arm/boot/dts/ti/' for 20251129142042.344359-1-richard@nod.at:

arch/arm/boot/dts/ti/omap/am571x-idk.dtb: clock@400 (ti,omap4-cm): '#clock-cells' is a dependency of 'clock-output-names'
	from schema $id: http://devicetree.org/schemas/clock/clock.yaml
arch/arm/boot/dts/ti/omap/am57xx-beagle-x15.dtb: clock@c00 (ti,omap4-cm): '#clock-cells' is a dependency of 'clock-output-names'
	from schema $id: http://devicetree.org/schemas/clock/clock.yaml
arch/arm/boot/dts/ti/omap/am57xx-beagle-x15-revc.dtb: clock@500 (ti,omap4-cm): '#clock-cells' is a dependency of 'clock-output-names'
	from schema $id: http://devicetree.org/schemas/clock/clock.yaml
Re: [PATCH 0/4] Add tooling to disable debugfs on OMAP based systems
Posted by Andreas Kemnade 2 days, 7 hours ago
On Sat, 29 Nov 2025 15:20:38 +0100
Richard Weinberger <richard@nod.at> wrote:

> It came to my attention that commands such as `grep -r / -e ...` can cause
> crashes on an AM572x based system.
> An investigation found that reading from various files in /sys/kernel/debug/regmap
> causes imprecise async data aborts.
> 
> One of these register maps is the CTRL_MODULE_CORE register map at 0x4A002000.
> It contains various registers marked as reserved, but the manual indicates
> that read access is still allowed.
> On said system, reading from most registers seems to work, but for some
> an async data abort happens. So it's not entirely clear what registers are safe
> and which are not.
> 
it is usually not about individual registers, but about accessing 
unpowered devices/modules,

so it is probably more the logic like:

if (pm_runtime_is_suspended(regmap->device))
	-EACCESS;

Try to play around with on >power/control in sysfs.

> So, add tooling to allow disabling debugfs access to such dangerous registers.
> Splitting the register map definitions in the device tree seemed less practical to
> me since it would unnecessarily make the device trees more complicated.
> 
So is it really a description of the hardware? Maybe there are some special
cases, too.

Regards,
Andreas
Re: [PATCH 0/4] Add tooling to disable debugfs on OMAP based systems
Posted by Mark Brown 9 hours ago
On Sat, Nov 29, 2025 at 03:36:44PM +0100, Andreas Kemnade wrote:

> it is usually not about individual registers, but about accessing 
> unpowered devices/modules,

If that's the case the regmap should be in cache only mode while the
device is unpowered.
Re: [PATCH 0/4] Add tooling to disable debugfs on OMAP based systems
Posted by Richard Weinberger 2 days, 6 hours ago
----- Ursprüngliche Mail -----
> Von: "Andreas Kemnade" <andreas@kemnade.info>
> it is usually not about individual registers, but about accessing
> unpowered devices/modules,
> 
> so it is probably more the logic like:
> 
> if (pm_runtime_is_suspended(regmap->device))
>	-EACCESS;
> 
> Try to play around with on >power/control in sysfs.

Well the that regmap is owned by the syscon mfd.
And in case of CTRL_MODULE_CORE only accessing some reserved registers causes
an abort.

For registers like dsp_system@40d00000 it's maybe indeed due to an unpowered module.
I'll double check that.
 
>> So, add tooling to allow disabling debugfs access to such dangerous registers.
>> Splitting the register map definitions in the device tree seemed less practical
>> to
>> me since it would unnecessarily make the device trees more complicated.
>> 
> So is it really a description of the hardware? Maybe there are some special
> cases, too.

IMHO, "There are problematic registers, don't blindly mess with them" is a description of the hardware.

Thanks,
//richard