diff mbox series

PM / devfreq: Fix handling dev_pm_qos_remove_request result

Message ID ea4c8b53f2a045116a5f70e24374ce62c85f0b81.1583982882.git.leonard.crestez@nxp.com (mailing list archive)
State Superseded
Headers show
Series PM / devfreq: Fix handling dev_pm_qos_remove_request result | expand

Commit Message

Leonard Crestez March 12, 2020, 3:15 a.m. UTC
The dev_pm_qos_remove_request function can return 1 if
"aggregated constraint value has changed" so only negative values should
be reported as errors.

Fixes: 27dbc542f651 ("PM / devfreq: Use PM QoS for sysfs min/max_freq")

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
---
 drivers/devfreq/devfreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Chanwoo Choi March 12, 2020, 3:30 a.m. UTC | #1
On 3/12/20 12:15 PM, Leonard Crestez wrote:
> The dev_pm_qos_remove_request function can return 1 if
> "aggregated constraint value has changed" so only negative values should
> be reported as errors.
> 
> Fixes: 27dbc542f651 ("PM / devfreq: Use PM QoS for sysfs min/max_freq")
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
> ---
>  drivers/devfreq/devfreq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index 5c481ad1cfc7..6fecd11dafdd 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -703,17 +703,17 @@ static void devfreq_dev_release(struct device *dev)
>  		dev_warn(dev->parent,
>  			"Failed to remove min_freq notifier: %d\n", err);
>  
>  	if (dev_pm_qos_request_active(&devfreq->user_max_freq_req)) {
>  		err = dev_pm_qos_remove_request(&devfreq->user_max_freq_req);
> -		if (err)
> +		if (err < 0)
>  			dev_warn(dev->parent,
>  				"Failed to remove max_freq request: %d\n", err);
>  	}
>  	if (dev_pm_qos_request_active(&devfreq->user_min_freq_req)) {
>  		err = dev_pm_qos_remove_request(&devfreq->user_min_freq_req);
> -		if (err)
> +		if (err < 0)
>  			dev_warn(dev->parent,
>  				"Failed to remove min_freq request: %d\n", err);
>  	}
>  
>  	if (devfreq->profile->exit)
> 

Looks good to me.
But, It doesn't contain the stable mailing list.
Please add stable mailing list to Cc and resend it.
Dan Carpenter March 12, 2020, 6:31 a.m. UTC | #2
On Thu, Mar 12, 2020 at 12:30:42PM +0900, Chanwoo Choi wrote:
> On 3/12/20 12:15 PM, Leonard Crestez wrote:
> > The dev_pm_qos_remove_request function can return 1 if
> > "aggregated constraint value has changed" so only negative values should
> > be reported as errors.
> > 
> > Fixes: 27dbc542f651 ("PM / devfreq: Use PM QoS for sysfs min/max_freq")
> > 
> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> > Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>

Since you're resending anyway, could you remove the blank line after the
Fixes tag?  All the tags go together at the end.  (The blank line does
not matter at all to anyone, purely aesthetic).

regards,
dan carpenter
diff mbox series

Patch

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 5c481ad1cfc7..6fecd11dafdd 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -703,17 +703,17 @@  static void devfreq_dev_release(struct device *dev)
 		dev_warn(dev->parent,
 			"Failed to remove min_freq notifier: %d\n", err);
 
 	if (dev_pm_qos_request_active(&devfreq->user_max_freq_req)) {
 		err = dev_pm_qos_remove_request(&devfreq->user_max_freq_req);
-		if (err)
+		if (err < 0)
 			dev_warn(dev->parent,
 				"Failed to remove max_freq request: %d\n", err);
 	}
 	if (dev_pm_qos_request_active(&devfreq->user_min_freq_req)) {
 		err = dev_pm_qos_remove_request(&devfreq->user_min_freq_req);
-		if (err)
+		if (err < 0)
 			dev_warn(dev->parent,
 				"Failed to remove min_freq request: %d\n", err);
 	}
 
 	if (devfreq->profile->exit)