lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191120093849.u7gelifptikwv632@vireshk-i7>
Date:   Wed, 20 Nov 2019 15:08:49 +0530
From:   Viresh Kumar <viresh.kumar@...aro.org>
To:     "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc:     Linux PM <linux-pm@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Linux ACPI <linux-acpi@...r.kernel.org>,
        Doug Smythies <dsmythies@...us.net>,
        Leonard Crestez <leonard.crestez@....com>,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Subject: Re: [PATCH] PM: QoS: Invalidate frequency QoS requests after removal

On 20-11-19, 10:33, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> 
> Switching cpufreq drivers (or switching operation modes of the
> intel_pstate driver from "active" to "passive" and vice versa)
> does not work on some x86 systems with ACPI after commit
> 3000ce3c52f8 ("cpufreq: Use per-policy frequency QoS"), because
> the ACPI _PPC and thermal code uses the same frequency QoS request
> object for a given CPU every time a cpufreq driver is registered
> and freq_qos_remove_request() does not invalidate the request after
> removing it from its QoS list, so freq_qos_add_request() complains
> and fails when that request is passed to it again.
> 
> Fix the issue by modifying freq_qos_remove_request() to clear the qos
> and type fields of the frequency request pointed to by its argument
> after removing it from its QoS list so as to invalidate it.
> 
> Fixes: 3000ce3c52f8 ("cpufreq: Use per-policy frequency QoS")
> Reported-and-tested-by: Doug Smythies <dsmythies@...us.net>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
>  kernel/power/qos.c |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> Index: linux-pm/kernel/power/qos.c
> ===================================================================
> --- linux-pm.orig/kernel/power/qos.c
> +++ linux-pm/kernel/power/qos.c
> @@ -814,6 +814,8 @@ EXPORT_SYMBOL_GPL(freq_qos_update_reques
>   */
>  int freq_qos_remove_request(struct freq_qos_request *req)
>  {
> +	int ret;
> +
>  	if (!req)
>  		return -EINVAL;
>  
> @@ -821,7 +823,11 @@ int freq_qos_remove_request(struct freq_
>  		 "%s() called for unknown object\n", __func__))
>  		return -EINVAL;
>  
> -	return freq_qos_apply(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE);
> +	ret = freq_qos_apply(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE);
> +	req->qos = NULL;
> +	req->type = 0;
> +
> +	return ret;
>  }
>  EXPORT_SYMBOL_GPL(freq_qos_remove_request);

Acked-by: Viresh Kumar <viresh.kumar@...aro.org>

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ