]> git.ipfire.org Git - people/arne_f/kernel.git/commit
platform/x86: intel_pmc_core: Fix PCH IP sts reading
authorRajneesh Bhardwaj <rajneesh.bhardwaj@linux.intel.com>
Fri, 1 Feb 2019 07:32:26 +0000 (13:02 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2019 20:31:35 +0000 (22:31 +0200)
commitd9e09a1d0c4cfb6d6a43a761e432d9405d6d8c61
tree4a5718a0a47f0785e0e1f79960d98224237bad63
parent9ae89542a9c5b1331039782d4e782f6e10ea23f6
platform/x86: intel_pmc_core: Fix PCH IP sts reading

[ Upstream commit 0e68eeea9894feeba2edf7ec63e4551b87f39621 ]

A previous commit "platform/x86: intel_pmc_core: Make the driver PCH
family agnostic <c977b98bbef5898ed3d30b08ea67622e9e82082a>" provided
better abstraction to this driver but has some fundamental issues.

e.g. the following condition

for (index = 0; index < pmcdev->map->ppfear_buckets &&
index < PPFEAR_MAX_NUM_ENTRIES; index++, iter++)

is wrong because for CNL, PPFEAR_MAX_NUM_ENTRIES is hardcoded as 5 which
is _wrong_ and even though ppfear_buckets is 8, the loop fails to read
all eight registers needed for CNL PCH i.e. PPFEAR0 and PPFEAR1. This
patch refactors the pfear show logic to correctly read PCH IP power
gating status for Cannonlake and beyond.

Cc: "David E. Box" <david.e.box@intel.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Fixes: c977b98bbef5 ("platform/x86: intel_pmc_core: Make the driver PCH family agnostic")
Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/intel_pmc_core.c
drivers/platform/x86/intel_pmc_core.h