linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: syscon: Fix syscon name for device tree
@ 2019-01-08  0:05 Tony Lindgren
  2019-01-08  0:15 ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Lindgren @ 2019-01-08  0:05 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, linux-omap, Jeffy Chen

I'm now seeing the following error on omap5 during boot:

(NULL device *): Failed to create dummy-scm_conf@0 debugfs directory

This is because we have two separate scm_conf syscon regions in the
dts. Let's fix the issue by setting a proper name if syscon is
configured via device tree.

See also related fix for commit 500f9ff518cf ("mfd: syscon: Set name
of regmap_config").

Cc: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/mfd/syscon.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -241,6 +241,8 @@ static int syscon_probe(struct platform_device *pdev)
 	syscon_config.max_register = res->end - res->start - 3;
 	if (pdata)
 		syscon_config.name = pdata->label;
+	else
+		syscon_config.name = dev_name(dev);
 	syscon->regmap = devm_regmap_init_mmio(dev, base, &syscon_config);
 	if (IS_ERR(syscon->regmap)) {
 		dev_err(dev, "regmap init failed\n");
-- 
2.20.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mfd: syscon: Fix syscon name for device tree
  2019-01-08  0:05 [PATCH] mfd: syscon: Fix syscon name for device tree Tony Lindgren
@ 2019-01-08  0:15 ` Tony Lindgren
  2019-01-08  3:16   ` JeffyChen
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Lindgren @ 2019-01-08  0:15 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, linux-omap, Jeffy Chen

* Tony Lindgren <tony@atomide.com> [190108 00:06]:
> I'm now seeing the following error on omap5 during boot:
> 
> (NULL device *): Failed to create dummy-scm_conf@0 debugfs directory
> 
> This is because we have two separate scm_conf syscon regions in the
> dts. Let's fix the issue by setting a proper name if syscon is
> configured via device tree.
> 
> See also related fix for commit 500f9ff518cf ("mfd: syscon: Set name
> of regmap_config").
> 
> Cc: Jeffy Chen <jeffy.chen@rock-chips.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  drivers/mfd/syscon.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
> --- a/drivers/mfd/syscon.c
> +++ b/drivers/mfd/syscon.c
> @@ -241,6 +241,8 @@ static int syscon_probe(struct platform_device *pdev)
>  	syscon_config.max_register = res->end - res->start - 3;
>  	if (pdata)
>  		syscon_config.name = pdata->label;
> +	else
> +		syscon_config.name = dev_name(dev);
>  	syscon->regmap = devm_regmap_init_mmio(dev, base, &syscon_config);
>  	if (IS_ERR(syscon->regmap)) {
>  		dev_err(dev, "regmap init failed\n");

Hmm this fixes the error, but I'm still seeing only one
entry for /sys/kernel/debug/regmap/dummy-scm_conf@0.

Anybody got better ideas for setting the default name,
maybe dev->of_node->name if it exists?

Regards,

Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mfd: syscon: Fix syscon name for device tree
  2019-01-08  0:15 ` Tony Lindgren
@ 2019-01-08  3:16   ` JeffyChen
  2019-01-08 15:38     ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: JeffyChen @ 2019-01-08  3:16 UTC (permalink / raw)
  To: Tony Lindgren, Lee Jones; +Cc: linux-kernel, linux-omap

Hi Tony,

On 01/08/2019 08:15 AM, Tony Lindgren wrote:
> * Tony Lindgren <tony@atomide.com> [190108 00:06]:
>> I'm now seeing the following error on omap5 during boot:
>>
>> (NULL device *): Failed to create dummy-scm_conf@0 debugfs directory
This log means failed to init regmap debugfs with device(NULL) and 
name("scm_conf@0"), which likely to be called from of_syscon_register() 
with np fullname("scm_conf@0").

So my guess would be there're more than one syscon dts nodes named 
"scm_conf@0".


For omap5 and scm_conf@0, should be these 2:
https://elixir.bootlin.com/linux/latest/source/arch/arm/boot/dts/omap5.dtsi#L167
				scm_conf: scm_conf@0 {
					compatible = "syscon";

https://elixir.bootlin.com/linux/latest/source/arch/arm/boot/dts/omap5.dtsi#L313
				scm_wkup_pad_conf: scm_conf@0 {
					compatible = "syscon", "simple-bus";

Maybe try to rename one of them(for example, rename the second one to 
"scm_wkup_pad_conf@0").



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mfd: syscon: Fix syscon name for device tree
  2019-01-08  3:16   ` JeffyChen
@ 2019-01-08 15:38     ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2019-01-08 15:38 UTC (permalink / raw)
  To: JeffyChen; +Cc: Lee Jones, linux-kernel, linux-omap

* JeffyChen <jeffy.chen@rock-chips.com> [190108 03:17]:
> Hi Tony,
> 
> On 01/08/2019 08:15 AM, Tony Lindgren wrote:
> > * Tony Lindgren <tony@atomide.com> [190108 00:06]:
> > > I'm now seeing the following error on omap5 during boot:
> > > 
> > > (NULL device *): Failed to create dummy-scm_conf@0 debugfs directory
> This log means failed to init regmap debugfs with device(NULL) and
> name("scm_conf@0"), which likely to be called from of_syscon_register() with
> np fullname("scm_conf@0").
> 
> So my guess would be there're more than one syscon dts nodes named
> "scm_conf@0".

Yup.

> For omap5 and scm_conf@0, should be these 2:
> https://elixir.bootlin.com/linux/latest/source/arch/arm/boot/dts/omap5.dtsi#L167
> 				scm_conf: scm_conf@0 {
> 					compatible = "syscon";
> 
> https://elixir.bootlin.com/linux/latest/source/arch/arm/boot/dts/omap5.dtsi#L313
> 				scm_wkup_pad_conf: scm_conf@0 {
> 					compatible = "syscon", "simple-bus";

Yes those are the one.

> Maybe try to rename one of them(for example, rename the second one to
> "scm_wkup_pad_conf@0").

Well the thing is that any valid node name should work here
just like it does for devices. In this case the syscon
instances are on separate inteconnect instances. So it seems
that we should do something similar to what we already do in
of_device_make_bus_id().

BTW, I was trying to patch the wrong function :) The right
function to fix is of_syscon_register() for the dts case.

Regards,

Tony


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-08 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-08  0:05 [PATCH] mfd: syscon: Fix syscon name for device tree Tony Lindgren
2019-01-08  0:15 ` Tony Lindgren
2019-01-08  3:16   ` JeffyChen
2019-01-08 15:38     ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).