Skip to contentSkip to conversation

driver core: Keep the supplier fwnode consistent with the device

PATCH RESEND NAK Herve Codina 2 participants 2 messages Mar 25, 2024

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

PATCH RESEND v3 1/1 driver core: Keep the supplier fwnode consistent with the device

The commit 3a2dbc510c43 ("driver core: fw_devlink: Don't purge child fwnode's consumer links") introduces the possibility to use the supplier's parent device instead of the supplier itself. In that case the supplier fwnode used is not updated and is no more consistent with the supplier device used.

Use the fwnode consistent with the supplier device when checking flags.

Fixes 3a2dbc510c43 ("driver core: fw_devlink: Don't purge child fwnode's consumer links")

---
Changes v2 -> v3:
Do not update the supplier handle in order to keep the original handle for debug traces.

Changes v1 -> v2:
Remove sup_handle check and related pr_debug() call as sup_handle cannot be invalid if sup_dev is valid.

 drivers/base/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/core.c +1 -1
index b93f3c5716ae..0d335b0dc396 100644
@@ -2163,7 +2163,7 @@ static int fw_devlink_create_devlink(struct device *con,
 		 * supplier device indefinitely.
 		 */
 		if (sup_dev->links.status == DL_DEV_NO_DRIVER &&
-		    sup_handle->flags & FWNODE_FLAG_INITIALIZED) {
+		    sup_dev->fwnode->flags & FWNODE_FLAG_INITIALIZED) {
 			dev_dbg(con,
 				"Not linking %pfwf - dev might never probe\n",
 				sup_handle);
Signature · 1 line
2.44.0
#1 lore raw
Quoted 8 lines · Herve Codina

The commit 3a2dbc510c43 ("driver core: fw_devlink: Don't purge child fwnode's consumer links") introduces the possibility to use the supplier's parent device instead of the supplier itself. In that case the supplier fwnode used is not updated and is no more consistent with the supplier device used.

Use the fwnode consistent with the supplier device when checking flags.

Please drop this patch. It's unnecessary churn. fw_devlink took years to get to where it is. There are lots of corner cases. So I'd rather not touch something if it's not broken. If a particular case for you is broken, start with describing the issue please and then we can figure out if it needs a change and what's a good way to do it.

Nack.

-Saravana

Quoted 32 lines
Fixes 3a2dbc510c43 ("driver core: fw_devlink: Don't purge child fwnode's consumer links")

---
Changes v2 -> v3:
Do not update the supplier handle in order to keep the original handle for debug traces.

Changes v1 -> v2:
Remove sup_handle check and related pr_debug() call as sup_handle cannot be invalid if sup_dev is valid.

 drivers/base/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/core.c +1 -2
index b93f3c5716ae..0d335b0dc396 100644
@@ -2163,7 +2163,7 @@ static int fw_devlink_create_devlink(struct device *con,
                 * supplier device indefinitely.
                 */
                if (sup_dev->links.status == DL_DEV_NO_DRIVER &&
-                   sup_handle->flags & FWNODE_FLAG_INITIALIZED) {
+                   sup_dev->fwnode->flags & FWNODE_FLAG_INITIALIZED) {
                        dev_dbg(con,
                                "Not linking %pfwf - dev might never probe\n",
                                sup_handle);
--

2.44.0