Power management fix for 6.2-rc8

Fix the incorrect value returned by cpufreq driver's ->get() callback
 for Qualcomm platforms (Douglas Anderson).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmPlPHASHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxIYAP/jZDDObovruHZktMdUs5z0tvdi0Y8mtc
 Gay7vqgbrZCGClSR+0GaRX7TsGvKMb1cX66zeUjMAxyLUnJBeL/yCejZAzgLSd7g
 i940qJ2KqFz3GPameQOHceuiDBMojkPLAcU3K/tUBmZjiMQF8CSZkqnSUZ2qODeo
 V7jLQjFabryOz9mMlede6ZoNLDz3h9bFofHFPFytdgFRRquxIrKKv1cxUCcnRDHn
 +KbNEe72tWfnhBIdtJZh45m+551Jv1PwpNhhxkGPOOPdYVBOLV2DvuHXoa2P2F92
 Ool4LEB6WEsmv+4pL/jFqPpujm+iXdHvK1A9MA1Dd39W5sIlooffMhlevIoTeD2D
 v2h2NDL5t+4MxrlqrH8PFv2XCEM2ccYFIiWkUKlM3uzFYFUtxLuMnIQMKKEttg/b
 rLXDuqXNg9QObEd6YiNNwNHWx9VJIE/ZgxAxTPqnGpI2b6QMh/jgkB3RlkKq7Li3
 BogyVQGDVTwsMglZ+wb7R8KDIEHwpECoYiKQFFPPTsE5zYUCkvC3sGpBmxj+ipbG
 5keS6hOklGGvKl/F9lsm4rEhmjmCYRLH2139MULNRjFXAdZzGRQwTbTlzrr4bCSC
 veKMyGwYEId38C/91XCyNpZl8J6XNtkSU66fP8w4t6ZYvqEYn/VgZ0JPn3WkVTFd
 j9cmnPZmh/OD
 =yM0L
 -----END PGP SIGNATURE-----

Merge tag 'pm-6.2-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fix from Rafael Wysocki:
 "Fix the incorrect value returned by cpufreq driver's ->get() callback
  for Qualcomm platforms (Douglas Anderson)"

* tag 'pm-6.2-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: qcom-hw: Fix cpufreq_driver->get() for non-LMH systems
This commit is contained in:
Linus Torvalds 2023-02-09 10:54:57 -08:00
commit e544a07438

View File

@ -143,21 +143,6 @@ static unsigned long qcom_lmh_get_throttle_freq(struct qcom_cpufreq_data *data)
return lval * xo_rate;
}
/* Get the current frequency of the CPU (after throttling) */
static unsigned int qcom_cpufreq_hw_get(unsigned int cpu)
{
struct qcom_cpufreq_data *data;
struct cpufreq_policy *policy;
policy = cpufreq_cpu_get_raw(cpu);
if (!policy)
return 0;
data = policy->driver_data;
return qcom_lmh_get_throttle_freq(data) / HZ_PER_KHZ;
}
/* Get the frequency requested by the cpufreq core for the CPU */
static unsigned int qcom_cpufreq_get_freq(unsigned int cpu)
{
@ -179,6 +164,23 @@ static unsigned int qcom_cpufreq_get_freq(unsigned int cpu)
return policy->freq_table[index].frequency;
}
static unsigned int qcom_cpufreq_hw_get(unsigned int cpu)
{
struct qcom_cpufreq_data *data;
struct cpufreq_policy *policy;
policy = cpufreq_cpu_get_raw(cpu);
if (!policy)
return 0;
data = policy->driver_data;
if (data->throttle_irq >= 0)
return qcom_lmh_get_throttle_freq(data) / HZ_PER_KHZ;
return qcom_cpufreq_get_freq(cpu);
}
static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
unsigned int target_freq)
{