From patchwork Fri Nov 8 05:13:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 21412 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AD5CB25E4B for ; Fri, 8 Nov 2013 05:13:59 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id a41sf2434531yho.5 for ; Thu, 07 Nov 2013 21:13:59 -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=9FDNZk0HJkUUk0oW6HE5YCKoq1RhKt6UIEVTI5j4T5k=; b=Icwye2QzOAI2LRYXDreiDlyBJRdXEhoWcRIzG8aFjjDa6hwubAA/ILX0ipzGFANaxu /VDpdApHm5yjKiPbvI2DFl4VXWwGqrp+QvyrW8p6aQ1D6sR6GJvjcbg45S4SCSxPE/+F BtppzUXaE3cbt2uMhy4ZVTdWDj7AKB0cLw8kaLAZpQ/kAIrwQicm9FPyjHfQfcJTsLYS ArHUeNIb6nXiUMUgrkbQkLJeCoC1ptOu/v5TCDFDXphqIUwx/4VSfJKBrzjfbv8Wikax 4edCTZKxSfhDfo4UCnb5S7V64etv1hxJ5SdbtiAIrCbl7Gas7i5eNbCdvq19k2AVe6an LkcQ== X-Gm-Message-State: ALoCoQkWwWiz8wA7errgakgZZLnxu+z+vRFSUBaRS9lWs+XIqWjPo0Uqzno8EKsRYRZjzz88Xvud X-Received: by 10.236.129.194 with SMTP id h42mr2012398yhi.11.1383887639010; Thu, 07 Nov 2013 21:13:59 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.99.67 with SMTP id eo3ls1546105qeb.41.gmail; Thu, 07 Nov 2013 21:13:58 -0800 (PST) X-Received: by 10.58.207.15 with SMTP id ls15mr10022675vec.17.1383887638887; Thu, 07 Nov 2013 21:13:58 -0800 (PST) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id gq10si3158328vdc.108.2013.11.07.21.13.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Nov 2013 21:13:58 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.50 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.50; Received: by mail-vb0-f50.google.com with SMTP id x16so1067647vbf.37 for ; Thu, 07 Nov 2013 21:13:58 -0800 (PST) X-Received: by 10.52.33.69 with SMTP id p5mr8450416vdi.28.1383887638572; Thu, 07 Nov 2013 21:13:58 -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 u4csp4634vcz; Thu, 7 Nov 2013 21:13:58 -0800 (PST) X-Received: by 10.112.144.5 with SMTP id si5mr59539lbb.33.1383887637296; Thu, 07 Nov 2013 21:13:57 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) by mx.google.com with ESMTPS id pm9si3011792lbc.134.2013.11.07.21.13.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Nov 2013 21:13:57 -0800 (PST) Received-SPF: neutral (google.com: 209.85.217.181 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id x18so1076027lbi.40 for ; Thu, 07 Nov 2013 21:13:56 -0800 (PST) X-Received: by 10.152.6.169 with SMTP id c9mr9348218laa.28.1383887636540; Thu, 07 Nov 2013 21:13:56 -0800 (PST) Received: from linaro-ulf.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id o1sm6657250lah.8.2013.11.07.21.13.54 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Nov 2013 21:13:55 -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 v2] PM / Runtime: Update documentation around probe|remove|suspend Date: Fri, 8 Nov 2013 06:13:51 +0100 Message-Id: <1383887631-2703-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.50 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 | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index 0f54333..b6ce00b 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 that makes use of the runtime autosuspend feature, may want to +update the last busy mark before returning from ->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 @@ -656,7 +654,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.