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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <92645B27BF79D04FBD2B0F8494FFD0F9199B5FCA@G2W2527.americas.hpqcorp.net>
Date:	Mon, 16 Nov 2015 10:42:52 +0000
From:	"Zhang, Lin-Bao (Linux Kernel R&D)" <linbao.zhang@....com>
To:	"rjw@...ysocki.net" <rjw@...ysocki.net>,
	"viresh.kumar@...aro.org" <viresh.kumar@...aro.org>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH v1 2/2] retry 2 times when getting cpu frequency is zero


when getting cpu frequency failures, it will retry 2 times at most.

Signed-off-by: Pearson, Greg <greg.pearson@....com>
Signed-off-by: Zhang, Lin-Bao <linbao.zhang@....com>
---
 drivers/cpufreq/pcc-cpufreq.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/cpufreq/pcc-cpufreq.c b/drivers/cpufreq/pcc-cpufreq.c
index c8f1616..159dede 100644
--- a/drivers/cpufreq/pcc-cpufreq.c
+++ b/drivers/cpufreq/pcc-cpufreq.c
@@ -108,6 +108,7 @@ struct pcc_cpu {
        u32 input_offset;
        u32 output_offset;
        u64 prev_time;
+       u32 get_freq_retry;
 };

 static u32 max_time_between_cmds = 0;
@@ -225,6 +226,17 @@ static unsigned int pcc_get_freq(unsigned int cpu)

        curr_freq = real_pcc_get_freq(cpu);

+       spin_lock(&pcc_lock);
+       if (curr_freq == 0 && pcc_cpu_data->get_freq_retry < 2) {
+               pcc_cpu_data->get_freq_retry++;
+               spin_unlock(&pcc_lock);
+               curr_freq = pcc_get_freq(cpu);
+               return curr_freq;
+       }
+
+       pcc_cpu_data->get_freq_retry = 0;
+       spin_unlock(&pcc_lock);
+
        return curr_freq;
 }

--
1.8.5.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ