Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp398709pxb; Fri, 8 Jan 2021 07:47:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzcLon+CCI2vxgnP+idiUDG8QxSKZlrMdlP/fgz4dC9Hz4vS7QoqlZojXIJbvDq2WjDxW3C X-Received: by 2002:aa7:dc0d:: with SMTP id b13mr5723348edu.170.1610120847700; Fri, 08 Jan 2021 07:47:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610120847; cv=none; d=google.com; s=arc-20160816; b=lpJdcmoOusny69839oR9EvsuEwV1hG5q9NIJcFJ2tg1U/9GM1hMkVqqwxQNpuHogP5 MfIjQG1QIdZLkJKDaL+sky+otp2TG43YvlJ/H7OE2MB6GKV0IaWORd5ol89nyYfTDT2U Th/cwNbarlLzNvhhvClND2blzBkrtLlXL31ct2J2h/gtUJEL1cgBEdxS5cW6QtBmJSr1 i5LMFXhX+doPP+EhHB0a7O7oNDYv3CprbuPbmAVKEYPXHcQkuiYn2CvbqHRiLDjNo2XK zT0Pxk7Ll8I4qtGvl18fF4p5NlGUJgaGbd62UM2Qsbd2Vg3Hf6rtIop/DHEZyhDC/ypg GjHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GEkfO2TtFYdiKhVGTO0Tgl+lms/n9EGpC+7XpyDaXno=; b=iSDYqx3bTjtwtWuk+2j1AiOYcKuacWMHoknoerSN+fMeOYhPjieEp3pcTBn5BM2pPZ bFPHl7uNw6rWlmsDjiGt4IQ/SddrwdvCkWczpgWWeW48KxfkLogYBvY2eHT45wS4BPAZ 2GvZg2yGHda1ILXWKTTIzMz8yj6J2pREQMngoj5Fe3LPcIQljDTjlxfraRMlcimNnQbT cnzTqKtfgt+LoY7OQLCuRxcsL/MPQaWVxDG9zPhwTardQ3ci6nsRQks3BtI0kP64hhKp 7/f+mt8XTe2eCqkwkqyjgBnCxbuocvaHWGuKsVKehd+L6CSiY7kQ6wNjHOxewCBUbkdk VK4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="jFsGz/lC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n27si3525315ejh.345.2021.01.08.07.47.04; Fri, 08 Jan 2021 07:47:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="jFsGz/lC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727811AbhAHPoX (ORCPT + 99 others); Fri, 8 Jan 2021 10:44:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:59472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbhAHPoX (ORCPT ); Fri, 8 Jan 2021 10:44:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D4DAD23888; Fri, 8 Jan 2021 15:43:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610120622; bh=Bs/0LWZLuK53rX4OHj50gHqhKLt+LXdjjswb1+DP8gs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jFsGz/lC6Pu2kxYEjYewrtJAf1LALJehgFxbrMi1VQeFJ7oal6oNq6wlUSPPbD5i0 HjFTPyxf+QQqCd9cQDmJJFHvQUIUQ5MjipvFzR9l73yF1B99V3nXKAoN5UIqfvZYe6 7Wine9ZZXNMezottdi7mLnRdxLLkn3wb8bd+q5pw= Date: Fri, 8 Jan 2021 16:44:59 +0100 From: Greg Kroah-Hartman To: Furquan Shaikh Cc: "Rafael J . Wysocki" , Linux Kernel Mailing List , ACPI Devel Maling List Subject: Re: [PATCH] drivers: core: Detach device from power domain on shutdown Message-ID: References: <20201201213019.1558738-1-furquan@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 14, 2020 at 08:56:48PM -0800, Furquan Shaikh wrote: > On Tue, Dec 1, 2020 at 1:30 PM Furquan Shaikh wrote: > > > > 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 > > --- > > 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 > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -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); > > -- > > 2.29.2.454.gaff20da3a2-goog > > > > Hello, > > Gentle ping. Just checking if there are any comments. I'll wait for Rafael to ack this before taking it... thanks, greg k-h