From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com ([143.182.124.37]:27493 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754763Ab3E3BFV (ORCPT ); Wed, 29 May 2013 21:05:21 -0400 Message-ID: <51A6A5E7.1040601@intel.com> Date: Thu, 30 May 2013 09:05:43 +0800 From: Aaron Lu MIME-Version: 1.0 To: "Rafael J. Wysocki" CC: Alan Stern , Linux PM list , ACPI Devel Maling List , LKML , Greg Kroah-Hartman , Bjorn Helgaas , Linux PCI , Kevin Hilman , Mika Westerberg Subject: Re: [PATCH RFC] PM / Runtime: Rework the "runtime idle" helper routine References: <1645401.1grgttHPMR@vostro.rjw.lan> In-Reply-To: <1645401.1grgttHPMR@vostro.rjw.lan> Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-pci-owner@vger.kernel.org List-ID: On 05/30/2013 06:18 AM, Rafael J. Wysocki wrote: > On Wednesday, May 29, 2013 10:51:11 AM Alan Stern wrote: >> On Wed, 29 May 2013, Rafael J. Wysocki wrote: >> >>> From: Rafael J. Wysocki >>> >>> The "runtime idle" helper routine, rpm_idle(), currently ignores >>> return values from .runtime_idle() callbacks executed by it. >>> >>> However, it turns out that many subsystems use the generic idle >>> callback routine pm_generic_runtime_idle() which checks the return >>> value of the driver's callback and executes pm_runtime_suspend() for >>> the device unless that value is different from 0. If that logic is >>> moved to rpm_idle() instead, pm_generic_runtime_idle() can be dropped >>> and its users will not need any .runtime_idle() callbacks any more. >> >> Since you're making this change, wouldn't it be a good idea to adopt >> Mika's original suggestion and turn on the RPM_AUTO bit in rpmflags >> when the use_autosuspend flag is set? > > I'm not actually sure. It can be done, but I'd prefer to do that as a separate > change in any case. For SCSI idle callback, that would be a welcome change, where instead of calling pm_runtime_autosuspend and then return -EBUSY, it can be changed to simply return 0 after mark_last_busy. Thanks, Aaron