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: 3156171 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9C8C89F3C4 for ; Fri, 8 Nov 2013 05:14:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9A40120497 for ; Fri, 8 Nov 2013 05:14:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 706F720483 for ; Fri, 8 Nov 2013 05:13:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750781Ab3KHFN6 (ORCPT ); Fri, 8 Nov 2013 00:13:58 -0500 Received: from mail-la0-f53.google.com ([209.85.215.53]:64655 "EHLO mail-la0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750728Ab3KHFN6 (ORCPT ); Fri, 8 Nov 2013 00:13:58 -0500 Received: by mail-la0-f53.google.com with SMTP id eh20so1335726lab.40 for ; Thu, 07 Nov 2013 21:13:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9FDNZk0HJkUUk0oW6HE5YCKoq1RhKt6UIEVTI5j4T5k=; b=gikWNWB/73H+PAuKOG7upH0RinvNE6XXN20eGMmigNfY5AxwCc16ga25fYTNbIhCKj Tb2IkwT0CNzYgxvBASnVfWP7YNhoaiqwPgvrKNfNUtdUI37hLou/2aooTi0Tca8ye249 W9cTk18l3iun1tMn7hsMxPnu8cHQ56atRbVbW8uznVGEzRJciJ94Brx7obz42i1s6CWm oKGjdPfuw/usQk/lGChSR5mjb8pUlUm3bQt9X8+8sjjoZ9FVR8di5hWfkx4J+O5pQLEu VlqS8W/R4u42VsdLv55tr+FXR4k7HPoZx0+J9Fe8ChbXtR2LbZGvNfDBAJ9rXB7RQJOy VrpQ== X-Gm-Message-State: ALoCoQlYUai/g6lq2SCsi+c0zQx7Jk421tInrpNaiY4XoPjrubvYrkv1a8nruRLxfiwMBeqLyAW9 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 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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.