From: Rajneesh Bhardwaj <rajneesh.bhardwaj@linux.intel.com>
To: platform-driver-x86@vger.kernel.org
Cc: dvhart@infradead.org, andy@infradead.org,
linux-kernel@vger.kernel.org,
Rajneesh Bhardwaj <rajneesh.bhardwaj@linux.intel.com>,
"David E. Box" <david.e.box@intel.com>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: [PATCH v2 02/10] platform/x86: intel_pmc_core: Fix PCH IP sts reading
Date: Wed, 13 Feb 2019 20:38:02 +0530 [thread overview]
Message-ID: <20190213150810.32750-3-rajneesh.bhardwaj@linux.intel.com> (raw)
In-Reply-To: <20190213150810.32750-1-rajneesh.bhardwaj@linux.intel.com>
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>
---
drivers/platform/x86/intel_pmc_core.c | 3 ++-
drivers/platform/x86/intel_pmc_core.h | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c
index 37f605da9333..9f143cdbea05 100644
--- a/drivers/platform/x86/intel_pmc_core.c
+++ b/drivers/platform/x86/intel_pmc_core.c
@@ -380,7 +380,8 @@ static int pmc_core_ppfear_show(struct seq_file *s, void *unused)
index < PPFEAR_MAX_NUM_ENTRIES; index++, iter++)
pf_regs[index] = pmc_core_reg_read_byte(pmcdev, iter);
- for (index = 0; map[index].name; index++)
+ for (index = 0; map[index].name &&
+ index < pmcdev->map->ppfear_buckets * 8; index++)
pmc_core_display_map(s, index, pf_regs[index / 8], map);
return 0;
diff --git a/drivers/platform/x86/intel_pmc_core.h b/drivers/platform/x86/intel_pmc_core.h
index 89554cba5758..1a0104d2cbf0 100644
--- a/drivers/platform/x86/intel_pmc_core.h
+++ b/drivers/platform/x86/intel_pmc_core.h
@@ -32,7 +32,7 @@
#define SPT_PMC_SLP_S0_RES_COUNTER_STEP 0x64
#define PMC_BASE_ADDR_MASK ~(SPT_PMC_MMIO_REG_LEN - 1)
#define MTPMC_MASK 0xffff0000
-#define PPFEAR_MAX_NUM_ENTRIES 5
+#define PPFEAR_MAX_NUM_ENTRIES 12
#define SPT_PPFEAR_NUM_ENTRIES 5
#define SPT_PMC_READ_DISABLE_BIT 0x16
#define SPT_PMC_MSG_FULL_STS_BIT 0x18
--
2.17.1
next prev parent reply other threads:[~2019-02-13 15:08 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-13 15:08 [PATCH v2 00/10] ICL support and other enhancements for PMC Core Rajneesh Bhardwaj
2019-02-13 15:08 ` [PATCH v2 01/10] platform/x86: intel_pmc_core: Handle CFL regmap properly Rajneesh Bhardwaj
2019-02-13 15:08 ` Rajneesh Bhardwaj [this message]
2019-02-13 15:08 ` [PATCH v2 03/10] platform/x86: intel_pmc_core: Fix PCH IP name Rajneesh Bhardwaj
2019-02-13 15:08 ` [PATCH v2 04/10] platform/x86: intel_pmc_core: Fix file permissions for ltr_show Rajneesh Bhardwaj
2019-02-13 15:08 ` [PATCH v2 05/10] platform/x86: intel_pmc_core: Include Reserved IP for LTR Rajneesh Bhardwaj
2019-02-13 15:08 ` [PATCH v2 06/10] x86/cpu: Add Icelake to Intel family Rajneesh Bhardwaj
2019-02-13 15:23 ` Borislav Petkov
2019-02-13 15:43 ` Bhardwaj, Rajneesh
2019-02-13 16:04 ` Borislav Petkov
2019-02-13 16:35 ` Bhardwaj, Rajneesh
2019-02-13 16:40 ` Dave Hansen
2019-02-13 17:13 ` Bhardwaj, Rajneesh
2019-02-13 17:18 ` Borislav Petkov
2019-02-13 15:08 ` [PATCH v2 07/10] platform/x86: intel_pmc_core: Convert to INTEL_CPU_FAM6 macro Rajneesh Bhardwaj
2019-02-13 15:08 ` [PATCH v2 08/10] platform/x86: intel_pmc_core: Add ICL platform support Rajneesh Bhardwaj
2019-02-13 15:08 ` [PATCH v2 09/10] platform/x86: intel_pmc_core: Add Package cstates residency info Rajneesh Bhardwaj
2019-02-13 15:08 ` [PATCH v2 10/10] platform/x86: intel_pmc_core: Quirk to ignore XTAL shutdown Rajneesh Bhardwaj
2019-02-13 15:21 ` Mario.Limonciello
2019-02-13 15:31 ` Bhardwaj, Rajneesh
2019-02-13 15:33 ` [PATCH v2 00/10] ICL support and other enhancements for PMC Core Andy Shevchenko
2019-02-13 15:49 ` Bhardwaj, Rajneesh
2019-02-13 17:28 ` Andy Shevchenko
2019-02-13 18:02 ` Bhardwaj, Rajneesh
2019-02-13 18:13 ` Andy Shevchenko
2019-02-13 18:15 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190213150810.32750-3-rajneesh.bhardwaj@linux.intel.com \
--to=rajneesh.bhardwaj@linux.intel.com \
--cc=andy@infradead.org \
--cc=david.e.box@intel.com \
--cc=dvhart@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=srinivas.pandruvada@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®