driver core: Keep the supplier fwnode consistent with the device
Subsystems (2)
PATCH 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.
---
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
@@ -2082,7 +2082,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.41.0
Greg Kroah-Hartman
maintainerQuoted 39 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.
Fixes 3a2dbc510c43 ("driver core: fw_devlink: Don't purge child fwnode's consumer links")Signed-off-by Herve Codina <[email protected]>---
Changes v2 -> v3:
Do not update the supplier handle in order to keep the original handle for debug traces.Changes v1 -> v2:
Removesup_handlecheck and relatedpr_debug()call assup_handlecannot be invalid ifsup_devis valid.drivers/base/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/base/core.c +1
-1@@ -2082,7 +2082,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.41.0
Is this still needed? If so, how come no one is noticing it?
thanks,
greg k-h
Hi Greg,
Quoted 34 lines · On Thu, 4 Jan 2024 16:39:49 +0100 Greg Kroah-Hartman…
Quoted 33 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.
Fixes 3a2dbc510c43 ("driver core: fw_devlink: Don't purge child fwnode's consumer links")Signed-off-by Herve Codina <[email protected]>---
Changes v2 -> v3:
Do not update the supplier handle in order to keep the original handle for debug traces.Changes v1 -> v2:
Removesup_handlecheck and relatedpr_debug()call assup_handlecannot be invalid ifsup_devis valid.drivers/base/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/base/core.c +1
-1@@ -2082,7 +2082,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 ) {
Quoted 9 lines
Quoted 6 lines
drivers/base/core.c +0
-0dev_dbg (con,"Not linking %pfwf - dev might never probe\n" , sup_handle);Signature · 1 line
2.41.0Is this still needed? If so, how come no one is noticing it?
I think it is. At least, I don't see anything that make this patch obsolete.
Hervé
Hi Saravana,
Quoted 49 lines · On Mon, 8 Jan 2024 14:23:02 +0100 Herve Codina <[email protected]> wrote:
Hi Greg,
Quoted 34 lines · On Thu, 4 Jan 2024 16:39:49 +0100 Greg Kroah-Hartman…
Quoted 33 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.
Fixes 3a2dbc510c43 ("driver core: fw_devlink: Don't purge child fwnode's consumer links")Signed-off-by Herve Codina <[email protected]>---
Changes v2 -> v3:
Do not update the supplier handle in order to keep the original handle for debug traces.Changes v1 -> v2:
Removesup_handlecheck and relatedpr_debug()call assup_handlecannot be invalid ifsup_devis valid.drivers/base/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/base/core.c +1
-1@@ -2082,7 +2082,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 ) {Quoted 9 lines
Quoted 6 lines
drivers/base/core.c +0
-0dev_dbg (con,"Not linking %pfwf - dev might never probe\n" , sup_handle);Signature · 1 line
2.41.0Is this still needed? If so, how come no one is noticing it?
Quoted 2 lines
I think it is. At least, I don't see anything that make this patch obsolete.
Any opinion about this patch ?
Best regards,
Hervé