[PATCH] gpio: mvebu: name regmaps to fix debugfs collisions

Rosen Penev posted 1 patch 3 weeks ago
drivers/gpio/gpio-mvebu.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
[PATCH] gpio: mvebu: name regmaps to fix debugfs collisions
Posted by Rosen Penev 3 weeks ago
Each marvell,armada-370-gpio node provides both 'gpio' and 'pwm'
register windows, and the driver creates one regmap per window on the
same platform device.  The shared regmap_config was unnamed, so both
maps defaulted their debugfs directory to dev_name(), e.g.

  debugfs: 'f1018100.gpio' already exists in 'regmap'

because the PWM regmap (and on Armada XP the per-CPU regmap) claimed
the same directory as the GPIO regmap.

Give each regmap a distinct .name so the debugfs directories become
'<dev>.gpio', '<dev>.percpu' and '<dev>.pwm'.  This only affects
debugfs naming; register access is unchanged.

Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/gpio/gpio-mvebu.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 93b8a08b04b9..c57758019e92 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -599,6 +599,21 @@ static void mvebu_gpio_irq_handler(struct irq_desc *desc)
 }
 
 static const struct regmap_config mvebu_gpio_regmap_config = {
+	.name = "gpio",
+	.reg_bits = 32,
+	.reg_stride = 4,
+	.val_bits = 32,
+};
+
+static const struct regmap_config mvebu_gpio_percpu_regmap_config = {
+	.name = "percpu",
+	.reg_bits = 32,
+	.reg_stride = 4,
+	.val_bits = 32,
+};
+
+static const struct regmap_config mvebu_pwm_regmap_config = {
+	.name = "pwm",
 	.reg_bits = 32,
 	.reg_stride = 4,
 	.val_bits = 32,
@@ -868,7 +883,7 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
 			return PTR_ERR(base);
 
 		mvpwm->regs = devm_regmap_init_mmio(&pdev->dev, base,
-						    &mvebu_gpio_regmap_config);
+						    &mvebu_pwm_regmap_config);
 		if (IS_ERR(mvpwm->regs))
 			return PTR_ERR(mvpwm->regs);
 
@@ -1114,7 +1129,7 @@ static int mvebu_gpio_probe_raw(struct platform_device *pdev,
 
 		mvchip->percpu_regs =
 			devm_regmap_init_mmio(&pdev->dev, base,
-					      &mvebu_gpio_regmap_config);
+					      &mvebu_gpio_percpu_regmap_config);
 		if (IS_ERR(mvchip->percpu_regs))
 			return PTR_ERR(mvchip->percpu_regs);
 	}
-- 
2.55.0
Re: [PATCH] gpio: mvebu: name regmaps to fix debugfs collisions
Posted by Bartosz Golaszewski 2 weeks, 4 days ago
On Fri, 04 Sep 2026 17:43:34 -0700, Rosen Penev wrote:
> Each marvell,armada-370-gpio node provides both 'gpio' and 'pwm'
> register windows, and the driver creates one regmap per window on the
> same platform device.  The shared regmap_config was unnamed, so both
> maps defaulted their debugfs directory to dev_name(), e.g.
> 
>   debugfs: 'f1018100.gpio' already exists in 'regmap'
> 
> [...]

Applied, thanks!

[1/1] gpio: mvebu: name regmaps to fix debugfs collisions
      https://git.kernel.org/brgl/c/4d305c2273123119c27d6e4c822215e650c451e3

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Re: [PATCH] gpio: mvebu: name regmaps to fix debugfs collisions
Posted by Linus Walleij 2 weeks, 6 days ago
On Sat, Sep 5, 2026 at 2:43 AM Rosen Penev <rosenp@gmail.com> wrote:

> Each marvell,armada-370-gpio node provides both 'gpio' and 'pwm'
> register windows, and the driver creates one regmap per window on the
> same platform device.  The shared regmap_config was unnamed, so both
> maps defaulted their debugfs directory to dev_name(), e.g.
>
>   debugfs: 'f1018100.gpio' already exists in 'regmap'
>
> because the PWM regmap (and on Armada XP the per-CPU regmap) claimed
> the same directory as the GPIO regmap.
>
> Give each regmap a distinct .name so the debugfs directories become
> '<dev>.gpio', '<dev>.percpu' and '<dev>.pwm'.  This only affects
> debugfs naming; register access is unchanged.
>
> Assisted-by: opencode:big-pickle
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

Makes sense.
Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij