From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout1.hostsharing.net ([83.223.95.204]:50803 "EHLO mailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935544AbdCXLho (ORCPT ); Fri, 24 Mar 2017 07:37:44 -0400 Date: Fri, 24 Mar 2017 12:37:36 +0100 From: Lukas Wunner To: Ulf Hansson Cc: "Rafael J. Wysocki" , Marek Szyprowski , linux-clk , "linux-pm@vger.kernel.org" , Bartlomiej Zolnierkiewicz Subject: Re: [PATCH] PM / runtime: Use synchronous runtime PM call in rpm_put_suppliers() Message-ID: <20170324113736.GA21618@h08.hostsharing.net> References: <1490174570-18345-1-git-send-email-m.szyprowski@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: Sender: linux-clk-owner@vger.kernel.org List-ID: On Thu, Mar 23, 2017 at 01:47:46PM +0100, Ulf Hansson wrote: > For the sync runtime PM suspend/idle case: > When a driver for a children/consumers decides to use the sync runtime > PM APIs, it's most likely because it wants the device to enter its low > power state as soon as possible. I think a driver is doing it wrong if it uses sync vs. async to achieve a certain policy. (As in the example you've given above.) That should be left to the PM core, and the PM core should try to suspend as early and as often as possible in order to save power. If the driver wants to achieve a policy such as "suspend this device ASAP but let this other device idle a bit before suspend because its usage pattern is bursty" then the correct way to implement this is via a sane default value for the autosuspend delay. Generelly, async should be used. One example where sync is warranted is when the ->runtime_suspend hook needs to be finished before power is cut to the device. That's a hard constraint. E.g. vga_switcheroo does this when runtime suspending the GPU. In this case, "runtime suspend" means that the driver puts the device in a state from which power can be cut. The actual power switch is toggled afterwards. Regards, Lukas