From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755425AbbAZNSV (ORCPT ); Mon, 26 Jan 2015 08:18:21 -0500 Received: from v094114.home.net.pl ([79.96.170.134]:58137 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751208AbbAZNST (ORCPT ); Mon, 26 Jan 2015 08:18:19 -0500 From: "Rafael J. Wysocki" To: Pavel Machek Cc: "Liu, Chuansheng" , "Fu, Zhonghui" , "Brown, Len" , Greg Kroah-Hartman , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: Change behaviour when tracing ... nasty trap (was Re: [PATCH] PM/Trace: get rid of synchronous resume limit during PM trace) Date: Mon, 26 Jan 2015 14:41:02 +0100 Message-ID: <2718950.eck1siDzqK@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/3.16.0-rc5+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20150126110516.GA2028@amd> References: <54C5CB77.4000109@linux.intel.com> <27240C0AC20F114CBF8149A2696CBE4A01F1AD6A@SHSMSX101.ccr.corp.intel.com> <20150126110516.GA2028@amd> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, January 26, 2015 12:05:16 PM Pavel Machek wrote: > On Mon 2015-01-26 10:39:04, Liu, Chuansheng wrote: > > Hello Pavel, > > > > > > There are some kind of dependency between devices in some > > > > hardware platforms. So, asynchronous resuming devices may > > > > hang system due to wrong resume order. As a result, should > > > > not fore synchronously resuming devices during tracing > > > > PM events. > > > > > > > > Signed-off-by: Zhonghui Fu > > > > --- > > > > drivers/base/power/main.c | 3 +-- > > > > include/linux/resume-trace.h | 7 ------- > > > > 2 files changed, 1 insertions(+), 9 deletions(-) > > > > > > > > diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c > > > > index 9717d5f..5df148b 100644 > > > > --- a/drivers/base/power/main.c > > > > +++ b/drivers/base/power/main.c > > > > @@ -517,8 +517,7 @@ static int device_resume_noirq(struct device *dev, > > > pm_message_t state, bool asyn > > > > > > > > static bool is_async(struct device *dev) > > > > { > > > > - return dev->power.async_suspend && pm_async_enabled > > > > - && !pm_trace_is_enabled(); > > > > + return dev->power.async_suspend && pm_async_enabled; > > > > } > > > > > > > > > > Actually... whoever did the original patch was evil person. Changing > > > behaviour when tracing is requested is evil, evil, evil. Git blame > > > tells me > > > > > > Signed-off-by: Chuansheng Liu > > > > > > went to the dark side. > > > > Although I didn't get where is something wrong, but the is_async() is not created by my commit, > > it is from commit (PM: Start asynchronous resume threads upfront), I just moved it ahead. > > > > And like other phases, I added it into resum/suspend_noirq()... > > I see, blame blamed wrong person. It looks like Rafael is evil: > > commit 97df8c12995c5bac73e3bfeea4c5be155c1f4401 > Author: Rafael J. Wysocki > Date: Sat Jan 23 22:25:31 2010 +0100 > > PM: Start asynchronous resume threads upfront This only means we won't use asyc suspend/resume at all when the RTC-based resume debug is enabled, because it wouldn't make sense (the RTC-based debug requires strict ordering of callbacks between devices or we may find that device A hanged the resume while actually device B that was running in parallel with A did that). And I shouldn't even need to explain this ... Sad. Rafael