]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
intel_idle: correct BXT support
authorJan Beulich <JBeulich@suse.com>
Mon, 27 Jun 2016 06:35:48 +0000 (00:35 -0600)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 3 Nov 2016 17:26:20 +0000 (10:26 -0700)
Orabug: 24810432

Commit 5dcef69486 ("intel_idle: add BXT support") added an 8-element
lookup array with just a 2-bit value used for lookups. As per the SDM
that bit field is really 3 bits wide. While this is supposedly benign
here, future re-use of the code for other CPUs might expose the issue.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit bef450962597ff39a7f9d53a30523aae9eb55843)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/idle/intel_idle.c

index 6874a2c361d0d2d712d5b488d5bdc2a5c568f1a3..22473db328a18fd52819f176bf52cea05d6f181a 100644 (file)
@@ -1158,7 +1158,7 @@ static unsigned long long irtl_2_usec(unsigned long long irtl)
        if (!irtl)
                return 0;
 
-       ns = irtl_ns_units[(irtl >> 10) & 0x3];
+       ns = irtl_ns_units[(irtl >> 10) & 0x7];
 
        return div64_u64((irtl & 0x3FF) * ns, 1000);
 }