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>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/5] thermal/core: Reset cooling state during cooling device unregistration
Date: Mon, 27 Mar 2023 14:50:13 +0000 [thread overview]
Message-ID: <528f7e58507df4b6137856828e371bb8913b8b59.camel@intel.com> (raw)
In-Reply-To: <CAJZ5v0gze1wBEMcuEu4Aa9343rh-3=Bu+pdSYuY3stMd8QGf0A@mail.gmail.com>
On Fri, 2023-03-24 at 14:19 +0100, Rafael J. Wysocki wrote:
> On Fri, Mar 24, 2023 at 8:08 AM Zhang Rui <rui.zhang@intel.com>
> wrote:
> > When unregistering a cooling device, it is possible that the
> > cooling
> > device has been activated. And once the cooling device is
> > unregistered,
> > no one will deactivate it anymore.
> >
> > Reset cooling state during cooling device unregistration.
> >
> > Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> > ---
> > In theory, this problem that this patch fixes can be triggered on a
> > platform with ACPI Active cooling, by
> > 1. overheat the system to trigger ACPI active cooling
> > 2. unload ACPI fan driver
> > 3. check if the fan is still spinning
> > But I don't have such a system so I didn't trigger then problem and
> > I
> > only did build & boot test.
>
> So I'm not sure if this change is actually safe.
>
> In the example above, the system will still need the fan to spin
> after
> the ACPI fan driver is unloaded in order to cool down, won't it?
Then we can argue that the ACPI fan driver should not be unloaded in
this case.
Actually, this is the same situation as patch 1/5.
Patch 1/5 fixes the problem that cooling state not restored to 0 when
unloading the thermal driver, and this fixes the same problem when
unloading the cooling device driver.
thanks,
rui
>
> > ---
> > drivers/thermal/thermal_core.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/thermal/thermal_core.c
> > b/drivers/thermal/thermal_core.c
> > index 30ff39154598..fd54e6c10b60 100644
> > --- a/drivers/thermal/thermal_core.c
> > +++ b/drivers/thermal/thermal_core.c
> > @@ -1192,6 +1192,10 @@ void
> > thermal_cooling_device_unregister(struct thermal_cooling_device
> > *cdev)
> > }
> > }
> >
> > + mutex_lock(&cdev->lock);
> > + cdev->ops->set_cur_state(cdev, 0);
> > + mutex_unlock(&cdev->lock);
> > +
> > mutex_unlock(&thermal_list_lock);
> >
> > device_unregister(&cdev->device);
> > --
> > 2.25.1
> >
next prev parent reply other threads:[~2023-03-27 14:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-24 7:08 [PATCH v2 1/5] thermal/core: Update cooling device during thermal zone unregistration Zhang Rui
2023-03-24 7:08 ` [PATCH 2/5] thermal/core: Reset cooling state during cooling device unregistration Zhang Rui
2023-03-24 13:19 ` Rafael J. Wysocki
2023-03-27 14:50 ` Zhang, Rui [this message]
2023-03-27 15:13 ` Rafael J. Wysocki
2023-03-28 2:46 ` Zhang, Rui
2023-03-28 17:54 ` Rafael J. Wysocki
2023-03-29 6:28 ` Zhang, Rui
2023-03-24 7:08 ` [PATCH 3/5] thermal/core: Remove thermal_bind_params structure Zhang Rui
2023-03-29 18:39 ` Rafael J. Wysocki
2023-03-30 1:11 ` Zhang, Rui
2023-03-24 7:08 ` [PATCH 4/5] thermal/core: Enforce paired .bind/.unbind callbacks Zhang Rui
2023-03-24 13:24 ` Rafael J. Wysocki
2023-03-24 13:25 ` Rafael J. Wysocki
2023-03-27 15:03 ` Zhang, Rui
2023-03-24 7:08 ` [PATCH 5/5] thermal/core: Avoid unbind for thermal zones without .unbind() 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=528f7e58507df4b6137856828e371bb8913b8b59.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 \
/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®