From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Praveen Talari <praveen.talari@oss.qualcomm.com>,
Mark Brown <broonie@kernel.org>,
Dilip Kota <dkota@codeaurora.org>,
Stephen Boyd <swboyd@chromium.org>,
Girish Mahadevan <girishm@codeaurora.org>,
Alok Chauhan <alokc@codeaurora.org>,
bjorn.andersson@oss.qualcomm.com,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>, Pavel Machek <pavel@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Danilo Krummrich <dakr@kernel.org>,
Douglas Anderson <dianders@chromium.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org,
Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>,
aniket.randive@oss.qualcomm.com,
chandana.chiluveru@oss.qualcomm.com,
jyothi.seerapu@oss.qualcomm.com, linux-pm@vger.kernel.org,
driver-core@lists.linux.dev
Subject: Re: [PATCH v3 2/2] spi: qcom-geni: Fix missing error check on pm_runtime_get_sync()
Date: Mon, 6 Jul 2026 15:04:22 +0200 [thread overview]
Message-ID: <b5b46eaa-a579-43c0-9e8a-31dba0481a60@oss.qualcomm.com> (raw)
In-Reply-To: <20260706-fix_sticky_-einval_after_pm_runtime_api_failure-v3-2-92feb5a7b926@oss.qualcomm.com>
On 7/6/26 10:53 AM, Praveen Talari wrote:
> spi_geni_init() calls pm_runtime_get_sync() to power up the device
> before accessing hardware registers, but never checks the return value.
> If the runtime resume fails, the function silently proceeds to read and
> write hardware registers on a device that may not be powered up, leading
> to register access faults.
>
> Fix this by replacing pm_runtime_get_sync() with the
> PM_RUNTIME_ACQUIRE_IF_ENABLED() macro and checking the result via
> PM_RUNTIME_ACQUIRE_ERR(), propagating any error back to the caller
> immediately before any hardware access occurs.
>
> Since the macro handles its own cleanup on failure, the out_pm label and
> the corresponding pm_runtime_put() call are no longer needed. Replace
> all goto out_pm paths with direct return ret statements and remove the
> label entirely.
>
> Fixes: 561de45f72bd ("spi: spi-geni-qcom: Add SPI driver support for GENI based QUP")
> Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
next prev parent reply other threads:[~2026-07-06 13:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 8:53 [PATCH v3 0/2] PM: runtime: Fix sticky -EINVAL after resume callback failure Praveen Talari
2026-07-06 8:53 ` [PATCH v3 1/2] PM: runtime: Only set runtime_error on suspend callback failures Praveen Talari
2026-07-06 11:49 ` Rafael J. Wysocki (Intel)
2026-07-06 13:21 ` Mark Brown
2026-07-06 14:10 ` Rafael J. Wysocki (Intel)
2026-07-06 17:30 ` Mark Brown
2026-07-09 14:52 ` Rafael J. Wysocki (Intel)
2026-07-09 16:35 ` Mark Brown
2026-07-09 17:35 ` Rafael J. Wysocki (Intel)
2026-07-09 17:38 ` Mark Brown
2026-07-06 8:53 ` [PATCH v3 2/2] spi: qcom-geni: Fix missing error check on pm_runtime_get_sync() Praveen Talari
2026-07-06 13:04 ` Konrad Dybcio [this message]
2026-07-09 14:54 ` Rafael J. Wysocki (Intel)
2026-07-09 18:29 ` Mark Brown
2026-07-10 4:11 ` Praveen Talari
2026-07-10 9:23 ` Mark Brown
2026-07-10 9:43 ` Praveen Talari
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=b5b46eaa-a579-43c0-9e8a-31dba0481a60@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=alokc@codeaurora.org \
--cc=aniket.randive@oss.qualcomm.com \
--cc=bjorn.andersson@oss.qualcomm.com \
--cc=broonie@kernel.org \
--cc=chandana.chiluveru@oss.qualcomm.com \
--cc=dakr@kernel.org \
--cc=dianders@chromium.org \
--cc=dkota@codeaurora.org \
--cc=driver-core@lists.linux.dev \
--cc=girishm@codeaurora.org \
--cc=gregkh@linuxfoundation.org \
--cc=jyothi.seerapu@oss.qualcomm.com \
--cc=lenb@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=mukesh.savaliya@oss.qualcomm.com \
--cc=pavel@kernel.org \
--cc=praveen.talari@oss.qualcomm.com \
--cc=rafael@kernel.org \
--cc=swboyd@chromium.org \
/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