linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM / devfreq: Fix faulty error message
@ 2015-03-17 20:59 Deva Ramasubramanian
  0 siblings, 0 replies; 2+ messages in thread
From: Deva Ramasubramanian @ 2015-03-17 20:59 UTC (permalink / raw)
  To: MyungJoo Ham, Kyungmin Park; +Cc: Deva Ramasubramanian, linux-pm, linux-kernel

The misleading log "releasing devfreq which doesn't exist" prints out
for well behaved clients.  This is due to the fact that _remove_devfreq
calls itself recursively by proxy (via put_device()).  The second time
_devfreq_remove is called the respective device has already been
deleted, causing the misleading warning.

So just skip printing the message if _devfreq_remove was called via
put_device().

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
---
 drivers/devfreq/devfreq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 30b538d8..bee59db 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -399,7 +399,8 @@ static void _remove_devfreq(struct devfreq *devfreq)
 	mutex_lock(&devfreq_list_lock);
 	if (IS_ERR(find_device_devfreq(devfreq->dev.parent))) {
 		mutex_unlock(&devfreq_list_lock);
-		dev_warn(&devfreq->dev, "releasing devfreq which doesn't exist\n");
+		if (!skip)
+			dev_warn(&devfreq->dev, "releasing devfreq which doesn't exist\n");
 		return;
 	}
 	list_del(&devfreq->node);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* Re: [PATCH] PM / devfreq: Fix faulty error message
@ 2015-03-18  4:12 MyungJoo Ham
  0 siblings, 0 replies; 2+ messages in thread
From: MyungJoo Ham @ 2015-03-18  4:12 UTC (permalink / raw)
  To: Deva Ramasubramanian
  Cc: 박경민, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org

> The misleading log "releasing devfreq which doesn't exist" prints out
> for well behaved clients.  This is due to the fact that _remove_devfreq
> calls itself recursively by proxy (via put_device()).  The second time
> _devfreq_remove is called the respective device has already been
> deleted, causing the misleading warning.
> 
> So just skip printing the message if _devfreq_remove was called via
> put_device().
> 
> Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
> ---
>  drivers/devfreq/devfreq.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index 30b538d8..bee59db 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -399,7 +399,8 @@ static void _remove_devfreq(struct devfreq *devfreq)
>  	mutex_lock(&devfreq_list_lock);
>  	if (IS_ERR(find_device_devfreq(devfreq->dev.parent))) {
>  		mutex_unlock(&devfreq_list_lock);
> -		dev_warn(&devfreq->dev, "releasing devfreq which doesn't exist\n");
> +		if (!skip)
> +			dev_warn(&devfreq->dev, "releasing devfreq which doesn't exist\n");

There is no variable 'skip' in the function. (you get build error.)
And with patch 585fc83ece43be63, we do not call the function recursively, either.

---
drivers/devfreq/devfreq.c: In function ‘_remove_devfreq’:
drivers/devfreq/devfreq.c:402:8: error: ‘skip’ undeclared (first use in this function)
drivers/devfreq/devfreq.c:402:8: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [drivers/devfreq/devfreq.o] Error 1
make[1]: *** [drivers/devfreq] Error 2
make[1]: *** Waiting for unfinished jobs....
---

I'll update the function description.


Cheers,
MyungJoo.

>  		return;
>  	}
>  	list_del(&devfreq->node);
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project

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

end of thread, other threads:[~2015-03-18  4:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-18  4:12 [PATCH] PM / devfreq: Fix faulty error message MyungJoo Ham
  -- strict thread matches above, loose matches on Subject: below --
2015-03-17 20:59 Deva Ramasubramanian

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