From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: "Zhang, Rui" <rui.zhang@intel.com>,
"lukasz.luba@arm.com" <lukasz.luba@arm.com>,
"rafael@kernel.org" <rafael@kernel.org>,
"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] thermal: intel: int340x: Allow temperature override
Date: Fri, 06 Jun 2025 14:19:00 -0700 [thread overview]
Message-ID: <1c48e672c98c079b36ebe7ef8f2e313866c66972.camel@linux.intel.com> (raw)
In-Reply-To: <0fcd95bc6e9b300caa7d3029c9c43e9b5de6627e.camel@intel.com>
On Fri, 2025-06-06 at 07:22 +0000, Zhang, Rui wrote:
> On Thu, 2025-06-05 at 10:20 -0700, srinivas pandruvada wrote:
> > > >
> > > > int proc_thermal_ptc_add(struct pci_dev *pdev, struct
> > > > proc_thermal_device *proc_priv)
> > > > {
> > > > @@ -230,10 +289,13 @@ int proc_thermal_ptc_add(struct pci_dev
> > > > *pdev,
> > > > struct proc_thermal_device *proc_
> > > >
> > > > for (i = 0; i < PTC_MAX_INSTANCES; i++) {
> > > > ptc_instance[i].offset =
> > > > ptc_offsets[i];
> > > > + ptc_instance[i].pdev = pdev;
> > > > ptc_create_groups(pdev, i,
> > > > &ptc_instance[i]);
> > > > }
> > > > }
> > > >
> > > > + ptc_create_debugfs();
> > > > +
> > >
> > > should we create the debugfs only when PROC_THERMAL_FEATURE_PTC
> > > is
> > > set?
> >
> > This function is only called when
> > if (feature_mask & PROC_THERMAL_FEATURE_PTC) {
> > }
> >
> >
> right, then the
> if (proc_priv->mmio_feature_mask & PROC_THERMAL_FEATURE_PTC)
> check in proc_thermal_ptc_add() is redundant.
Yes.
>
>
> BTW, in proc_thermal_mmio_add() and proc_thermal_mmio_remove(), we
>
> 1. call the rapl/ptc/rfim/wt_req/wt_hint .add() functions with the
> feature mask check in proc_thermal_mmio_add()
>
> 2. call the .remove() functions without the feature mask check in
> failure
> cases in proc_thermal_mmio_add().
The current functions in the upstream code are for:
proc_thermal_rfim_remove(pdev);
This is already protected inside as it has to check each feature.
proc_thermal_rapl_remove();
This is by virtue of rapl_mmio_priv.control_type is NULL on error, so
the above function will return.
proc_thermal_ptc_remove() is also protected by the flag. But you are
right for the debugfs part added with this patch, which should be
inside the flag check.
>
> 3. call the .remove() functions with feature mask check in
> proc_thermal_mmio_remove()
>
> This is inconsistent. If you agree, I'd like to propose a cleanup
> patch
> to make them work in a unified way.
You can make a cleanup patch to be consistent.
Thanks,
Srinivas
>
> thanks,
> rui
next prev parent reply other threads:[~2025-06-06 21:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-04 20:35 [PATCH 1/2] thermal: intel: int340x: Add performance control for platform temperature control Srinivas Pandruvada
2025-06-04 20:35 ` [PATCH 2/2] thermal: intel: int340x: Allow temperature override Srinivas Pandruvada
2025-06-05 2:18 ` Zhang, Rui
2025-06-05 17:20 ` srinivas pandruvada
2025-06-06 7:22 ` Zhang, Rui
2025-06-06 21:19 ` srinivas pandruvada [this message]
2025-06-04 20:55 ` [PATCH 1/2] thermal: intel: int340x: Add performance control for platform temperature control Rafael J. Wysocki
2025-06-04 21:40 ` srinivas pandruvada
2025-06-05 3:06 ` Zhang, Rui
2025-06-05 17:25 ` srinivas pandruvada
2025-06-06 7:34 ` Zhang, Rui
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=1c48e672c98c079b36ebe7ef8f2e313866c66972.camel@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=rafael@kernel.org \
--cc=rui.zhang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.