Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp733198ybb; Fri, 10 Apr 2020 09:01:56 -0700 (PDT) X-Google-Smtp-Source: APiQypJYtA72p7oyNwXHWTnDDr7xbFSXcHoLebGzDLTNmRXD+0eoBYPcU6jTnrAGAmqRrS8JFjtg X-Received: by 2002:ae9:efc8:: with SMTP id d191mr4743299qkg.31.1586534516256; Fri, 10 Apr 2020 09:01:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586534516; cv=none; d=google.com; s=arc-20160816; b=nfUcl0zv+nLGVOMmgYwNw3vEiqqKocWZTKx2RTGTIcC3VLg97RIeOi+jcS4Tw/DGCT VfoERj5pM5XWLVliwux7CGjU5Or5IQJupuy/Ml9unpkveKMQWFvVHIJJ2v/5oSWRFdSA wcLKApt6U4Nvrx/jA0wmrZDe8CegtT7gql/nbwm9X9SYvhKSbS6KC2nDophgoOlVlr5l grms+wAxBl0lZsTVgwb4BXJAK7bxTikc8WP19aviGtbPHppmf5WDAmkLLEMw1v2sA7z8 ++ewAqQtRZupt08pMNsPlz3qPakvqJM8+iJNJeNNPSsdIizLM8KtsanAKo/EhI87/Ig4 8lSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=6FCEtU2aAt6rnYbKqDlpbArTUebRkzFK1s5LWUgDExc=; b=OhHo8dFCU9yvTUGrUDMhqhYXjqLU6Odtfe3s9QOWxVNnSswbeGyoDNtvwuMN2TkYxM inRyAOLWqT1bYeqKCeCR0KOFvBHm/fEMVCp546Nw/L2u/9F9xAx6rnJrz82dhFrgxJ0T olqLxwbRxbvoL2E9FrMmZhyHmy0U3o/wx6ITAAgS3JcCtLUn30yWNQl92jaTW8uNZm8Q SQfwqgKrppo6YZ6YEpuRSupPvyu2qyKxqaaE2Kk4R9Qy9AMWj2OpLr5+fNYUmmxsmsHa XDo9OEn37wbSxAm5bwOCFhjOwLqOJmg+lfioO6KiZoPfTLQDKoXVzfxHbLSMfVQZArhQ 8nTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si1313280qtd.41.2020.04.10.09.01.41; Fri, 10 Apr 2020 09:01:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726773AbgDJQAw (ORCPT + 99 others); Fri, 10 Apr 2020 12:00:52 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:57670 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726725AbgDJQAv (ORCPT ); Fri, 10 Apr 2020 12:00:51 -0400 Received: from 185.80.35.16 (185.80.35.16) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.415) id 08258914799ae752; Fri, 10 Apr 2020 18:00:49 +0200 From: "Rafael J. Wysocki" To: Linux PM , Alan Stern Cc: Linux ACPI , Linux PCI , LKML , Bjorn Helgaas , Greg Kroah-Hartman , Mika Westerberg , Hans De Goede , Ulf Hansson Subject: [PATCH 0/7] PM: sleep: core: Rearrange the handling of driver power management flags Date: Fri, 10 Apr 2020 17:46:27 +0200 Message-ID: <1888197.j9z7NJ8yPn@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. Patches [4-6/7] rename one function in the PM core and two driver PM flags to make their names better reflect their purpose. Finally, patch [7/7] updates the documentation of the driver PM flags to reflect the new code flows. This patch series have been available in the git branch at git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \ pm-sleep-core for easier web and git access. Cheers! [1] https://lore.kernel.org/linux-pm/Pine.LNX.4.44L0.2003251631360.1724-100000@netrider.rowland.org/