From patchwork Wed Dec 20 14:09:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 10125765 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4CCAC60388 for ; Wed, 20 Dec 2017 14:09:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E2152950A for ; Wed, 20 Dec 2017 14:09:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 317F52977E; Wed, 20 Dec 2017 14:09:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 534372950A for ; Wed, 20 Dec 2017 14:09:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755437AbdLTOJh (ORCPT ); Wed, 20 Dec 2017 09:09:37 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:36200 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755427AbdLTOJe (ORCPT ); Wed, 20 Dec 2017 09:09:34 -0500 Received: by mail-lf0-f66.google.com with SMTP id c19so4311020lfg.3 for ; Wed, 20 Dec 2017 06:09:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rhfot0y2jEM/Q2tkrcTWz+TZcEboy+VQZExz0P6Etlg=; b=Scvd4qotbUOs7pVoqZyFjzz5Uo4gZViBA+/3+iBXgtQXoGIKbloDnt1eqbbLB+0fNY FSeXQ87YmNSYAuzRxNIgs6lZpPmI3fu+yzGFP5PW98ib7NLZlN/wptoTqIwG1pOhJ+5O CxWOToB/BcimmS5nJwZD5rRRU7VtsDzsax+Eg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rhfot0y2jEM/Q2tkrcTWz+TZcEboy+VQZExz0P6Etlg=; b=p1DcUKGvm43uxNvdhrRuuO0NLZ89Of8OVp27Dei96Ow/3iuyXqU5CrJY1HgOn2UQbU es2WQjfvTsZMspfUpOWzbWopXixNvdLvyYUKT8bL+muq75clBHNCOYONwT2zpJGrq9+V yvfJkQ0/4V9Z7Dasd+C+0D1tw63zFuWUfI8azgTDMYEDqlUSy42bv8qPC3DzMEzY+zEl 1m2UIKcPmrzoNtxIuwnp73iw0RZQwLS0vEE+xJs3sg0g1SKo/ahPyzXW/B+/SFo5lCJQ xAuGZ1kYCAYzBMGEIXoVxaXtpJW7eJttU6s/F+dPRHv9+Cl1xezgV3Y/AEHMUnLmM68T 3phQ== X-Gm-Message-State: AKGB3mKxWusx3mP2k64e1TBsLJ9fw7Sh6dvOKilmnhlxfkj2fIv8yQPq RyJ1vVazNYSYDhhdWjBbQOdxGA== X-Google-Smtp-Source: ACJfBosoh6AZRH0i/pKK26p/xeUuFL+MX47Ur7Nd2jouBGcf742yz8GdCbzP6CSmPCqJy+lO2bTmkQ== X-Received: by 10.46.117.23 with SMTP id q23mr4651338ljc.85.1513778972679; Wed, 20 Dec 2017 06:09:32 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-67.NA.cust.bahnhof.se. [158.174.22.67]) by smtp.gmail.com with ESMTPSA id f10sm3869505lff.56.2017.12.20.06.09.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Dec 2017 06:09:31 -0800 (PST) From: Ulf Hansson To: Kishon Vijay Abraham I , linux-kernel@vger.kernel.org Cc: "Rafael J . Wysocki" , linux-pm@vger.kernel.org, Yoshihiro Shimoda , Geert Uytterhoeven , linux-renesas-soc@vger.kernel.org, Ulf Hansson , Jonathan Corbet , linux-doc@vger.kernel.org Subject: [PATCH v2 3/3] phy: core: Update the runtime PM section in the docs to reflect changes Date: Wed, 20 Dec 2017 15:09:20 +0100 Message-Id: <1513778960-10073-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513778960-10073-1-git-send-email-ulf.hansson@linaro.org> References: <1513778960-10073-1-git-send-email-ulf.hansson@linaro.org> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Let's update and clarify he phy documentation, to reflect the latest changes around the runtime PM deployment in the phy core. Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Ulf Hansson --- Documentation/phy.txt | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Documentation/phy.txt b/Documentation/phy.txt index 457c3e0..1c2c761 100644 --- a/Documentation/phy.txt +++ b/Documentation/phy.txt @@ -160,19 +160,22 @@ associated with this PHY. PM Runtime ========== -This subsystem is pm runtime enabled. So while creating the PHY, -pm_runtime_enable of the phy device created by this subsystem is called and -while destroying the PHY, pm_runtime_disable is called. Note that the phy -device created by this subsystem will be a child of the device that calls -phy_create (PHY provider device). - -So pm_runtime_get_sync of the phy_device created by this subsystem will invoke -pm_runtime_get_sync of PHY provider device because of parent-child relationship. -It should also be noted that phy_power_on and phy_power_off performs -phy_pm_runtime_get_sync and phy_pm_runtime_put respectively. -There are exported APIs like phy_pm_runtime_get, phy_pm_runtime_get_sync, -phy_pm_runtime_put, phy_pm_runtime_put_sync, phy_pm_runtime_allow and -phy_pm_runtime_forbid for performing PM operations. +This subsystem deploys runtime PM support. More precisely, calls to +pm_runtime_get_sync() and to pm_runtime_put() surrounds calls to the phy +provider callbacks, ->init|exit(), in phy_init|exit(). At phy_power_on(), the +runtime PM usage count is raised again, via pm_runtime_get_sync(). The usage +count remain raised, until the internal phy power on count reaches zero in +phy_power_off(), at which point pm_runtime_put() is called to restore the +runtime PM usage count. In this way, the device is guranteed to stay runtime +resumed as long as the phy is powered on. + +In regards to the runtime PM deployment in the phy core, it should also be +noted that it's deployed for the phy provider device, which is the parent of +the phy child device. In other words, the phy device created by the phy core +remains runtime PM disabled. Of course, whether runtime PM is really used or +not, depends on whether the phy provider driver has enabled runtime PM for its +provider device. More exactly, pm_runtime_enable() needs to be called prior +calling phy_create() or devm_phy_create(). PHY Mappings ============