• Rafael J. Wysocki's avatar
    PM: QoS: Invalidate frequency QoS requests after removal · 05ff1ba4
    Rafael J. Wysocki authored
    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
    3000ce3c ("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: 3000ce3c ("cpufreq: Use per-policy frequency QoS")
    Reported-and-tested-by: default avatarDoug Smythies <dsmythies@telus.net>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
    05ff1ba4
qos.c 23.2 KB