From patchwork Tue Dec 19 21:22:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 122410 Delivered-To: patches@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4697021qgn; Tue, 19 Dec 2017 13:23:02 -0800 (PST) X-Received: by 10.25.222.18 with SMTP id v18mr3080923lfg.143.1513718582087; Tue, 19 Dec 2017 13:23:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513718582; cv=none; d=google.com; s=arc-20160816; b=L1w1VuvjwpkqYxj1WdaVgu6bvOnYfGxY0d2ons1JQ2C3ZnIeTmLgxlX/y9ePt8CgCK GzN1ztZ6ht9iVfMUKa8XXLJppAgx56u07xdEA5pRIuobn5osSLqw0srW35Zg9jwPxLme MkNObOvNNZzarYquvNJDYhNg/q7gINUgSs10DOytnhRRemu2Hk7gzpU64I32VTNjQJCV I3JonqhzpEWpBZwTl5StSk5o2qvzV1Qv1veM79erAb5CKph1xtAUe/nGDrsK6JCNP06f CB+r5/eRPa73M9RUQJ5kfDNBiWFk6cBlpkbKCoFGLZ3wxOZ3SU9gSD2cKjC0jXMR3cOc rZOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=B2dtHgFNzb2UrZK6K3gClLvywVXm3hxHvwuv6UELdgA=; b=syqoxgQDB4HNnLKNx60YWTAfzvzpZOulKBIeSTrjc6l/7o7rENrjFyEsCbhfk9QOQF zIK8NIfwgoNIC2CGcNPDvEXRtq3WJumO2ebfe2KZcCRts/DY30QrOtRAh4yHg8pxg1le WDzSXZYgyRJBmpp6TbfdAYqtIzqzi0XawVy/8/U48TUYuEPJouQqZEHc2sVRTHtrOFVw Xu16l8JYYvopmyigKWIjWv3ShiQqRycBH1+xIIsJQ13uhhXOqdgaKwBZQuT94wzGDXBI HBv6LxJ8jZrSTOJu01BKORKzCLgSDWU9XbTlP0o3yij2SV8kF5YP2Rn1ksPatwgPfr47 c4VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XpytnqB6; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id x11sor2986082lje.83.2017.12.19.13.23.01 for (Google Transport Security); Tue, 19 Dec 2017 13:23:02 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XpytnqB6; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=B2dtHgFNzb2UrZK6K3gClLvywVXm3hxHvwuv6UELdgA=; b=XpytnqB6chVXDYrdzok1RBtsXPQJV2imh79s98X/6tKleicsH4bSESMY2pFnYuRiCI TvAGyku8mfcmikQAn0nG10u/fwDjbWIskNIbHlUiVY5yZvbcJ5CFjk7CZ8dILyfFNZs2 NGAITXPcFW/oODlgdafhdqI1gS3AXvzbo1tIc= 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=B2dtHgFNzb2UrZK6K3gClLvywVXm3hxHvwuv6UELdgA=; b=Cz75+cUutITK9crkNiilLGmMTIKUtOLe3KLOrwZDOGc9aTsxIW1nZNjY2VJzVRdWIn y4BueUrRa//nZNaaHhQlEflptFRWAtgMzWTKnq8213MJ64E9DagkSWR7+W8H2MUOUCY1 tLXsdlawzpvIYQvRGoVsVSmQRVaqiRYMZWYyAGU7ojQII1WTJcI7puPPZ9S1RHomjpyh k/fJ+70dP9ZlgO0qr6Zcj7aNjZF4LalbjZiClMc+Ojmj7ozPiwbT4AIiGyTMd5M/R0Uy uiOfTzsmqO5+gF55O7mwasLmf/8E4VJ2AekDpEAfX+Egjl6PQK96wtn3wV6PdBP8SuDw drvw== X-Gm-Message-State: AKGB3mIv08RKeUW7jBYLaDC2eVOCkRiNg0HUgxN3eyIgcRZr0x9bzm/Z Z4p/+qFgza3AHNKsUVqsDsOKbYEG X-Google-Smtp-Source: ACJfBouADR+64U/jT8dQLPxOlgLf3lUrLpkKg5hcDPdTx01brwXO0GVxzQLTA5KigM/jTWrjDSUVJQ== X-Received: by 10.46.83.29 with SMTP id h29mr2989757ljb.144.1513718581723; Tue, 19 Dec 2017 13:23:01 -0800 (PST) Return-Path: Received: from localhost.localdomain (h-158-174-22-67.NA.cust.bahnhof.se. [158.174.22.67]) by smtp.gmail.com with ESMTPSA id 13sm3173068ljv.37.2017.12.19.13.23.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Dec 2017 13:23:00 -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 3/3] phy: core: Update the runtime PM section in the docs to reflect changes Date: Tue, 19 Dec 2017 22:22:31 +0100 Message-Id: <1513718551-28624-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513718551-28624-1-git-send-email-ulf.hansson@linaro.org> References: <1513718551-28624-1-git-send-email-ulf.hansson@linaro.org> 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 | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) -- 2.7.4 diff --git a/Documentation/phy.txt b/Documentation/phy.txt index 457c3e0..6d9e3d3 100644 --- a/Documentation/phy.txt +++ b/Documentation/phy.txt @@ -160,19 +160,21 @@ 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. PHY Mappings ============