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: <b4a931cf-5974-64d0-fdf2-693e418f3110@gmail.com>
Date:   Wed, 13 Jan 2021 17:30:38 +0300
From:   Dmitry Osipenko <digetx@...il.com>
To:     Furquan Shaikh <furquan@...gle.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     "Rafael J. Wysocki" <rafael@...nel.org>,
        Thierry Reding <thierry.reding@...il.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        "linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>
Subject: Re: [PATCH] drivers: core: Detach device from power domain on
 shutdown

13.01.2021 04:22, Furquan Shaikh пишет:
> On Tue, Jan 12, 2021 at 5:09 AM Greg Kroah-Hartman
> <gregkh@...uxfoundation.org> wrote:
>>
>> On Tue, Jan 12, 2021 at 01:45:25PM +0100, Rafael J. Wysocki wrote:
>>> On Tue, Jan 12, 2021 at 10:55 AM Dmitry Osipenko <digetx@...il.com> wrote:
>>>>
>>>> 02.12.2020 00:30, Furquan Shaikh пишет:
>>>>> When the system is powered off or rebooted, devices are not detached
>>>>> from their PM domain. This results in ACPI PM not being invoked and
>>>>> hence PowerResouce _OFF method not being invoked for any of the
>>>>> devices. Because the ACPI power resources are not turned off in case
>>>>> of poweroff and reboot, it violates the power sequencing requirements
>>>>> which impacts the reliability of the devices over the lifetime of the
>>>>> platform. This is currently observed on all Chromebooks using ACPI.
>>>>>
>>>>> In order to solve the above problem, this change detaches a device
>>>>> from its PM domain whenever it is shutdown. This action is basically
>>>>> analogous to ->remove() from driver model perspective. Detaching the
>>>>> device from its PM domain ensures that the ACPI PM gets a chance to
>>>>> turn off the power resources for the device thus complying with its
>>>>> power sequencing requirements.
>>>>>
>>>>> Signed-off-by: Furquan Shaikh <furquan@...gle.com>
>>>>> ---
>>>>>  drivers/base/core.c | 3 +++
>>>>>  1 file changed, 3 insertions(+)
>>>>>
>>>>> diff --git a/drivers/base/core.c b/drivers/base/core.c
>>>>> index d661ada1518f..5823f1d719e1 100644
>>>>> --- a/drivers/base/core.c
>>>>> +++ b/drivers/base/core.c
>>>>> @@ -23,6 +23,7 @@
>>>>>  #include <linux/of_device.h>
>>>>>  #include <linux/genhd.h>
>>>>>  #include <linux/mutex.h>
>>>>> +#include <linux/pm_domain.h>
>>>>>  #include <linux/pm_runtime.h>
>>>>>  #include <linux/netdevice.h>
>>>>>  #include <linux/sched/signal.h>
>>>>> @@ -4057,6 +4058,8 @@ void device_shutdown(void)
>>>>>                       dev->driver->shutdown(dev);
>>>>>               }
>>>>>
>>>>> +             dev_pm_domain_detach(dev, true);
>>>>> +
>>>>>               device_unlock(dev);
>>>>>               if (parent)
>>>>>                       device_unlock(parent);
>>>>>
>>>>
>>>> This patch broke system shutdown on NVIDIA Tegra using today's
>>>> linux-next because power domain can't be turned off until device drivers
>>>> handed control over device resets to the power domain of Power
>>>> Management controller on Tegra. This patch introduced the wrong
>>>> behaviour, apparently it should be made specific to ACPI only.
>>>>
>>>> Please fix, thanks in advance.
> 
> Sorry about the breakage. I am working on an alternate solution that
> Rafael suggested.
> 
>>>
>>> OK, so Greg please drop it.
>>
>> Now reverted, thanks.
> 
> Thanks Greg!

Thank you all for addressing this problem!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ