From: Mario Limonciello <mario.limonciello@amd.com>
To: "Rafael J . Wysocki" <rafael@kernel.org>,
Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>,
David E Box <david.e.box@intel.com>
Cc: Sven van Ashbrook <svenva@chromium.org>,
Raul Rangel <rrangel@chromium.org>, <linux-pm@vger.kernel.org>,
<platform-driver-x86@vger.kernel.org>,
Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
John Stultz <jstultz@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Stephen Boyd <sboyd@kernel.org>,
S-k Shyam-sundar <Shyam-sundar.S-k@amd.com>,
Rajat Jain <rajatja@google.com>,
Hans de Goede <hdegoede@redhat.com>,
<linux-kernel@vger.kernel.org>
Subject: [RFC v3 2/4] platform/x86/intel/pmc: core: Drop check_counters
Date: Tue, 15 Nov 2022 14:01:54 -0600 [thread overview]
Message-ID: <20221115200156.12218-3-mario.limonciello@amd.com> (raw)
In-Reply-To: <20221115200156.12218-1-mario.limonciello@amd.com>
`check_counters` is a stateful variable for indicating whether or
not to be checking if counters incremented on resume from s2idle.
As the module already has code to gate whether to check the counters
that will fail the suspend when this is enabled, use that instead.
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
RFC v2->v3:
* New patch
---
drivers/platform/x86/intel/pmc/core.c | 7 ++-----
drivers/platform/x86/intel/pmc/core.h | 1 -
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
index 17ec5825d13d..adc2cae4db28 100644
--- a/drivers/platform/x86/intel/pmc/core.c
+++ b/drivers/platform/x86/intel/pmc/core.c
@@ -2059,8 +2059,6 @@ static __maybe_unused int pmc_core_suspend(struct device *dev)
{
struct pmc_dev *pmcdev = dev_get_drvdata(dev);
- pmcdev->check_counters = false;
-
/* No warnings on S0ix failures */
if (!warn_on_s0ix_failures)
return 0;
@@ -2077,7 +2075,6 @@ static __maybe_unused int pmc_core_suspend(struct device *dev)
if (pmc_core_dev_state_get(pmcdev, &pmcdev->s0ix_counter))
return -EIO;
- pmcdev->check_counters = true;
return 0;
}
@@ -2113,10 +2110,10 @@ static __maybe_unused int pmc_core_resume(struct device *dev)
const struct pmc_bit_map **maps = pmcdev->map->lpm_sts;
int offset = pmcdev->map->lpm_status_offset;
- if (!pmcdev->check_counters)
+ if (!pmc_core_is_s0ix_failed(pmcdev))
return 0;
- if (!pmc_core_is_s0ix_failed(pmcdev))
+ if (!warn_on_s0ix_failures)
return 0;
if (pmc_core_is_pc10_failed(pmcdev)) {
diff --git a/drivers/platform/x86/intel/pmc/core.h b/drivers/platform/x86/intel/pmc/core.h
index 7a059e02c265..5687e91e884c 100644
--- a/drivers/platform/x86/intel/pmc/core.h
+++ b/drivers/platform/x86/intel/pmc/core.h
@@ -316,7 +316,6 @@ struct pmc_reg_map {
* @pmc_xram_read_bit: flag to indicate whether PMC XRAM shadow registers
* used to read MPHY PG and PLL status are available
* @mutex_lock: mutex to complete one transcation
- * @check_counters: On resume, check if counters are getting incremented
* @pc10_counter: PC10 residency counter
* @s0ix_counter: S0ix residency (step adjusted)
* @num_lpm_modes: Count of enabled modes
--
2.34.1
next prev parent reply other threads:[~2022-11-15 20:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-15 20:01 [RFC v3 0/4] Make it easier to measure % in HW sleep state Mario Limonciello
2022-11-15 20:01 ` [RFC v3 1/4] PM: Add a sysfs file to represent the total sleep duration Mario Limonciello
2022-11-15 20:44 ` John Stultz
2022-11-16 2:40 ` Limonciello, Mario
2022-11-15 20:01 ` Mario Limonciello [this message]
2022-11-15 20:01 ` [RFC v3 3/4] platform/x86/amd: pmc: Report duration of time in deepest hw state Mario Limonciello
2022-11-15 20:01 ` [RFC v3 4/4] platform/x86/amd: pmc: Populate cpuidle sysfs file with hw sleep data Mario Limonciello
2022-11-17 14:10 ` [RFC v3 0/4] Make it easier to measure % in HW sleep state Hans de Goede
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=20221115200156.12218-3-mario.limonciello@amd.com \
--to=mario.limonciello@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=david.e.box@intel.com \
--cc=hdegoede@redhat.com \
--cc=irenic.rajneesh@gmail.com \
--cc=jstultz@google.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rajatja@google.com \
--cc=rrangel@chromium.org \
--cc=sboyd@kernel.org \
--cc=svenva@chromium.org \
--cc=tglx@linutronix.de \
/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®