[PATCH 0/3] soc: samsung: exynos-pmu: gs101: avoid SError for inaccessible registers

André Draszik posted 3 patches 2 months, 2 weeks ago
There is a newer version of this series
MAINTAINERS                                 |   1 +
drivers/soc/samsung/Makefile                |   3 +-
drivers/soc/samsung/exynos-pmu.c            | 136 +--------
drivers/soc/samsung/exynos-pmu.h            |  11 +
drivers/soc/samsung/gs101-pmu.c             | 445 ++++++++++++++++++++++++++++
include/linux/soc/samsung/exynos-regs-pmu.h | 343 ++++++++++++++++++++-
6 files changed, 797 insertions(+), 142 deletions(-)
[PATCH 0/3] soc: samsung: exynos-pmu: gs101: avoid SError for inaccessible registers
Posted by André Draszik 2 months, 2 weeks ago
Accessing non-existent PMU registers causes an SError, halting the
system and rendering it unuseable.

For gs101, we can avoid that by creating the underlying PMU regmap with
the read- and writable register ranges in place, because on gs101 this
driver controls creation of the regmap.

This series updates the Exynos PMU driver and gs101 in particular to do
just that. For gs101 this is easy, as the exynos-pmu driver creates a
regmap and we can update the regmap config to pass in the registers.
For other SoCs it's not as straight forward, as syscon_node_to_regmap()
is used which doesn't allow passing a custom regmap config - those SoCs
are out of scope for this series.

With this in place, invalid registers (by drivers, or even plain
debugfs), are now simply skipped by regmap, leaving the system useable
in that case.

Cheers,
Andre'

Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
André Draszik (3):
      soc: samsung: exynos-pmu: allow specifying read & write access tables for secure regmap
      soc: samsung: exynos-pmu: move some gs101 related code into new file
      soc: samsung: gs101-pmu: implement access tables for read and write

 MAINTAINERS                                 |   1 +
 drivers/soc/samsung/Makefile                |   3 +-
 drivers/soc/samsung/exynos-pmu.c            | 136 +--------
 drivers/soc/samsung/exynos-pmu.h            |  11 +
 drivers/soc/samsung/gs101-pmu.c             | 445 ++++++++++++++++++++++++++++
 include/linux/soc/samsung/exynos-regs-pmu.h | 343 ++++++++++++++++++++-
 6 files changed, 797 insertions(+), 142 deletions(-)
---
base-commit: 5eb97efbe6a375944984e7fb69bb632d2879c841
change-id: 20251001-gs101-pmu-regmap-tables-8726ac9f853e

Best regards,
-- 
André Draszik <andre.draszik@linaro.org>

Re: [PATCH 0/3] soc: samsung: exynos-pmu: gs101: avoid SError for inaccessible registers
Posted by Sam Protsenko 2 months, 2 weeks ago
Hi Andre,

On Thu, Oct 2, 2025 at 5:33 AM André Draszik <andre.draszik@linaro.org> wrote:
>
> Accessing non-existent PMU registers causes an SError, halting the
> system and rendering it unuseable.
>

I wonder if this issue you describe here is similar to what I'm seeing
on E850-96. When I'm trying to read these files

    /sys/kernel/debug/regmap/dummy-syscon@0x0000000010020000/registers
    /sys/kernel/debug/regmap/dummy-chipid@0x0000000010000000/registers
    /sys/kernel/debug/regmap/dummy-system-controller@0x0000000011860000/registers

I'm seeing "synchronous external abort" during regmap operations
(judging from the backtrace). Do you think this series fixes the same
issue on gs101? If so, I'd probably want to adapt it for Exynos850
later.

> For gs101, we can avoid that by creating the underlying PMU regmap with
> the read- and writable register ranges in place, because on gs101 this
> driver controls creation of the regmap.
>
> This series updates the Exynos PMU driver and gs101 in particular to do
> just that. For gs101 this is easy, as the exynos-pmu driver creates a
> regmap and we can update the regmap config to pass in the registers.
> For other SoCs it's not as straight forward, as syscon_node_to_regmap()
> is used which doesn't allow passing a custom regmap config - those SoCs
> are out of scope for this series.
>
> With this in place, invalid registers (by drivers, or even plain
> debugfs), are now simply skipped by regmap, leaving the system useable
> in that case.
>
> Cheers,
> Andre'
>
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---
> André Draszik (3):
>       soc: samsung: exynos-pmu: allow specifying read & write access tables for secure regmap
>       soc: samsung: exynos-pmu: move some gs101 related code into new file
>       soc: samsung: gs101-pmu: implement access tables for read and write
>
>  MAINTAINERS                                 |   1 +
>  drivers/soc/samsung/Makefile                |   3 +-
>  drivers/soc/samsung/exynos-pmu.c            | 136 +--------
>  drivers/soc/samsung/exynos-pmu.h            |  11 +
>  drivers/soc/samsung/gs101-pmu.c             | 445 ++++++++++++++++++++++++++++
>  include/linux/soc/samsung/exynos-regs-pmu.h | 343 ++++++++++++++++++++-
>  6 files changed, 797 insertions(+), 142 deletions(-)
> ---
> base-commit: 5eb97efbe6a375944984e7fb69bb632d2879c841
> change-id: 20251001-gs101-pmu-regmap-tables-8726ac9f853e
>
> Best regards,
> --
> André Draszik <andre.draszik@linaro.org>
>
>
Re: [PATCH 0/3] soc: samsung: exynos-pmu: gs101: avoid SError for inaccessible registers
Posted by André Draszik 2 months, 1 week ago
Hi Sam,

On Fri, 2025-10-03 at 11:59 -0500, Sam Protsenko wrote:
> Hi Andre,
> 
> On Thu, Oct 2, 2025 at 5:33 AM André Draszik <andre.draszik@linaro.org> wrote:
> > 
> > Accessing non-existent PMU registers causes an SError, halting the
> > system and rendering it unuseable.
> > 
> 
> I wonder if this issue you describe here is similar to what I'm seeing
> on E850-96. When I'm trying to read these files
> 
>     /sys/kernel/debug/regmap/dummy-syscon@0x0000000010020000/registers
>     /sys/kernel/debug/regmap/dummy-chipid@0x0000000010000000/registers
>     /sys/kernel/debug/regmap/dummy-system-controller@0x0000000011860000/registers
> 
> I'm seeing "synchronous external abort" during regmap operations
> (judging from the backtrace). Do you think this series fixes the same
> issue on gs101?

Yes, but for the system controller (PMU) only.

On E850, it appears to be the same and there are many holes in the PMU memory
range. You can confirm using debugfs by manually skipping invalid ones, e.g.

dd if=/sys/kernel/debug/regmap/dummy-system-controller@0x0000000011860000/registers \
   ibs=15 count=1 \
   skip=$(( 0x28 / 4 ))

should give you register 0x28 without SError.

while

dd if=/sys/kernel/debug/regmap/dummy-system-controller@0x0000000011860000/registers \
   ibs=15 count=1 \
   skip=$(( 0x4 / 4 ))

should crash.

>  If so, I'd probably want to adapt it for Exynos850
> later.

+1. Note though that a custom regmap is used on gs101 for the PMU in the first place.


Cheers,
Andre'


> 
Re: [PATCH 0/3] soc: samsung: exynos-pmu: gs101: avoid SError for inaccessible registers
Posted by Sam Protsenko 2 months, 1 week ago
On Mon, Oct 6, 2025 at 1:36 AM André Draszik <andre.draszik@linaro.org> wrote:
>
> Hi Sam,
>
> On Fri, 2025-10-03 at 11:59 -0500, Sam Protsenko wrote:
> > Hi Andre,
> >
> > On Thu, Oct 2, 2025 at 5:33 AM André Draszik <andre.draszik@linaro.org> wrote:
> > >
> > > Accessing non-existent PMU registers causes an SError, halting the
> > > system and rendering it unuseable.
> > >
> >
> > I wonder if this issue you describe here is similar to what I'm seeing
> > on E850-96. When I'm trying to read these files
> >
> >     /sys/kernel/debug/regmap/dummy-syscon@0x0000000010020000/registers
> >     /sys/kernel/debug/regmap/dummy-chipid@0x0000000010000000/registers
> >     /sys/kernel/debug/regmap/dummy-system-controller@0x0000000011860000/registers
> >
> > I'm seeing "synchronous external abort" during regmap operations
> > (judging from the backtrace). Do you think this series fixes the same
> > issue on gs101?
>
> Yes, but for the system controller (PMU) only.
>
> On E850, it appears to be the same and there are many holes in the PMU memory
> range. You can confirm using debugfs by manually skipping invalid ones, e.g.
>
> dd if=/sys/kernel/debug/regmap/dummy-system-controller@0x0000000011860000/registers \
>    ibs=15 count=1 \
>    skip=$(( 0x28 / 4 ))
>
> should give you register 0x28 without SError.
>
> while
>
> dd if=/sys/kernel/debug/regmap/dummy-system-controller@0x0000000011860000/registers \
>    ibs=15 count=1 \
>    skip=$(( 0x4 / 4 ))
>
> should crash.
>

Thanks for the details! Guess I'll wait for your series to be merged first :)

> >  If so, I'd probably want to adapt it for Exynos850
> > later.
>
> +1. Note though that a custom regmap is used on gs101 for the PMU in the first place.
>
>
> Cheers,
> Andre'
>
>
> >