Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4262ybz; Tue, 21 Apr 2020 03:35:07 -0700 (PDT) X-Google-Smtp-Source: APiQypJVRchlKbZGxLRZOk/zPn2yPBotb9Otmh9zlax9TYtrGslHSrvli0RNNlS4q3fS2g9uqEhW X-Received: by 2002:a17:906:4553:: with SMTP id s19mr20070140ejq.295.1587465307121; Tue, 21 Apr 2020 03:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587465307; cv=none; d=google.com; s=arc-20160816; b=SPIO58oc42p6EsTprqSXEMfFSS/A5PsEtw5u61nQupB6Z54C7El2bt9bU9h+V8HcPY f3qUUyr84Va20jZOa/QFJyDf00Pz4sv68SsrTdnFLEMqfcdNZIciMWDdt2ib4jm8/p+S /oTZ/RRBS8mAoRIdlss8EnpnFnkXNiZ/6jDpPbvBL920+nhUvUL3KK+9NQHJ+3HVTbZz wbb+Zaa4/yPVuFOsqbydPCXoKN2GACtsSO4Sf2OpVCzPiEdG4Yy8iB/PXeX70QG0uFQW BANiE62JpdkLFEz6t0Wlgoh2AJtvKOMWLNVBNIjej/Lcp7BeYyJu0knbQf21RWDGXUzS V6Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+Nmmt4cUyHLEe6qve6WvcXD9XM2QrRLQtbhGo4+r1qY=; b=lOFdKxPXc6p9nVrDr66Q/r6fxs962KmNwJGYlfHQUQ8ndYC8ZuPNMi6+5EzO6XKPm5 WNTU9IjLl3aBjQ8XCxw3p6Pe90ISLdCwwkDB1ZApKtExRCNY1rr7mzogsQEhAXp3P5SA 90n3nyT75ZkKDS+dp8cWwqJvUkFAlO0U0JqHfKN4N468pkwZH1sZdHjROwp6HyqIGGd5 X84AVaqxoxxzJqOAiLQlziemCopS6ihlZHF8shDqJpNiFdAPnJqL96sc9LfSGDwiVV3a sBVY8s2scv18TRYV3zJAyOMsUgdnNg5jvoRRv9Y2VmiMdfv33Tr8jauQbOEVOdf3orFk jSqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KycdRg1y; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h13si1339851edw.475.2020.04.21.03.34.42; Tue, 21 Apr 2020 03:35:07 -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=@linaro.org header.s=google header.b=KycdRg1y; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728647AbgDUKa6 (ORCPT + 99 others); Tue, 21 Apr 2020 06:30:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728162AbgDUKa5 (ORCPT ); Tue, 21 Apr 2020 06:30:57 -0400 Received: from mail-ua1-x944.google.com (mail-ua1-x944.google.com [IPv6:2607:f8b0:4864:20::944]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C426C061A0F for ; Tue, 21 Apr 2020 03:30:56 -0700 (PDT) Received: by mail-ua1-x944.google.com with SMTP id a6so4861436uao.2 for ; Tue, 21 Apr 2020 03:30:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+Nmmt4cUyHLEe6qve6WvcXD9XM2QrRLQtbhGo4+r1qY=; b=KycdRg1y9oQM3pZPaP3bxRnhvW1zUmoQIZW2WRzxFR2dQn/3L4nMD8XzdppM8rTkZ1 m8aCfMmSkq/htN3OrmP7HBWGtLYHToudPjD8M8ZqZD+PW90JzYDbk0WqZP+D4YFljGJ4 VKCkoDHOYm82W6pyaTLd5gjAuSdQnWwL5SM2tXDmCG0d2VAvVArx7zWPt9Y+Dplm9ykj AwnU3caAvLH/DIlTeloP07h0x+NMLq+s8LVzkPbObaHMecie8vvUYuJKAiPLGebkdG5o Hb5JUODBuPGnGPHLnCglQWCwG/GlsoJhEaAg3FskzyNDu3V2k1CTXv6Ahy0ruIzMoaLh kddw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+Nmmt4cUyHLEe6qve6WvcXD9XM2QrRLQtbhGo4+r1qY=; b=JQ8CULZtOeYdp/4nQRohK5Vc4QMFsOZyj+wYTy1vuUUJBh13G29+5j6YKSH+w9sAD+ OrFhr4SGY4PU7/C9tqF9UyWn445eSeJk+JCGqz6aWJwmhCEskqwA8g5w5wcF5yzhBFv+ hsfYhPptX0gO1YP+sz+v0bbeRsB14PNUXTcNxRJkbWuFx0m87N1SSUO4A/j1F5D/sex2 vdD/dAmLpU3mNgPLF9rBM9zR4dvY+Pra85Twas4vuJAoEem9TZhURJCHgoKHscex1xtD Pei86GIRH5AHNkkrj89HzLD6BquEeax8mbcs3U5bWR3zyfN0tNkQg6bmOJ8NL7nGhssM 7jlQ== X-Gm-Message-State: AGi0Puat/cQSL8sQfJCgXXwV+OzqKl4SYiOGrsaUzvCvBVgNjrkCFG3e QDtUBEcf2jLScPFD6o8oNr0WSCLXgYYE+nMJoYM1Mdaj X-Received: by 2002:a9f:25af:: with SMTP id 44mr11675574uaf.104.1587465054589; Tue, 21 Apr 2020 03:30:54 -0700 (PDT) MIME-Version: 1.0 References: <1888197.j9z7NJ8yPn@kreacher> <5673945.BT02kTCndr@kreacher> In-Reply-To: <5673945.BT02kTCndr@kreacher> From: Ulf Hansson Date: Tue, 21 Apr 2020 12:30:18 +0200 Message-ID: Subject: Re: [PATCH v2 0/9] PM: sleep: core: Rearrange the handling of driver power management flags To: "Rafael J. Wysocki" Cc: Linux PM , Alan Stern , Linux ACPI , Linux PCI , LKML , Bjorn Helgaas , Greg Kroah-Hartman , Mika Westerberg , Hans De Goede Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 18 Apr 2020 at 19:11, 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. > > Cheers! Rafael, apologize for taking some time to review and respond. I noticed you have queued this up on your next branch by now, good. In any case, I have looked through the series and I think it looks good, thanks! Kind regards Uffe > > > [1] https://lore.kernel.org/linux-pm/Pine.LNX.4.44L0.2003251631360.1724-100000@netrider.rowland.org/ > > >