linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Furquan Shaikh <furquan@google.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH] drivers: core: Detach device from power domain on shutdown
Date: Tue, 12 Jan 2021 12:55:38 +0300	[thread overview]
Message-ID: <e77e0569-568a-f7fb-9f0d-e64943b467f0@gmail.com> (raw)
In-Reply-To: <20201201213019.1558738-1-furquan@google.com>

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

  parent reply	other threads:[~2021-01-12  9:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 21:30 [PATCH] drivers: core: Detach device from power domain on shutdown Furquan Shaikh
2020-12-15  4:56 ` Furquan Shaikh
2021-01-08 15:44   ` Greg Kroah-Hartman
2021-01-08 15:49     ` Rafael J. Wysocki
2021-01-08 15:49 ` Rafael J. Wysocki
2021-01-12  9:55 ` Dmitry Osipenko [this message]
2021-01-12 12:45   ` Rafael J. Wysocki
2021-01-12 13:10     ` Greg Kroah-Hartman
2021-01-13  1:22       ` Furquan Shaikh
2021-01-13 14:30         ` Dmitry Osipenko
2021-02-04  2:37           ` Kai-Heng Feng
2021-02-04  4:09             ` Furquan Shaikh
2021-02-04  5:19               ` Kai-Heng Feng

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=e77e0569-568a-f7fb-9f0d-e64943b467f0@gmail.com \
    --to=digetx@gmail.com \
    --cc=furquan@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=thierry.reding@gmail.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;
as well as URLs for NNTP newsgroup(s).