linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fw_devlink.strict=1 breaks sound card probe ?
@ 2022-08-24  3:13 Kuninori Morimoto
  2022-08-24  9:37 ` Laurent Pinchart
  0 siblings, 1 reply; 7+ messages in thread
From: Kuninori Morimoto @ 2022-08-24  3:13 UTC (permalink / raw)
  To: Linux-Renesas
  Cc: Saravana Kannan, Greg KH, Laurent, Geert Uytterhoeven, Rafael J. Wysocki


Hi Renesas-ML
Cc Saravana, Greg, Laurent, Geert

I'm now testing v6.0.0-rc2 kernel on ULCB-KF board, and I noticed
it doesn't probe sound card.
I git-bisected and noticed that this patch breaks sound probe.

	commit 71066545b48e4259f89481199a0bbc7c35457738
	("driver core: Set fw_devlink.strict=1 by default")

I could re-probe sound card if I reverted it.
(My .config is using Y for all drivers)

I'm not well understanding about this patch,
but it seems it is related to deferred probe.

My sound card needs many drivers to probe.

	HDMI
	Sound CPU
	Sound Codec x 2 (depends on I2C)
	Sound Card

To probe "Sound Card", it needs other necessary drivers.
But it seems some necessary drivers are not probed by above patch.
In my quick check, "HDMI" and 1 of "Sound Codec" drivers are not probed.

How can I solve this issue, or where I can check ?

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Re: fw_devlink.strict=1 breaks sound card probe ?
  2022-08-24  3:13 fw_devlink.strict=1 breaks sound card probe ? Kuninori Morimoto
@ 2022-08-24  9:37 ` Laurent Pinchart
  2022-08-24 18:40   ` Saravana Kannan
  0 siblings, 1 reply; 7+ messages in thread
From: Laurent Pinchart @ 2022-08-24  9:37 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Linux-Renesas, Saravana Kannan, Greg KH, Geert Uytterhoeven,
	Rafael J. Wysocki

Hi Morimoto-san,

On Wed, Aug 24, 2022 at 03:13:04AM +0000, Kuninori Morimoto wrote:
> 
> Hi Renesas-ML
> Cc Saravana, Greg, Laurent, Geert
> 
> I'm now testing v6.0.0-rc2 kernel on ULCB-KF board, and I noticed
> it doesn't probe sound card.
> I git-bisected and noticed that this patch breaks sound probe.
> 
> 	commit 71066545b48e4259f89481199a0bbc7c35457738
> 	("driver core: Set fw_devlink.strict=1 by default")
> 
> I could re-probe sound card if I reverted it.
> (My .config is using Y for all drivers)
> 
> I'm not well understanding about this patch,
> but it seems it is related to deferred probe.
> 
> My sound card needs many drivers to probe.
> 
> 	HDMI
> 	Sound CPU
> 	Sound Codec x 2 (depends on I2C)
> 	Sound Card
> 
> To probe "Sound Card", it needs other necessary drivers.
> But it seems some necessary drivers are not probed by above patch.
> In my quick check, "HDMI" and 1 of "Sound Codec" drivers are not probed.
> 
> How can I solve this issue, or where I can check ?

Saravana is more familiar with devlink than I am, so he may be able to
diagnose that without further information, but otherwise it would be
helpful if you could provide some logs. Enabling the debug messages in
drivers/base/dd.c can provide some insight. The contents of the debugfs
devices_deferred file can also be useful, as well as the
consumer/supplier links in sysfs for all the devices involved with the
sound card.

-- 
Regards,

Laurent Pinchart

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

* Re: fw_devlink.strict=1 breaks sound card probe ?
  2022-08-24  9:37 ` Laurent Pinchart
@ 2022-08-24 18:40   ` Saravana Kannan
  2022-08-25  1:11     ` Kuninori Morimoto
  0 siblings, 1 reply; 7+ messages in thread
From: Saravana Kannan @ 2022-08-24 18:40 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Kuninori Morimoto, Linux-Renesas, Greg KH, Geert Uytterhoeven,
	Rafael J. Wysocki

On Wed, Aug 24, 2022 at 2:37 AM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Morimoto-san,
>
> On Wed, Aug 24, 2022 at 03:13:04AM +0000, Kuninori Morimoto wrote:
> >
> > Hi Renesas-ML
> > Cc Saravana, Greg, Laurent, Geert
> >
> > I'm now testing v6.0.0-rc2 kernel on ULCB-KF board, and I noticed
> > it doesn't probe sound card.
> > I git-bisected and noticed that this patch breaks sound probe.
> >
> >       commit 71066545b48e4259f89481199a0bbc7c35457738
> >       ("driver core: Set fw_devlink.strict=1 by default")
> >
> > I could re-probe sound card if I reverted it.
> > (My .config is using Y for all drivers)
> >
> > I'm not well understanding about this patch,
> > but it seems it is related to deferred probe.
> >
> > My sound card needs many drivers to probe.
> >
> >       HDMI
> >       Sound CPU
> >       Sound Codec x 2 (depends on I2C)
> >       Sound Card
> >
> > To probe "Sound Card", it needs other necessary drivers.
> > But it seems some necessary drivers are not probed by above patch.
> > In my quick check, "HDMI" and 1 of "Sound Codec" drivers are not probed.
> >
> > How can I solve this issue, or where I can check ?
>
> Saravana is more familiar with devlink than I am, so he may be able to
> diagnose that without further information, but otherwise it would be
> helpful if you could provide some logs. Enabling the debug messages in
> drivers/base/dd.c can provide some insight. The contents of the debugfs
> devices_deferred file can also be useful, as well as the
> consumer/supplier links in sysfs for all the devices involved with the
> sound card.

Thanks Laurent!

Kuninori, Those are exactly the things I'd need. And a pointer to the
dts (not DTSI) file that corresponds to the board.

Also, (I don't think it'll help but might give info for debugging),
try booting with deferred_probe_timeout=0 and
deferred_probe_timeout=1.

-Saravana

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

* Re: fw_devlink.strict=1 breaks sound card probe ?
  2022-08-24 18:40   ` Saravana Kannan
@ 2022-08-25  1:11     ` Kuninori Morimoto
  2022-08-25  6:42       ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Kuninori Morimoto @ 2022-08-25  1:11 UTC (permalink / raw)
  To: Saravana Kannan
  Cc: Laurent Pinchart, Linux-Renesas, Greg KH, Geert Uytterhoeven,
	Rafael J. Wysocki


Hi Laurent, Saravana

Thank you for your help !!

> > > To probe "Sound Card", it needs other necessary drivers.
> > > But it seems some necessary drivers are not probed by above patch.
> > > In my quick check, "HDMI" and 1 of "Sound Codec" drivers are not probed.
(snip)
> > Saravana is more familiar with devlink than I am, so he may be able to
> > diagnose that without further information, but otherwise it would be
> > helpful if you could provide some logs. Enabling the debug messages in
> > drivers/base/dd.c can provide some insight. The contents of the debugfs
> > devices_deferred file can also be useful, as well as the
> > consumer/supplier links in sysfs for all the devices involved with the
> > sound card.

Thanks !

This devices_deferred file (which I didn't know) helped my issue.
It was my fault. My .config had been missing necessary driver
(= CONFIG_REGULATOR_FIXED_VOLTAGE).

... but... why it had been working without it before... ?

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Re: fw_devlink.strict=1 breaks sound card probe ?
  2022-08-25  1:11     ` Kuninori Morimoto
@ 2022-08-25  6:42       ` Geert Uytterhoeven
  2022-08-25 17:09         ` Saravana Kannan
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2022-08-25  6:42 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Saravana Kannan, Laurent Pinchart, Linux-Renesas, Greg KH,
	Geert Uytterhoeven, Rafael J. Wysocki

Hi Morimoto-san,

On Thu, Aug 25, 2022 at 3:11 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> > > > To probe "Sound Card", it needs other necessary drivers.
> > > > But it seems some necessary drivers are not probed by above patch.
> > > > In my quick check, "HDMI" and 1 of "Sound Codec" drivers are not probed.
> (snip)
> > > Saravana is more familiar with devlink than I am, so he may be able to
> > > diagnose that without further information, but otherwise it would be
> > > helpful if you could provide some logs. Enabling the debug messages in
> > > drivers/base/dd.c can provide some insight. The contents of the debugfs
> > > devices_deferred file can also be useful, as well as the
> > > consumer/supplier links in sysfs for all the devices involved with the
> > > sound card.
>
> Thanks !
>
> This devices_deferred file (which I didn't know) helped my issue.
> It was my fault. My .config had been missing necessary driver
> (= CONFIG_REGULATOR_FIXED_VOLTAGE).
>
> ... but... why it had been working without it before... ?

I guess the adi,adv7513 and ti,pcm3168a drivers consider regulators
optional, so when they probe, they succeed?

With devlinks enabled, they are never probed, as their dependencies
didn't probe due to the missing regulator driver.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: fw_devlink.strict=1 breaks sound card probe ?
  2022-08-25  6:42       ` Geert Uytterhoeven
@ 2022-08-25 17:09         ` Saravana Kannan
  2022-08-26  7:24           ` Kuninori Morimoto
  0 siblings, 1 reply; 7+ messages in thread
From: Saravana Kannan @ 2022-08-25 17:09 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Kuninori Morimoto, Laurent Pinchart, Linux-Renesas, Greg KH,
	Geert Uytterhoeven, Rafael J. Wysocki

On Wed, Aug 24, 2022 at 11:42 PM Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
>
> Hi Morimoto-san,
>
> On Thu, Aug 25, 2022 at 3:11 AM Kuninori Morimoto
> <kuninori.morimoto.gx@renesas.com> wrote:
> > > > > To probe "Sound Card", it needs other necessary drivers.
> > > > > But it seems some necessary drivers are not probed by above patch.
> > > > > In my quick check, "HDMI" and 1 of "Sound Codec" drivers are not probed.
> > (snip)
> > > > Saravana is more familiar with devlink than I am, so he may be able to
> > > > diagnose that without further information, but otherwise it would be
> > > > helpful if you could provide some logs. Enabling the debug messages in
> > > > drivers/base/dd.c can provide some insight. The contents of the debugfs
> > > > devices_deferred file can also be useful, as well as the
> > > > consumer/supplier links in sysfs for all the devices involved with the
> > > > sound card.
> >
> > Thanks !
> >
> > This devices_deferred file (which I didn't know) helped my issue.
> > It was my fault. My .config had been missing necessary driver
> > (= CONFIG_REGULATOR_FIXED_VOLTAGE).
> >
> > ... but... why it had been working without it before... ?

Hi Morimoto-san,

Hmmm... even if you didn't have the driver compiled in, fw_devlink
should have stopped blocking the probe after deferred_probe_timeout
expires and that value is defaulted to 10s (it extends on every
successful driver registration). Can you help figure out if that's
happening and if not, why not?

Thanks,
Saravana

>
> I guess the adi,adv7513 and ti,pcm3168a drivers consider regulators
> optional, so when they probe, they succeed?
>
> With devlinks enabled, they are never probed, as their dependencies
> didn't probe due to the missing regulator driver.
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

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

* Re: fw_devlink.strict=1 breaks sound card probe ?
  2022-08-25 17:09         ` Saravana Kannan
@ 2022-08-26  7:24           ` Kuninori Morimoto
  0 siblings, 0 replies; 7+ messages in thread
From: Kuninori Morimoto @ 2022-08-26  7:24 UTC (permalink / raw)
  To: Saravana Kannan
  Cc: Wolfram Sang, Rafael J. Wysocki, Linux-Renesas, Laurent, Greg KH,
	Geert Uytterhoeven, Geert Uytterhoeven


Hi Geert, Saravana
Cc: Wolfram

> > > This devices_deferred file (which I didn't know) helped my issue.
> > > It was my fault. My .config had been missing necessary driver
> > > (= CONFIG_REGULATOR_FIXED_VOLTAGE).
> > >
> > > ... but... why it had been working without it before... ?
> 
> Hi Morimoto-san,
> 
> Hmmm... even if you didn't have the driver compiled in, fw_devlink
> should have stopped blocking the probe after deferred_probe_timeout
> expires and that value is defaulted to 10s (it extends on every
> successful driver registration). Can you help figure out if that's
> happening and if not, why not?

It is very deep and difficult to understand / trace.
I'm still not yet find the core point.

But something found. I hope it can be hint.

I'm using this DT

	linux/arch/arm64/boot/dts/renesas/r8a77950-ulcb-kf.dts

The key config was "CONFIG_REGULATOR" (not "CONFIG_REGULATOR_FIXED_VOLTAGE").
If .config doesn't have "CONFIG_REGULATOR" and "fw_devlink_strict = true",
some drivers probe will be deferd.
No issue will be happend if it has "CONFIG_REGULATOR".

Below is my .config case.
(It will be more drivers if I used renesas_defconfig).

	# cat /sys/kernel/debug/devices_deferred
	16-0044 i2c: supplier regulator-snd_vcc5v not ready
	sound   asoc-audio-graph-card: parse error

If you can use "renesas_defconfig", you can reproduce it
if you remove CONFIG_REGULATOR from it.

Here, "16-0044" is "pcm3168a" which needs "snd_vcc5v" and "snd_3p3v",
and "sound" needs "pcm3168a".
"pcm3168a" connection is like this

	-- linux/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi --

	i2c2
	 - i2c-switch@71 (pca9548)
	   - i2c@7
=>	     - pcm3168a

In this case, it will get -EPROBE_DEFER forever.

	driver_probe_device()
	 - __driver_probe_device()
	  - really_probe()
	    -  device_links_check_suppliers() :: return -EPROBE_DEFER

Thus, pcm3168a's probe function itself is not (never) called.

One thing I have noticed is that I2C numbering is changed somehow.
I'm not sure this is related to the issue.

	fw_devlink_strict = true	: 16-0044
	fw_devlink_strict		: 15-0044

If you can indicate something to check, I'm happy to investigate it.

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

end of thread, other threads:[~2022-08-26  7:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-24  3:13 fw_devlink.strict=1 breaks sound card probe ? Kuninori Morimoto
2022-08-24  9:37 ` Laurent Pinchart
2022-08-24 18:40   ` Saravana Kannan
2022-08-25  1:11     ` Kuninori Morimoto
2022-08-25  6:42       ` Geert Uytterhoeven
2022-08-25 17:09         ` Saravana Kannan
2022-08-26  7:24           ` Kuninori Morimoto

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).