public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] base: core: Remove WARN_ON from link dependencies check
@ 2018-07-16  9:59 Benjamin Gaignard
  2018-07-16 10:07 ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Gaignard @ 2018-07-16  9:59 UTC (permalink / raw)
  To: gregkh, broonie, p.paillet, linux-kernel, m.szyprowski, rjw
  Cc: Benjamin Gaignard

In some cases the link between between customer and supplier
already exist, for example when a device use it parent as supplier [1].
Do not warn about already existing dependencies because device_link_add()
take care of this case.

[1] https://lkml.org/lkml/2018/7/9/356

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
---
 drivers/base/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index df3e1a44707a..fcdc17f0f349 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -105,7 +105,7 @@ static int device_is_dependent(struct device *dev, void *target)
 	struct device_link *link;
 	int ret;
 
-	if (WARN_ON(dev == target))
+	if (dev == target)
 		return 1;
 
 	ret = device_for_each_child(dev, target, device_is_dependent);
@@ -113,7 +113,7 @@ static int device_is_dependent(struct device *dev, void *target)
 		return ret;
 
 	list_for_each_entry(link, &dev->links.consumers, s_node) {
-		if (WARN_ON(link->consumer == target))
+		if (link->consumer == target)
 			return 1;
 
 		ret = device_is_dependent(link->consumer, target);
-- 
2.15.0


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

* Re: [PATCH v2] base: core: Remove WARN_ON from link dependencies check
  2018-07-16  9:59 [PATCH v2] base: core: Remove WARN_ON from link dependencies check Benjamin Gaignard
@ 2018-07-16 10:07 ` Rafael J. Wysocki
  2018-07-16 10:27   ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2018-07-16 10:07 UTC (permalink / raw)
  To: Benjamin Gaignard
  Cc: gregkh, broonie, p.paillet, linux-kernel, m.szyprowski,
	Benjamin Gaignard

On Monday, July 16, 2018 11:59:52 AM CEST Benjamin Gaignard wrote:
> In some cases the link between between customer and supplier
> already exist, for example when a device use it parent as supplier [1].

I think this should be "its parent as a supplier".

> Do not warn about already existing dependencies because device_link_add()
> take care of this case.

"device_link_add() takes care of"

> [1] https://lkml.org/lkml/2018/7/9/356

There is the Link: tag for links and it is better to not use lkml.org
as it is not reliable enough.  You can use lore.kernel.org/lkml/ instead.

> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Reviewed-by: Mark Brown <broonie@kernel.org>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
> ---
>  drivers/base/core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index df3e1a44707a..fcdc17f0f349 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -105,7 +105,7 @@ static int device_is_dependent(struct device *dev, void *target)
>  	struct device_link *link;
>  	int ret;
>  
> -	if (WARN_ON(dev == target))
> +	if (dev == target)
>  		return 1;
>  
>  	ret = device_for_each_child(dev, target, device_is_dependent);
> @@ -113,7 +113,7 @@ static int device_is_dependent(struct device *dev, void *target)
>  		return ret;
>  
>  	list_for_each_entry(link, &dev->links.consumers, s_node) {
> -		if (WARN_ON(link->consumer == target))
> +		if (link->consumer == target)
>  			return 1;
>  
>  		ret = device_is_dependent(link->consumer, target);
> 



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

* Re: [PATCH v2] base: core: Remove WARN_ON from link dependencies check
  2018-07-16 10:07 ` Rafael J. Wysocki
@ 2018-07-16 10:27   ` Greg KH
  2018-07-16 10:40     ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2018-07-16 10:27 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Benjamin Gaignard, broonie, p.paillet, linux-kernel, m.szyprowski,
	Benjamin Gaignard

On Mon, Jul 16, 2018 at 12:07:20PM +0200, Rafael J. Wysocki wrote:
> On Monday, July 16, 2018 11:59:52 AM CEST Benjamin Gaignard wrote:
> > In some cases the link between between customer and supplier
> > already exist, for example when a device use it parent as supplier [1].
> 
> I think this should be "its parent as a supplier".
> 
> > Do not warn about already existing dependencies because device_link_add()
> > take care of this case.
> 
> "device_link_add() takes care of"
> 
> > [1] https://lkml.org/lkml/2018/7/9/356
> 
> There is the Link: tag for links and it is better to not use lkml.org
> as it is not reliable enough.  You can use lore.kernel.org/lkml/ instead.

Even better, use:
	lkml.kernel.org/r/[message-id]

thanks,

greg k-h

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

* Re: [PATCH v2] base: core: Remove WARN_ON from link dependencies check
  2018-07-16 10:27   ` Greg KH
@ 2018-07-16 10:40     ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2018-07-16 10:40 UTC (permalink / raw)
  To: Greg KH, Benjamin Gaignard
  Cc: broonie, p.paillet, linux-kernel, m.szyprowski, Benjamin Gaignard

On Monday, July 16, 2018 12:27:35 PM CEST Greg KH wrote:
> On Mon, Jul 16, 2018 at 12:07:20PM +0200, Rafael J. Wysocki wrote:
> > On Monday, July 16, 2018 11:59:52 AM CEST Benjamin Gaignard wrote:
> > > In some cases the link between between customer and supplier
> > > already exist, for example when a device use it parent as supplier [1].
> > 
> > I think this should be "its parent as a supplier".
> > 
> > > Do not warn about already existing dependencies because device_link_add()
> > > take care of this case.
> > 
> > "device_link_add() takes care of"
> > 
> > > [1] https://lkml.org/lkml/2018/7/9/356
> > 
> > There is the Link: tag for links and it is better to not use lkml.org
> > as it is not reliable enough.  You can use lore.kernel.org/lkml/ instead.
> 
> Even better, use:
> 	lkml.kernel.org/r/[message-id]

Where [message-id] is the value of the Message-Id: header (without the
enclosing <>) of the target e-mail message (that you can find by looking
at the raw message).

Thanks,
Rafael


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

end of thread, other threads:[~2018-07-16 10:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-16  9:59 [PATCH v2] base: core: Remove WARN_ON from link dependencies check Benjamin Gaignard
2018-07-16 10:07 ` Rafael J. Wysocki
2018-07-16 10:27   ` Greg KH
2018-07-16 10:40     ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox