Re: [PATCH v3 2/4] PM / QOS: Redefine FREQ_QOS_MAX_DEFAULT_VALUE to S32_MAX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 25, 2019 at 06:42:17PM +0200, Leonard Crestez wrote:
> QOS requests for DEFAULT_VALUE are supposed to be ignored but this is
> not the case for FREQ_QOS_MAX. Adding one request for MAX_DEFAULT_VALUE
> and one for a real value will cause freq_qos_read_value to unexpectedly
> return MAX_DEFAULT_VALUE (-1).
> 
> This happens because freq_qos max value is aggregated with PM_QOS_MIN
> but FREQ_QOS_MAX_DEFAULT_VALUE is (-1) so it's smaller than other
> values.
> 
> Fix this by redefining FREQ_QOS_MAX_DEFAULT_VALUE to S32_MAX.
> 
> Looking at current users for freq_qos it seems that none of them create
> requests for FREQ_QOS_MAX_DEFAULT_VALUE.
> 
> Fixes: 77751a466ebd ("PM: QoS: Introduce frequency QoS")

nit: you could add:

Reported-by: Matthias Kaehlcke <mka@xxxxxxxxxxxx>

> Signed-off-by: Leonard Crestez <leonard.crestez@xxxxxxx>
> ---
>  include/linux/pm_qos.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
> index ebf5ef17cc2a..24a6263c9931 100644
> --- a/include/linux/pm_qos.h
> +++ b/include/linux/pm_qos.h
> @@ -254,11 +254,11 @@ static inline s32 dev_pm_qos_raw_resume_latency(struct device *dev)
>  	return PM_QOS_RESUME_LATENCY_NO_CONSTRAINT;
>  }
>  #endif
>  
>  #define FREQ_QOS_MIN_DEFAULT_VALUE	0
> -#define FREQ_QOS_MAX_DEFAULT_VALUE	(-1)
> +#define FREQ_QOS_MAX_DEFAULT_VALUE	S32_MAX

Reviewed-by: Matthias Kaehlcke <mka@xxxxxxxxxxxx>



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux