stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/1] driver core: Keep the supplier fwnode consistent with the device
@ 2023-11-14  7:46 Herve Codina
  2024-01-04 15:39 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Herve Codina @ 2023-11-14  7:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Saravana Kannan
  Cc: linux-kernel, Allan Nielsen, Horatiu Vultur, Steen Hegelund,
	Thomas Petazzoni, Herve Codina, stable

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")
Cc: stable@vger.kernel.org
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
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(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 4d8b315c48a1..440b52ec027f 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -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);
-- 
2.41.0


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

* Re: [PATCH v3 1/1] driver core: Keep the supplier fwnode consistent with the device
  2023-11-14  7:46 [PATCH v3 1/1] driver core: Keep the supplier fwnode consistent with the device Herve Codina
@ 2024-01-04 15:39 ` Greg Kroah-Hartman
  2024-01-08 13:23   ` Herve Codina
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-04 15:39 UTC (permalink / raw)
  To: Herve Codina
  Cc: Rafael J. Wysocki, Saravana Kannan, linux-kernel, Allan Nielsen,
	Horatiu Vultur, Steen Hegelund, Thomas Petazzoni, stable

On Tue, Nov 14, 2023 at 08:46:32AM +0100, Herve Codina wrote:
> 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")
> Cc: stable@vger.kernel.org
> Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> ---
> 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(-)
> 
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 4d8b315c48a1..440b52ec027f 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -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);
> -- 
> 2.41.0
> 

Is this still needed?  If so, how come no one is noticing it?

thanks,

greg k-h

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

* Re: [PATCH v3 1/1] driver core: Keep the supplier fwnode consistent with the device
  2024-01-04 15:39 ` Greg Kroah-Hartman
@ 2024-01-08 13:23   ` Herve Codina
  2024-03-19 14:55     ` Herve Codina
  0 siblings, 1 reply; 4+ messages in thread
From: Herve Codina @ 2024-01-08 13:23 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Rafael J. Wysocki, Saravana Kannan, linux-kernel, Allan Nielsen,
	Horatiu Vultur, Steen Hegelund, Thomas Petazzoni, stable

Hi Greg,

On Thu, 4 Jan 2024 16:39:49 +0100
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> On Tue, Nov 14, 2023 at 08:46:32AM +0100, Herve Codina wrote:
> > 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")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> > ---
> > 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(-)
> > 
> > diff --git a/drivers/base/core.c b/drivers/base/core.c
> > index 4d8b315c48a1..440b52ec027f 100644
> > --- a/drivers/base/core.c
> > +++ b/drivers/base/core.c
> > @@ -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);
> > -- 
> > 2.41.0
> >   
> 
> Is 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é

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

* Re: [PATCH v3 1/1] driver core: Keep the supplier fwnode consistent with the device
  2024-01-08 13:23   ` Herve Codina
@ 2024-03-19 14:55     ` Herve Codina
  0 siblings, 0 replies; 4+ messages in thread
From: Herve Codina @ 2024-03-19 14:55 UTC (permalink / raw)
  To: Saravana Kannan
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, linux-kernel,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Thomas Petazzoni,
	stable

Hi Saravana,

On Mon, 8 Jan 2024 14:23:02 +0100
Herve Codina <herve.codina@bootlin.com> wrote:

> Hi Greg,
> 
> On Thu, 4 Jan 2024 16:39:49 +0100
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> 
> > On Tue, Nov 14, 2023 at 08:46:32AM +0100, Herve Codina wrote:  
> > > 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")
> > > Cc: stable@vger.kernel.org
> > > Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> > > ---
> > > 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(-)
> > > 
> > > diff --git a/drivers/base/core.c b/drivers/base/core.c
> > > index 4d8b315c48a1..440b52ec027f 100644
> > > --- a/drivers/base/core.c
> > > +++ b/drivers/base/core.c
> > > @@ -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);
> > > -- 
> > > 2.41.0
> > >     
> > 
> > Is 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.
> 

Any opinion about this patch ?

Best regards,
Hervé

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

end of thread, other threads:[~2024-03-19 14:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-14  7:46 [PATCH v3 1/1] driver core: Keep the supplier fwnode consistent with the device Herve Codina
2024-01-04 15:39 ` Greg Kroah-Hartman
2024-01-08 13:23   ` Herve Codina
2024-03-19 14:55     ` Herve Codina

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