From patchwork Thu Nov 7 09:40:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 21397 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D6D4E25E16 for ; Thu, 7 Nov 2013 09:40:07 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id kx10sf518552pab.8 for ; Thu, 07 Nov 2013 01:40:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=iOZzVRVhFdWdIiXXDiQk7Z2wXbnHAmhD6wTBgzvFEyE=; b=SU2yPV6/zJm+0eYumFUGiaKGFB64MQFp4sFggD1xNprPNGeM+ztycTIGGJ0MXpq53k sIsuRpzYI/Z1OHHxEtxoWilGqhJ9I6/FyVZ6kGfu2AhG2td4YSFK1fwHe1OjLxBitcdx M6jaUVr3nnxA3GYAJruaoJl+ejdbyDMlvRq6Gg1IU4Zhr8Y0cGBYH1bbkwX8ZnD4uDzM Mdq56991UVHhC47FnNXmfVBxL7fLCmVP8itBVOIjwynttncku+hxor3sEAzSU+SzKe8j ezd4mPBjEpiuIGv9GuZzweBfXSMIND++lci4cGj3bMaf/mjUJtGOWM+y7bBvhv2Tt/tX Hr/w== X-Gm-Message-State: ALoCoQnYScShs4yHY5XyS9uXTfXOqUr7K5K/HopCZ7CsgwA1cUkQrH925wRzMu1jREMovbxjFbbZ X-Received: by 10.66.66.35 with SMTP id c3mr2875601pat.12.1383817206857; Thu, 07 Nov 2013 01:40:06 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.129.166 with SMTP id nx6ls1044638qeb.12.gmail; Thu, 07 Nov 2013 01:40:06 -0800 (PST) X-Received: by 10.220.169.203 with SMTP id a11mr6132994vcz.26.1383817206664; Thu, 07 Nov 2013 01:40:06 -0800 (PST) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by mx.google.com with ESMTPS id sc5si1297245vdc.139.2013.11.07.01.40.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Nov 2013 01:40:06 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.45 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.45; Received: by mail-vb0-f45.google.com with SMTP id p6so178422vbe.18 for ; Thu, 07 Nov 2013 01:40:06 -0800 (PST) X-Received: by 10.52.243.138 with SMTP id wy10mr5095320vdc.2.1383817206443; Thu, 07 Nov 2013 01:40:06 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp6899vcz; Thu, 7 Nov 2013 01:40:05 -0800 (PST) X-Received: by 10.180.87.105 with SMTP id w9mr1882057wiz.44.1383817205300; Thu, 07 Nov 2013 01:40:05 -0800 (PST) Received: from mail-we0-f169.google.com (mail-we0-f169.google.com [74.125.82.169]) by mx.google.com with ESMTPS id dc3si2000332wjb.133.2013.11.07.01.40.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Nov 2013 01:40:05 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.169 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=74.125.82.169; Received: by mail-we0-f169.google.com with SMTP id q58so274475wes.0 for ; Thu, 07 Nov 2013 01:40:04 -0800 (PST) X-Received: by 10.180.13.142 with SMTP id h14mr1858534wic.3.1383817204778; Thu, 07 Nov 2013 01:40:04 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id fu1sm33664373wib.8.2013.11.07.01.40.02 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Nov 2013 01:40:04 -0800 (PST) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , linux-pm@vger.kernel.org Cc: Ulf Hansson , Tomi Valkeinen , Kevin Hilman , Alan Stern Subject: [PATCH] PM / Runtime: Update documentation around probe|remove|suspend Date: Thu, 7 Nov 2013 10:40:00 +0100 Message-Id: <1383817200-3004-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.45 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , PM core and driver core has changed some behavior regarding use of runtime PM. Update the documentation accordingly. Cc: Tomi Valkeinen Cc: Kevin Hilman Cc: Alan Stern Signed-off-by: Ulf Hansson --- Documentation/power/runtime_pm.txt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index 0f54333..0f62cc7 100644 --- a/Documentation/power/runtime_pm.txt +++ b/Documentation/power/runtime_pm.txt @@ -547,13 +547,11 @@ helper functions described in Section 4. In that case, pm_runtime_resume() should be used. Of course, for this purpose the device's runtime PM has to be enabled earlier by calling pm_runtime_enable(). -If the device bus type's or driver's ->probe() callback runs -pm_runtime_suspend() or pm_runtime_idle() or their asynchronous counterparts, -they will fail returning -EAGAIN, because the device's usage counter is -incremented by the driver core before executing ->probe(). Still, it may be -desirable to suspend the device as soon as ->probe() has finished, so the driver -core uses pm_runtime_put_sync() to invoke the subsystem-level idle callback for -the device at that time. +It may be desirable to suspend the device once ->probe() has finished. +Therefore the driver core uses the asyncronous pm_request_idle() to submit a +request to execute the subsystem-level idle callback for the device at that +time. A driver which make use of the runtime autosuspend feature, may want to +update the last busy mark before it finalilizes it's ->probe(). Moreover, the driver core prevents runtime PM callbacks from racing with the bus notifier callback in __device_release_driver(), which is necessary, because the @@ -632,7 +630,10 @@ The PM core always increments the runtime usage counter before calling the Hence disabling runtime PM temporarily like this will not cause any runtime suspend attempts to be permanently lost. If the usage count goes to zero following the return of the ->resume() callback, the ->runtime_idle() callback -will be invoked as usual. +will be invoked as usual. Do note that PM core use the asyncronous +pm_runtime_put() when decrementing the usage counter, which means it don't wait +for the device to become inactive before it moves on and handles the next +device from the list. On some systems, however, system sleep is not entered through a global firmware or hardware operation. Instead, all hardware components are put into low-power @@ -656,7 +657,7 @@ out the following operations: __pm_runtime_disable() with 'false' as the second argument for every device right before executing the subsystem-level .suspend_late() callback for it. - * During system resume it calls pm_runtime_enable() and pm_runtime_put_sync() + * During system resume it calls pm_runtime_enable() and pm_runtime_put() for every device right after executing the subsystem-level .resume_early() callback and right after executing the subsystem-level .resume() callback for it, respectively.