From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756846AbdKQNtc (ORCPT ); Fri, 17 Nov 2017 08:49:32 -0500 Received: from mail-it0-f50.google.com ([209.85.214.50]:35365 "EHLO mail-it0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751492AbdKQNtW (ORCPT ); Fri, 17 Nov 2017 08:49:22 -0500 X-Google-Smtp-Source: AGs4zMY5lhfaQNtMyo//XGBE3z7LtRW7z9FRuAGSS1vx3u157VmsFpTv1T8vaxa8deYOi6rgRBOyv3/f/aT3Stz2Z4o= MIME-Version: 1.0 In-Reply-To: References: <3806130.B2KCK0tvef@aspire.rjw.lan> <5556673.MXo6XDN1f4@aspire.rjw.lan> <2654404.6YT5rmSnae@aspire.rjw.lan> From: Ulf Hansson Date: Fri, 17 Nov 2017 14:49:20 +0100 Message-ID: Subject: Re: [PATCH v3 1/6] PM / core: Add LEAVE_SUSPENDED driver flag To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Linux PM , Bjorn Helgaas , Alan Stern , Greg Kroah-Hartman , LKML , Linux ACPI , Linux PCI , Linux Documentation , Mika Westerberg , Andy Shevchenko , Kevin Hilman Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [...] >> >>>> Second, have you considered setting the default value of >>>> dev->power.may_skip_resume to true? >>> >>> Yes. >>> >>>> That would means the subsystem >>>> instead need to implement an opt-out method. I am thinking that it may >>>> not be an issue, since we anyway at this point, don't have drivers >>>> using the LEAVE_SUSPENDED flag. >>> >>> Opt-out doesn't work because of the need to invoke the "noirq" callbacks. >> >> I am not sure I follow that. >> >> Whatever needs to be fixed on the subsystem level, that could be done >> before the driver starts using the LEAVE_SUSPENDED flag. No? > > That requires a bit of explanation, sorry for being overly concise. > > The core calls ->resume_noirq from the middle layer regardless of > whether or not the device will be left suspended, so the > ->resume_noirq cannot do arbitrary things to it. Setting > may_skip_resume by the middle layer tells the core that the middle > layer is ready for that and is going to cooperate. If may_skip_resume > had been set by default, that piece of information would have been > missing. Huh, I still don't get that. Sorry. If the "may_skip_resume" is default set to true by the PM core, wouldn't that just mean that the middle-layer needs to implement an opt-out method, rather than opt-in. In principle to opt-out the middle-layer needs to set may_skip_resume to false in suspend_noirq phase, no? Then we only need to make sure drivers don't starts use LEAVE_SUSPENDED, before we make sure the middle layers is adopted. But that should not be a problem. The benefit would be that those middle layers that can cope with LEAVE_SUSPENDED as of today don't need to change. Kind regards Uffe