From: "Zhang, Rui" <rui.zhang@intel.com>
To: "rafael@kernel.org" <rafael@kernel.org>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
"Pandruvada, Srinivas" <srinivas.pandruvada@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] thermal: intel: intel_soc_dts_iosf: Fix thermal_zone removal
Date: Sun, 13 Aug 2023 03:11:39 +0000 [thread overview]
Message-ID: <04981c3253f462fbb092128aaed372708a16906e.camel@intel.com> (raw)
In-Reply-To: <CAJZ5v0jgvfzN+Ug9G_gLV=NXLvfmuC98XzjLes709g2uypQ5nA@mail.gmail.com>
On Fri, 2023-08-11 at 18:55 +0200, Rafael J. Wysocki wrote:
> On Fri, Aug 11, 2023 at 10:45 AM Zhang Rui <rui.zhang@intel.com>
> wrote:
> >
> > All of the existing callers of remove_dts_thermal_zone() pass a
> > valid
> > pointer as the argument, so checking for the NULL pointer is
> > redundant.
>
> True.
>
> > Plus, when calling remove_dts_thermal_zone() from
> > intel_soc_dts_iosf_init(), it is possible that
> > 1. dts->tzone is an error pointer, when the sensor fails to be
> > registered as a valid thermal zone
> > 2. dts->tzone is unregistered in add_dts_thermal_zone(), when some
> > failure occurs after thermal zone registered
> > In both cases, there is no need to unregister dts->tzone in
> > remove_dts_thermal_zone().
> >
> > Clear dst->tzone when add_dts_thermal_zone() fails. And do thermal
> > zone
> > removal in remove_dts_thermal_zone() only when dts->tzone is set.
>
> Well, I'm not sure.
>
> thermal_zone_device_unregister() will do nothing if the thermal zone
> is not really registered AFAICS
yes.
> and it is prudent to restore
> SOC_DTS_OFFSET_ENABLE on failure IMO.
agreed. Refreshed patch sent.
As this becomes really trivial, feel free to apply it or drop it.
thanks,
rui
prev parent reply other threads:[~2023-08-13 3:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 8:45 Zhang Rui
2023-08-11 16:55 ` Rafael J. Wysocki
2023-08-13 3:11 ` Zhang, Rui [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=04981c3253f462fbb092128aaed372708a16906e.camel@intel.com \
--to=rui.zhang@intel.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=srinivas.pandruvada@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®