On 29/11/2025 15:20, Richard Weinberger wrote:
> Evaluate the has-inaccessible-regs device tree property to disable
> debugfs access if a register map contains dangerous/harmful registers.
>
> Signed-off-by: Richard Weinberger <richard@nod.at>
> ---
> drivers/mfd/syscon.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
> index ae71a2710bed8..73fff0df3f42f 100644
> --- a/drivers/mfd/syscon.c
> +++ b/drivers/mfd/syscon.c
> @@ -70,6 +70,16 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res)
> else if (of_property_read_bool(np, "native-endian"))
> syscon_config.val_format_endian = REGMAP_ENDIAN_NATIVE;
>
> +
> + /*
> + * Disable debugfs access if a register map has various inaccessible
> + * registers.
> + * In such a case the device driver has to know exactly how and when
> + * access is allowed but general access via userspace can cause harm.
> + */
> + if (of_property_read_bool(np, "has-inaccessible-regs"))
> + syscon_config.debugfs_disable = true;
So you mark ENTIRE device like that? Then you don't need the property.
Your compatible already tells you that (IOW, this is fully deducible
from the compatible).
Best regards,
Krzysztof