From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753437AbeAZPHL (ORCPT ); Fri, 26 Jan 2018 10:07:11 -0500 Received: from mga14.intel.com ([192.55.52.115]:37225 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753031AbeAZPHK (ORCPT ); Fri, 26 Jan 2018 10:07:10 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,416,1511856000"; d="scan'208";a="14507473" Message-ID: <1516979226.2752.3.camel@intel.com> Subject: Re: [RFC] intel-lpss: remove .prepare() callback From: Zhang Rui To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: mika.westerberg@linux.intel.com, lee.jones@linaro.org Date: Fri, 26 Jan 2018 23:07:06 +0800 In-Reply-To: <1516883334.7000.1252.camel@linux.intel.com> References: <1516867965-11124-1-git-send-email-rui.zhang@intel.com> <1516883334.7000.1252.camel@linux.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Andy, On Thu, 2018-01-25 at 14:28 +0200, Andy Shevchenko wrote: > On Thu, 2018-01-25 at 16:12 +0800, Zhang Rui wrote: > > > > The .prepare() callback of intel-lpss driver does nothing but wakes > > up > > its > > children. I don't know if there is any reason to do so, but to me, > > this is > > not preferred because it should be the child device driver to do so > > when > > necessary, not the parent device driver. > > Plus, .prepare() does not support asynchronization. > > > > For example, on MS Surface Pro 4, there are 4 intel-lpss devices > > which > > are runtime suspended before system suspend, resuming each of them > > takes > > more than 100 milliseconds. Thus the .prepare() of intel-lpss > > driver > > takes > > 400ms+ on my surface pro 4, and I've seen platforms with 16 intel > > lpss > > devices. > > > > With this patch applied, the child devices are resumed in the > > .suspend() > > stage of the child device, and they are done in parallel, thus only > > 100ms > > is needed, no matter how many intel lpss devices there are. > > > > I have tested it on three different platforms and didn't find any > > obvious > > problem caused by this patch, and it indeed reduces the suspend > > time a > > lot. > > > > @@ -482,17 +482,6 @@ static int resume_lpss_device(struct device > > *dev, > > - device_for_each_child_reverse(dev, NULL, > > resume_lpss_device); > Besides introduced compiler warning, did you check the latest linux- > pm > changes?  > > commit 8425ec7faff005500aad89b9fc00e5ba91ac57b9 > Author: Rafael J. Wysocki > Date:   Wed Jan 3 01:34:53 2018 +0100 > >     PM / mfd: intel-lpss: Use DPM_FLAG_SMART_SUSPEND > No, thanks for the pointer, I will check this. BTW, is there any reason that we need this .prepare() callback? thanks, rui