From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755035AbcKJCAf (ORCPT ); Wed, 9 Nov 2016 21:00:35 -0500 Received: from mail-pf0-f178.google.com ([209.85.192.178]:33790 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751203AbcKJCAd (ORCPT ); Wed, 9 Nov 2016 21:00:33 -0500 Date: Wed, 9 Nov 2016 18:00:29 -0800 From: Brian Norris To: "Rafael J. Wysocki" Cc: "Rafael J . Wysocki" , Pavel Machek , Len Brown , Greg Kroah-Hartman , Linux Kernel Mailing List , Doug Anderson , Brian Norris , Jeffy Chen , Linux PM , Chuansheng Liu , Dmitry Torokhov Subject: Re: [PATCH v3] PM / sleep: don't suspend parent when async child suspend_{noirq,late} fails Message-ID: <20161110020028.GA141513@google.com> References: <1477584334-39956-1-git-send-email-briannorris@chromium.org> <1478740868-55269-1-git-send-email-briannorris@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 10, 2016 at 02:53:20AM +0100, Rafael J. Wysocki wrote: > On Thu, Nov 10, 2016 at 2:21 AM, Brian Norris wrote: > > diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c > > index c58563581345..57a8ca4bc8ab 100644 > > --- a/drivers/base/power/main.c > > +++ b/drivers/base/power/main.c > > @@ -1027,6 +1027,8 @@ static int __device_suspend_noirq(struct device *dev, pm_message_t state, bool a > > TRACE_DEVICE(dev); > > TRACE_SUSPEND(0); > > > > + dpm_wait_for_children(dev, async); > > + > > On a second thought. I'd move the > > if (dev->power.syscore || dev->power.direct_complete) > > along with this (and put it in front), because those flags won't > change while children are being waited on anyway. I can do that, but is it really necessary? It's also not the order we do it for __device_suspend(). I don't like arbitrarily making optimizations in this code differently to the non-{noirq,late} versions. Also, would it cause any problem to have a parent return success before its children have suspended? I haven't reasoned through all the cases there, but I wouldn't do that without reason. Brian