From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: [PATCH 1/2, v2] PM / Runtime: Rework the "runtime idle" helper routine Date: Mon, 03 Jun 2013 21:20:11 +0200 Message-ID: <1845145.fx6jpmVA5v@vostro.rjw.lan> References: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7Bit Return-path: Received: from hydra.sisk.pl ([212.160.235.94]:57477 "EHLO hydra.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757657Ab3FCTLJ (ORCPT ); Mon, 3 Jun 2013 15:11:09 -0400 In-Reply-To: Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Alan Stern Cc: Linux PM list On Monday, June 03, 2013 10:33:20 AM Alan Stern wrote: > On Sun, 2 Jun 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 > > 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 not 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. > > > > Moreover, the PCI, SCSI, and SATA subsystems' .runtime_idle() > > routines, pci_pm_runtime_idle(), scsi_runtime_idle(), and > > ata_port_runtime_idle(), respectively, as well as a few drivers' > > ones may be simplified if rpm_idle() calls rpm_suspend() after 0 has > > been returned by the .runtime_idle() callback executed by it. > > > > To reduce overall code bloat, make the changes described above. > > Acked-by: Alan Stern Thanks!