From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: rafael@kernel.org, daniel.lezcano@linaro.org,
lukasz.luba@arm.com, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] thermal: intel: int340x: Add suspend and resume callbacks
Date: Fri, 22 Aug 2025 15:02:44 +0200 [thread overview]
Message-ID: <CAJZ5v0gZ3w=CWCfaejB+ALrbzeOvDUGynNADQvgvgK-1ENteeQ@mail.gmail.com> (raw)
In-Reply-To: <20250813185530.635096-6-srinivas.pandruvada@linux.intel.com>
On Wed, Aug 13, 2025 at 8:55 PM Srinivas Pandruvada
<srinivas.pandruvada@linux.intel.com> wrote:
>
> During system suspend callback save slider register and restore during
> resume callback.
>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
I would combine this with the first patch.
It doesn't add extra functionality, it's mandatory stuff.
> ---
> .../int340x_thermal/processor_thermal_device.c | 10 ++++++++++
> .../int340x_thermal/processor_thermal_device.h | 2 ++
> .../processor_thermal_soc_slider.c | 15 +++++++++++++++
> 3 files changed, 27 insertions(+)
>
> diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> index 4aea5c9baae9..a772c187bedb 100644
> --- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> +++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> @@ -338,10 +338,17 @@ static int tcc_offset_save = -1;
>
> int proc_thermal_suspend(struct device *dev)
> {
> + struct proc_thermal_device *proc_dev;
> +
> tcc_offset_save = intel_tcc_get_offset(-1);
> if (tcc_offset_save < 0)
> dev_warn(dev, "failed to save offset (%d)\n", tcc_offset_save);
>
> + proc_dev = dev_get_drvdata(dev);
> +
> + if (proc_dev->mmio_feature_mask & PROC_THERMAL_FEATURE_SOC_POWER_SLIDER)
> + proc_thermal_soc_power_slider_suspend(proc_dev);
> +
> return 0;
> }
> EXPORT_SYMBOL_GPL(proc_thermal_suspend);
> @@ -357,6 +364,9 @@ int proc_thermal_resume(struct device *dev)
> if (tcc_offset_save >= 0)
> intel_tcc_set_offset(-1, tcc_offset_save);
>
> + if (proc_dev->mmio_feature_mask & PROC_THERMAL_FEATURE_SOC_POWER_SLIDER)
> + proc_thermal_soc_power_slider_resume(proc_dev);
> +
> return 0;
> }
> EXPORT_SYMBOL_GPL(proc_thermal_resume);
> diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.h b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.h
> index ba3f64742f2f..30760475102f 100644
> --- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.h
> +++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.h
> @@ -130,5 +130,7 @@ int proc_thermal_ptc_add(struct pci_dev *pdev, struct proc_thermal_device *proc_
> void proc_thermal_ptc_remove(struct pci_dev *pdev);
>
> int proc_thermal_soc_power_slider_add(struct pci_dev *pdev, struct proc_thermal_device *proc_priv);
> +void proc_thermal_soc_power_slider_suspend(struct proc_thermal_device *proc_priv);
> +void proc_thermal_soc_power_slider_resume(struct proc_thermal_device *proc_priv);
>
> #endif
> diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_soc_slider.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_soc_slider.c
> index bd4ff26a488b..268bf9124d95 100644
> --- a/drivers/thermal/intel/int340x_thermal/processor_thermal_soc_slider.c
> +++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_soc_slider.c
> @@ -248,6 +248,21 @@ int proc_thermal_soc_power_slider_add(struct pci_dev *pdev, struct proc_thermal_
> }
> EXPORT_SYMBOL_NS_GPL(proc_thermal_soc_power_slider_add, "INT340X_THERMAL");
>
> +static u64 soc_slider_save;
> +
> +void proc_thermal_soc_power_slider_suspend(struct proc_thermal_device *proc_priv)
> +{
> + soc_slider_save = readq(proc_priv->mmio_base + SOC_POWER_SLIDER_OFFSET);
> +
> +}
> +EXPORT_SYMBOL_NS_GPL(proc_thermal_soc_power_slider_suspend, "INT340X_THERMAL");
> +
> +void proc_thermal_soc_power_slider_resume(struct proc_thermal_device *proc_priv)
> +{
> + writeq(soc_slider_save, proc_priv->mmio_base + SOC_POWER_SLIDER_OFFSET);
> +}
> +EXPORT_SYMBOL_NS_GPL(proc_thermal_soc_power_slider_resume, "INT340X_THERMAL");
> +
> MODULE_IMPORT_NS("INT340X_THERMAL");
> MODULE_LICENSE("GPL");
> MODULE_DESCRIPTION("Processor Thermal Power Slider Interface");
> --
> 2.43.0
>
>
prev parent reply other threads:[~2025-08-22 13:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 18:55 [PATCH 0/5] thermal: intel: int340x: New power slider interface Srinivas Pandruvada
2025-08-13 18:55 ` [PATCH 1/5] thermal: intel: int340x: Add support for power slider Srinivas Pandruvada
2025-08-22 12:43 ` Rafael J. Wysocki
2025-08-13 18:55 ` [PATCH 2/5] thermal: intel: int340x: Enable power slider interface Srinivas Pandruvada
2025-08-22 12:47 ` Rafael J. Wysocki
2025-08-13 18:55 ` [PATCH 3/5] thermal: intel: int340x: Add module parameter for balanced Slider Srinivas Pandruvada
2025-08-22 12:50 ` Rafael J. Wysocki
2025-08-13 18:55 ` [PATCH 4/5] thermal: intel: int340x: Add module parameter to change slider offset Srinivas Pandruvada
2025-08-22 13:00 ` Rafael J. Wysocki
2025-08-13 18:55 ` [PATCH 5/5] thermal: intel: int340x: Add suspend and resume callbacks Srinivas Pandruvada
2025-08-22 13:02 ` Rafael J. Wysocki [this message]
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='CAJZ5v0gZ3w=CWCfaejB+ALrbzeOvDUGynNADQvgvgK-1ENteeQ@mail.gmail.com' \
--to=rafael@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--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;
as well as URLs for NNTP newsgroup(s).