Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2022133ybz; Thu, 23 Apr 2020 10:10:15 -0700 (PDT) X-Google-Smtp-Source: APiQypKJVdCbxjZKK4aHujA9wRzvcg3gdpRbVMyZ59CBSO4eXBv/GYVPXi7SMkdP9ZXznnYLa7LI X-Received: by 2002:a17:906:1fd6:: with SMTP id e22mr3648633ejt.150.1587661814608; Thu, 23 Apr 2020 10:10:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587661814; cv=none; d=google.com; s=arc-20160816; b=YF5YRP9FiM+QzRWXoRX67OvBz7g/TdLTXAbRtcufAkLtQLEzRAUSl73pEDnaJ1TI0+ vKAq9RXddGZc8HfJGETJ8fZsSOd0pvyG5eSklInJlkVXYfEhMH6Kwd8EywWHsyrL6y+G Ox3VE54MGEewsZ3JRelufgQCBXOBvgI3iPrWe8o/TOAoiGvoZ2AEJVsAPeqtOP0Z9W9d mMf0ZNDEJk/A5iR2OhEz+i+3cGGSaE9jqNg+chOERVUivxbCopQIJGRF28z8Uxo6/ioO SmCA1I8uiqRSLEY6Ulg6rnfu/Qo09XdI/4JkwFxh3P5f6jS2bCZICJRWwNI9oQ+HJhCZ kiOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=dFFR9FmxHDDayWbUK/V/S9mvxzc40nnciIT6vuQneMA=; b=hDEjFwlf8BGfFNSpNZ/YNhiCVaD+Ywn2hE74oWcsLpwvsTjGJxVtSAnMWghv/N5NX0 YxzCZmiQUeYdkhrHjGr1H1UT+f1TJ7TN/20mU46VNy9xrh1BY48PwHm3tuRk057822Z7 2BU5/C5PAGZX3VTkI3gJUEW6+6yvCm8gRakFXRRoAYotD1FiMblGI9pFzjvb8ujdMky+ ZWQgfAwyrORmZHk3C/zBGiaLn5L+PPRtzhG1waz6Bh7X8e1Z4RXaAuJo4YteNmLD2RZ3 JBPy4CfE3YsFozcqrsjpsz2JaqAOX2MQDc3wpkWzI5MLIfNFu6BusNpoKiql6jSn6TOc Uigw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jRBGlpIA; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s15si1473255edq.231.2020.04.23.10.09.39; Thu, 23 Apr 2020 10:10:14 -0700 (PDT) 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=@kernel.org header.s=default header.b=jRBGlpIA; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729856AbgDWRHV (ORCPT + 99 others); Thu, 23 Apr 2020 13:07:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:48938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729840AbgDWRHV (ORCPT ); Thu, 23 Apr 2020 13:07:21 -0400 Received: from localhost (mobile-166-175-187-210.mycingular.net [166.175.187.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3E0BB2076C; Thu, 23 Apr 2020 17:07:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587661640; bh=yw9wJXzgI852NvRxPmOyJyXU9gysczH5+gd8R6BRqdg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=jRBGlpIAOMr0aJEhtE9qf9xmylLTnD1+54cwHWFclX7d4jCcl2dYjP2Ky/QQ44gSB cw+8hXorBVHvZRIKuHFLtZExR5YTTmPk8/qfasQtq4F55wkr9CzeWvU9INQJntPHzP 74k2wAD7i4pxKssLvx8nwPa1cqjoK93h+egLbs1w= Date: Thu, 23 Apr 2020 12:07:18 -0500 From: Bjorn Helgaas To: "Rafael J. Wysocki" Cc: Linux PM , Alan Stern , Linux ACPI , Linux PCI , LKML , Greg Kroah-Hartman , Mika Westerberg , Hans De Goede , Ulf Hansson Subject: Re: [PATCH v2 0/9] PM: sleep: core: Rearrange the handling of driver power management flags Message-ID: <20200423170718.GA190576@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5673945.BT02kTCndr@kreacher> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 18, 2020 at 06:23:08PM +0200, Rafael J. Wysocki wrote: > Hi, > > This is an update including some fixes and extra patches based on the > continuation of the discussion [1]. > > On Friday, April 10, 2020 5:46:27 PM CEST Rafael J. Wysocki wrote: > > Hi Alan, > > > > Following our recent discussion regarding the DPM_FLAG_* family of flags [1], > > I have decided to follow some of your recommendations and make changes to the > > core code handling those flags. > > > > The purpose of this is basically to make the code more consistent internally, > > easier to follow and better documented. > > > > First of all, patch [1/7] changes the PM core to skip driver-level "late" > > and "noirq" suspend callbacks for devices with SMART_SUSPEND set if they are > > still runtime-suspended during the "late" system-wide suspend phase (without > > the patch it does that only if subsystem-level late/noirq/early suspend/resume > > callbacks are not present for the device, which is demonstrably inconsistent) > > and updates the resume part of the code accordingly (it doesn't need to check > > whether or not the subsystem-level callbacks are present any more). > > > > The next patch, [2/7], is purely cosmetic and its only purpose is to reduce > > the LOC number and move related pieces of code closer to each other. > > The first two patches have not changed. > > > Patch [3/7] changes the PM core so that it doesn't skip any subsystem-level > > callbacks during system-wide resume (without the patch they may be skipped in > > the "early resume" and "resume" phases due to LEAVE_SUSPENDED being set which > > may be problematic) and to always run the driver's ->resume callback if the > > corresponding subsystem-level callback is not present (without the patch it > > may be skipped if LEAVE_SUSPENDED is set) to let it reverse the changes made > > by the driver's ->suspend callback (which always runs too) if need be. > > The difference between this one and patch [3/9] in the v2 is the fixed > definition of dev_pm_may_skip_resume(), renamed to dev_pm_skip_resume() by > one of the next patches. > > Patch [4/9] changes the handling of the power.may_skip_resume flag to set it > to 'true' by default and updates the subsystems aware of it to clear it when > they don't want devices to stay in suspend. > > > Patches [4-6/7] rename one function in the PM core and two driver PM flags to > > make their names better reflect their purpose. > > These are patches [5/9] and [7-8/9] in the v2 and patch [6/9] renames > dev_pm_smart_suspend_and_suspended() to dev_pm_skip_suspend(). > > > Finally, patch [7/7] updates the documentation of the driver PM flags to > > reflect the new code flows. > > This patch [9/9] now and it has been updated to reflect the new code changes. > > The pm-sleep-core branch: > > git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \ > pm-sleep-core > > contains the v2 now. For the drivers/pci parts: Acked-by: Bjorn Helgaas