public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "David E. Box" <david.e.box@linux.intel.com>
To: david.e.box@linux.intel.com, hdegoede@redhat.com,
	ilpo.jarvinen@linux.intel.com, rajvi.jingar@linux.intel.com,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/8] platform/x86/intel/pmc: Add suspend callback
Date: Fri, 22 Dec 2023 19:25:43 -0800	[thread overview]
Message-ID: <20231223032548.1680738-4-david.e.box@linux.intel.com> (raw)
In-Reply-To: <20231223032548.1680738-1-david.e.box@linux.intel.com>

Add a suspend callback to struct pmc for performing platform specific tasks
before device suspend. This is needed in order to perform GBE LTR ignore on
certain platforms at suspend-time instead of at probe-time and replace the
GBE LTR ignore removal that was done in order to fix a bug introduced by
commit 804951203aa5 ("platform/x86:intel/pmc: Combine core_init() and
core_configure()").

Fixes: 804951203aa5 ("platform/x86:intel/pmc: Combine core_init() and core_configure()")
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
---
 drivers/platform/x86/intel/pmc/core.c | 3 +++
 drivers/platform/x86/intel/pmc/core.h | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
index cdaab728e942..31905003bb05 100644
--- a/drivers/platform/x86/intel/pmc/core.c
+++ b/drivers/platform/x86/intel/pmc/core.c
@@ -1430,6 +1430,9 @@ static __maybe_unused int pmc_core_suspend(struct device *dev)
 	struct pmc_dev *pmcdev = dev_get_drvdata(dev);
 	struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
 
+	if (pmcdev->suspend)
+		pmcdev->suspend(pmcdev);
+
 	/* Check if the syspend will actually use S0ix */
 	if (pm_suspend_via_firmware())
 		return 0;
diff --git a/drivers/platform/x86/intel/pmc/core.h b/drivers/platform/x86/intel/pmc/core.h
index 2891d8d04fad..ce9b9efc9790 100644
--- a/drivers/platform/x86/intel/pmc/core.h
+++ b/drivers/platform/x86/intel/pmc/core.h
@@ -389,6 +389,7 @@ struct pmc {
  * @s0ix_counter:	S0ix residency (step adjusted)
  * @num_lpm_modes:	Count of enabled modes
  * @lpm_en_modes:	Array of enabled modes from lowest to highest priority
+ * @suspend:		Function to perform platform specific suspend
  * @resume:		Function to perform platform specific resume
  *
  * pmc_dev contains info about power management controller device.
@@ -406,6 +407,7 @@ struct pmc_dev {
 	u64 s0ix_counter;
 	int num_lpm_modes;
 	int lpm_en_modes[LPM_MAX_NUM_MODES];
+	void (*suspend)(struct pmc_dev *pmcdev);
 	int (*resume)(struct pmc_dev *pmcdev);
 
 	bool has_die_c6;
-- 
2.34.1


  parent reply	other threads:[~2023-12-23  3:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-23  3:25 [PATCH 0/8] Intel PMC Core GBE LTR regression fix David E. Box
2023-12-23  3:25 ` [PATCH 1/8] platform/x86/intel/pmc/arl.c: Remove probe time LTR ignore David E. Box
2023-12-23  3:25 ` [PATCH 2/8] platform/x86/intel/pmc/lnl.c: " David E. Box
2023-12-23  3:25 ` David E. Box [this message]
2023-12-23  3:25 ` [PATCH 4/8] platform/x86/intel/pmc: Allow reenabling LTRs David E. Box
2023-12-27 17:54   ` Ilpo Järvinen
2023-12-28 15:43     ` Ilpo Järvinen
2023-12-23  3:25 ` [PATCH 5/8] platform/x86/intel/pmc: Move GBE LTR ignore to suspend callback David E. Box
2023-12-23  3:25 ` [PATCH 6/8] platform/x86/intel/pmc/arl: Add GBE LTR ignore during suspend David E. Box
2024-01-02 12:24   ` Hans de Goede
2023-12-23  3:25 ` [PATCH 7/8] platform/x86/intel/pmc/lnl: " David E. Box
2024-01-02 12:24   ` Hans de Goede
2023-12-23  3:25 ` [PATCH 8/8] platform/x86/intel/pmc: Add missing extern David E. Box
2024-01-02 12:24   ` Hans de Goede
2023-12-27 18:14 ` [PATCH 0/8] Intel PMC Core GBE LTR regression fix Ilpo Järvinen
2023-12-28  9:35   ` Hans de Goede
2023-12-28 15:38     ` Ilpo Järvinen

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=20231223032548.1680738-4-david.e.box@linux.intel.com \
    --to=david.e.box@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rajvi.jingar@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