From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>,
Bjorn Andersson <andersson@kernel.org>,
Linus Walleij <linusw@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org,
srinivas.kandagatla@oss.qualcomm.com
Subject: Re: [PATCH v1 3/3] pinctrl: qcom: lpass-lpi: Resume clocks for GPIO access
Date: Tue, 14 Apr 2026 10:44:59 +0200 [thread overview]
Message-ID: <dbbbd4f9-ab27-4568-a06b-5d982d54bb51@oss.qualcomm.com> (raw)
In-Reply-To: <20260413122233.375945-4-ajay.nandam@oss.qualcomm.com>
On 4/13/26 2:22 PM, Ajay Kumar Nandam wrote:
> Ensure the LPI pinctrl device clocks are runtime resumed
> before accessing GPIO registers and autosuspended after
> the access completes.
>
> Guard GPIO register read and write helpers with synchronous
> runtime PM calls so the device is active during MMIO
> operations.
>
> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
> ---
> drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
> index d108e7321..4275f2734 100644
> --- a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
> +++ b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
> @@ -49,8 +49,17 @@ static int lpi_gpio_read(struct lpi_pinctrl *state, unsigned int pin,
> else
> pin_offset = LPI_TLMM_REG_OFFSET * pin;
>
> + ret = pm_runtime_get_sync(state->dev);
> + if (ret < 0) {
> + pm_runtime_put_noidle(state->dev);
> + return ret;
> + }
Okay that's how they can fail..
Please move from pm_runtime_get_sync() to pm_runtime_resume_and_get() or
someone will come around next week to "improve" it
> +
> *val = ioread32(state->tlmm_base + pin_offset + addr);
>
> + pm_runtime_mark_last_busy(state->dev);
> + pm_runtime_put_autosuspend(state->dev);
put_autosuspend() already does mark_last_busy() nowadays
Konrad
next prev parent reply other threads:[~2026-04-14 8:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-13 12:22 [PATCH v1 0/3] pinctrl: qcom: lpass-lpi: PM clock framework cleanup and fixes Ajay Kumar Nandam
2026-04-13 12:22 ` [PATCH v1 1/3] pinctrl: qcom: lpass-lpi: Switch to PM clock framework for runtime PM Ajay Kumar Nandam
2026-04-14 8:33 ` Konrad Dybcio
2026-04-20 8:51 ` Ajay Kumar Nandam
2026-04-14 8:37 ` Konrad Dybcio
2026-04-16 12:32 ` Ajay Kumar Nandam
2026-04-13 12:22 ` [PATCH v1 2/3] pinctrl: qcom: lpass-lpi: Fix GPIO register access helper return types Ajay Kumar Nandam
2026-04-14 8:39 ` Konrad Dybcio
2026-04-20 8:42 ` Ajay Kumar Nandam
2026-04-13 12:22 ` [PATCH v1 3/3] pinctrl: qcom: lpass-lpi: Resume clocks for GPIO access Ajay Kumar Nandam
2026-04-14 8:44 ` Konrad Dybcio [this message]
2026-04-20 8:45 ` Ajay Kumar Nandam
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=dbbbd4f9-ab27-4568-a06b-5d982d54bb51@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=ajay.nandam@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=srinivas.kandagatla@oss.qualcomm.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox