LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Pavel Machek <pavel@ucw.cz>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Stephen Boyd <sboyd@kernel.org>, Taniya Das <tdas@codeaurora.org>,
Michael Turquette <mturquette@baylibre.com>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-clk@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: [PATCH v3 0/3] PM: add two devres helpers and use them in qcom cc
Date: Sat, 31 Jul 2021 22:50:31 +0300 [thread overview]
Message-ID: <20210731195034.979084-1-dmitry.baryshkov@linaro.org> (raw)
Most of the drivers using using pm_runtime_enable() or pm_clk_create()
follow the same pattern: call the function in the probe() path and call
correspondingly pm_runtime_disable() or pm_clk_destroy() from the
probe()'s error path and from the remove() function. This common code
pattern has several drawbacks. I.e. driver authors have to ensure that
the disable/destroy call in the error path really corresponds to the
proper error clause. Or that the disable/destroy call is not missed in
the remove() callback.
Add two devres helpers replacing these code patterns with relevant devm
function call, removing the need to call corresponding disable/destroy
functions. As an example modify Qualcomm clock controller code to use
new helpers. In this case we are able to drop error path and remove
functions completely, simplifying the drivers in question.
Changes since v2:
- Expand commit messages
- Drop extra clock controller changes not strictly relevant to these
two helpers
Changes since v1:
- Add a patch making Qualcomm clock controller drivers actually execute
these helpers, thus demonstrating their usage and the necessity
----------------------------------------------------------------
Dmitry Baryshkov (3):
PM: runtime: add devm_pm_runtime_enable helper
PM: runtime: add devm_pm_clk_create helper
clk: qcom: use devm_pm_runtime_enable and devm_pm_clk_create
drivers/base/power/clock_ops.c | 17 +++++++++++++++++
drivers/base/power/runtime.c | 17 +++++++++++++++++
drivers/clk/qcom/camcc-sc7180.c | 25 ++++++++++---------------
drivers/clk/qcom/lpass-gfm-sm8250.c | 21 +++++++++------------
drivers/clk/qcom/lpasscorecc-sc7180.c | 18 ++----------------
drivers/clk/qcom/mss-sc7180.c | 30 ++++++++----------------------
drivers/clk/qcom/q6sstop-qcs404.c | 32 +++++++++-----------------------
drivers/clk/qcom/turingcc-qcs404.c | 30 ++++++++----------------------
include/linux/pm_clock.h | 5 +++++
include/linux/pm_runtime.h | 4 ++++
10 files changed, 89 insertions(+), 110 deletions(-)
next reply other threads:[~2021-07-31 19:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-31 19:50 Dmitry Baryshkov [this message]
2021-07-31 19:50 ` [PATCH v3 1/3] PM: runtime: add devm_pm_runtime_enable helper Dmitry Baryshkov
2021-08-04 18:06 ` Rafael J. Wysocki
2021-08-04 21:02 ` Dmitry Baryshkov
2021-08-06 13:27 ` Rafael J. Wysocki
2021-07-31 19:50 ` [PATCH v3 2/3] PM: runtime: add devm_pm_clk_create helper Dmitry Baryshkov
2021-08-31 12:15 ` Geert Uytterhoeven
2021-07-31 19:50 ` [PATCH v3 3/3] clk: qcom: use devm_pm_runtime_enable and devm_pm_clk_create Dmitry Baryshkov
2021-08-04 18:12 ` Rafael J. Wysocki
[not found] ` <162820760640.19113.2386978922035728014@swboyd.mtv.corp.google.com>
2021-08-06 7:08 ` [PATCH v3 0/3] PM: add two devres helpers and use them in qcom cc Dmitry Baryshkov
2021-08-16 17:08 ` Dmitry Baryshkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210731195034.979084-1-dmitry.baryshkov@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
--cc=sboyd@kernel.org \
--cc=tdas@codeaurora.org \
--subject='Re: [PATCH v3 0/3] PM: add two devres helpers and use them in qcom cc' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).