[PATCH] pmdomain: imx: gpc: set fwnode from parent device

Emil Kronborg Andersen emkan at prevas.dk
Tue Oct 17 01:00:21 PDT 2023


Hi Ulf,

On Mon, Oct 16, 2023 at 11:53 +0200, Ulf Hansson wrote:
> Unfortunately, it's not that easy. It's not required by
> pm_genpd_init() (or of_genpd_add_provider_*) to use a struct *device
> when registering a genpd provider. In fact, that's also the reason why
> pm_genpd_init() needs to initialize its own struct device.

Do you see any way to do it properly at pmdomain level instead, or is
that not feasible? I agree with Saravana that a centralized solution,
akin to what was implemented for tty devices in commit 1a5ecc73b2bf
("serdev: Set fwnode for serdev devices"), would be ideal. However, I
was not able to find other reports or patches of problems regarding
fw_devlink at pmdomain level, so it might not be a general problem here,
and fixes per driver might be okay in this case?

> That said, can you please explain the special condition that caused
> this thing to be needed in the first place?

I noticed this issue when I updated from 5.15.93 to 6.1.37. Except for
the commit I bisected, i.e., 3fb16866b51d ("driver core: fw_devlink:
Make cycle detection more robust"), I found that the issue was
introduced somewhere between 6.1.16 and 6.1.15. Here, some commits
regarding fw_devlink was backported, which might be relevant:

$ git log --oneline v6.1.15..v6.1.16 -- drivers/base/core.c | grep fw_devlink
11d93294b7c3 driver core: fw_devlink: Avoid spurious error message
3dd596616d10 driver core: fw_devlink: Make cycle detection more robust
a3c171751512 driver core: fw_devlink: Improve check for fwnode with no device/driver
7a8ce4d2fbbc driver core: fw_devlink: Consolidate device link flag computation
16aa2487cf15 driver core: fw_devlink: Allow marking a fwnode link as being part of a cycle
eaf9b5612a47 driver core: fw_devlink: Don't purge child fwnode's consumer links
2455b81afe68 driver core: fw_devlink: Add DL_FLAG_CYCLE support to device links

Best regards,
Emil



More information about the linux-arm-kernel mailing list