lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <528f7e58507df4b6137856828e371bb8913b8b59.camel@intel.com>
Date:   Mon, 27 Mar 2023 14:50:13 +0000
From:   "Zhang, Rui" <rui.zhang@...el.com>
To:     "rafael@...nel.org" <rafael@...nel.org>
CC:     "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
        "Wysocki, Rafael J" <rafael.j.wysocki@...el.com>,
        "daniel.lezcano@...aro.org" <daniel.lezcano@...aro.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/5] thermal/core: Reset cooling state during cooling
 device unregistration

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@...el.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@...el.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
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ