Skip to contentSkip to conversation

A few minor fw_devlink fixes

PATCH In review Saravana Kannan 4 participants 11 messages Oct 24, 2024 – Oct 25, 2024

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

cover A few minor fw_devlink fixes

Probably easiest for Greg to pull in these changes?

PSA: Do not pull any of these patches into stable kernels. fw_devlink had a lot of changes that landed in the last year. It's hard to ensure cherry-picks have picked up all the dependencies correctly. If any of these really need to get cherry-picked into stable kernels, cc me and wait for my explicit Ack.

Thanks,
Saravana

Saravana Kannan (3):
drm: display: Set fwnode for aux bus devices
phy: tegra: xusb: Set fwnode for xusb port devices
drivers: core: fw_devlink: Make the error message a bit more useful

 drivers/base/core.c                      | 4 ++--
 drivers/gpu/drm/display/drm_dp_aux_bus.c | 2 +-
 drivers/phy/tegra/xusb.c                 | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.47.0.105.g07ac214952-goog
#1 lore raw

PATCH 1/3 drm: display: Set fwnode for aux bus devices

fwnode needs to be set for a device for fw_devlink to be able to track/enforce its dependencies correctly. Without this, you'll see error messages like this when the supplier has probed and tries to make sure all its fwnode consumers are linked to it using device links:

mediatek-drm-dp 1c500000.edp-tx: Failed to create device link (0x180) with backlight-lcd0

---
 drivers/gpu/drm/display/drm_dp_aux_bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/display/drm_dp_aux_bus.c +1 -1
index d810529ebfb6..ec7eac6b595f 100644
@@ -292,7 +292,7 @@ int of_dp_aux_populate_bus(struct drm_dp_aux *aux,
 	aux_ep->dev.parent = aux->dev;
 	aux_ep->dev.bus = &dp_aux_bus_type;
 	aux_ep->dev.type = &dp_aux_device_type_type;
-	aux_ep->dev.of_node = of_node_get(np);
+	device_set_node(&aux_ep->dev, of_fwnode_handle(of_node_get(np)));
 	dev_set_name(&aux_ep->dev, "aux-%s", dev_name(aux->dev));
 
 	ret = device_register(&aux_ep->dev);
Signature · 1 line
2.47.0.105.g07ac214952-goog
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] drm: display: Set fwnode for aux bus devices

Quoted 7 lines · Saravana Kannan

fwnode needs to be set for a device for fw_devlink to be able to track/enforce its dependencies correctly. Without this, you'll see error messages like this when the supplier has probed and tries to make sure all its fwnode consumers are linked to it using device links:

mediatek-drm-dp 1c500000.edp-tx: Failed to create device link (0x180) with backlight-lcd0

Quoted 7 lines
---
 drivers/gpu/drm/display/drm_dp_aux_bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by on v1 1/3
#3 lore raw

Re: [PATCH 1/3] drm: display: Set fwnode for aux bus devices

In reply to Saravana Kannan
Quoted 7 lines · Saravana Kannan

fwnode needs to be set for a device for fw_devlink to be able to track/enforce its dependencies correctly. Without this, you'll see error messages like this when the supplier has probed and tries to make sure all its fwnode consumers are linked to it using device links:

mediatek-drm-dp 1c500000.edp-tx: Failed to create device link (0x180) with backlight-lcd0

Quoted 8 lines
---
 drivers/gpu/drm/display/drm_dp_aux_bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 2 lines
With best wishes
Dmitry
#4 lore raw

PATCH 2/3 phy: tegra: xusb: Set fwnode for xusb port devices

In reply to Saravana Kannan

fwnode needs to be set for a device for fw_devlink to be able to track/enforce its dependencies correctly. Without this, you'll see error messages like this when the supplier has probed and tries to make sure all its fwnode consumers are linked to it using device links:

tegra-xusb-padctl 3520000.padctl: Failed to create device link (0x180) with 1-0008

---
 drivers/phy/tegra/xusb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/tegra/xusb.c +1 -1
index cfdb54b6070a..0a2096085971 100644
@@ -543,7 +543,7 @@ static int tegra_xusb_port_init(struct tegra_xusb_port *port,
 
 	device_initialize(&port->dev);
 	port->dev.type = &tegra_xusb_port_type;
-	port->dev.of_node = of_node_get(np);
+	device_set_node(&port->dev, of_fwnode_handle(of_node_get(np)));
 	port->dev.parent = padctl->dev;
 
 	err = dev_set_name(&port->dev, "%s-%u", name, index);
Signature · 1 line
2.47.0.105.g07ac214952-goog
Acked-by on v1 2/3
#5 lore raw

Re: [PATCH 2/3] phy: tegra: xusb: Set fwnode for xusb port devices

Quoted 7 lines · Saravana Kannan

fwnode needs to be set for a device for fw_devlink to be able to track/enforce its dependencies correctly. Without this, you'll see error messages like this when the supplier has probed and tries to make sure all its fwnode consumers are linked to it using device links:

tegra-xusb-padctl 3520000.padctl: Failed to create device link (0x180) with 1-0008

Quoted 8 lines
---
 drivers/phy/tegra/xusb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#6 lore raw

PATCH 3/3 drivers: core: fw_devlink: Make the error message a bit more useful

In reply to Saravana Kannan

It would make it easier to debugs issues similar to the ones reported[1][2] recently where some devices didn't have the fwnode set.

[1] - https://lore.kernel.org/all/7b995947-4540-4b17-872e-e107adca4598@notapiano/
[2] - https://lore.kernel.org/all/[email protected]/

---
 drivers/base/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/base/core.c +2 -2
index a4c853411a6b..3b13fed1c3e3 100644
@@ -2181,8 +2181,8 @@ static int fw_devlink_create_devlink(struct device *con,
 		}
 
 		if (con != sup_dev && !device_link_add(con, sup_dev, flags)) {
-			dev_err(con, "Failed to create device link (0x%x) with %s\n",
-				flags, dev_name(sup_dev));
+			dev_err(con, "Failed to create device link (0x%x) with supplier %s for %pfwf\n",
+				flags, dev_name(sup_dev), link->consumer);
 			ret = -EINVAL;
 		}
 
Signature · 1 line
2.47.0.105.g07ac214952-goog
#7 lore raw

Re: [PATCH 3/3] drivers: core: fw_devlink: Make the error message a bit more useful

Greg,

Can you fix up the commit subject prefix to "driver core: fw_devlink:" please? Don't want to send v2 just for that.

-Saravana

Quoted 30 lines · Saravana Kannan

It would make it easier to debugs issues similar to the ones reported[1][2] recently where some devices didn't have the fwnode set.

[1] - https://lore.kernel.org/all/7b995947-4540-4b17-872e-e107adca4598@notapiano/
[2] - https://lore.kernel.org/all/[email protected]/

---
 drivers/base/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/base/core.c +2 -3
index a4c853411a6b..3b13fed1c3e3 100644
@@ -2181,8 +2181,8 @@ static int fw_devlink_create_devlink(struct device *con,
                }
 
                if (con != sup_dev && !device_link_add(con, sup_dev, flags)) {
-                       dev_err(con, "Failed to create device link (0x%x) with %s\n",
-                               flags, dev_name(sup_dev));
+                       dev_err(con, "Failed to create device link (0x%x) with supplier %s for %pfwf\n",
+                               flags, dev_name(sup_dev), link->consumer);
                        ret = -EINVAL;
                }
 
--

2.47.0.105.g07ac214952-goog

#8 lore raw

Re: [PATCH 3/3] drivers: core: fw_devlink: Make the error message a bit more useful

Quoted 4 lines · Saravana Kannan

Greg,

Can you fix up the commit subject prefix to "driver core: fw_devlink:" please? Don't want to send v2 just for that.

Will do, thanks!

#9 lore raw
In reply to Saravana Kannan
Quoted 7 lines · Saravana Kannan

Probably easiest for Greg to pull in these changes?

PSA: Do not pull any of these patches into stable kernels. fw_devlink had a lot of changes that landed in the last year. It's hard to ensure cherry-picks have picked up all the dependencies correctly. If any of these really need to get cherry-picked into stable kernels, cc me and wait for my explicit Ack.

You can do that with the correct tag in the commit as per the stable documentation if you really want to :)

But why would these not be able to go backwards? What changed to require them now and not be ok for older kernels?

thanks,

greg k-h

#10 lore raw
Quoted 10 lines · Greg Kroah-Hartman
Quoted 7 lines · Saravana Kannan

Probably easiest for Greg to pull in these changes?

PSA: Do not pull any of these patches into stable kernels. fw_devlink had a lot of changes that landed in the last year. It's hard to ensure cherry-picks have picked up all the dependencies correctly. If any of these really need to get cherry-picked into stable kernels, cc me and wait for my explicit Ack.

Quoted 5 lines

You can do that with the correct tag in the commit as per the stable documentation if you really want to :)

But why would these not be able to go backwards? What changed to require them now and not be ok for older kernels?

Depending on how far back we go in terms of kernel version, it'd be a bunch of cycle detection logic, deferred probe behavior change, etc. And those patches might have other dependencies themselves, etc.

He's one example of such a breakage:
https://lore.kernel.org/all/[email protected]/

-Saravana