From: sashiko-bot@kernel.org
To: "Gopi Chandra Sekhar Reddy Kanala" <gopi.kanala@oss.qualcomm.com>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH] soundwire: qcom: re-arm the controller interrupt after gating the clock
Date: Sat, 28 Nov 2026 08:09:04 +0000 [thread overview]
Message-ID: <sashiko-outbox-238531@kernel.org> (raw)
In-Reply-To: <20261128-sdw-qcom-irq-v1-1-d053ac530faa@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] soundwire: qcom: pending CLK_STOP_FINISHED_V2 replay in
swrm_runtime_suspend()
--
commit 650a30f5b562334bca4f136e5ca1ea065589e930
Author: Gopi Chandra Sekhar Reddy Kanala <gopi.kanala@oss.qualcomm.com>
soundwire: qcom: re-arm the controller interrupt after gating the clock
This commit re-enables the SoundWire controller IRQ at the end of
swrm_runtime_suspend() after gating hclk and removes the corresponding
enable_irq() from swrm_runtime_resume() so that peripheral alerts can
wake the controller while the clock is stopped.
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index a4cb62897192e..05ef7bb2c5f7f 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
[ ... ]
> @@ -1893,6 +1892,8 @@ static int __maybe_unused swrm_runtime_suspend(struct device *dev)
>
> usleep_range(300, 305);
>
> + enable_irq(ctrl->irq);
> +
> if (ctrl->wake_irq > 0) {
> if (irqd_irq_disabled(irq_get_irq_data(ctrl->wake_irq)))
> enable_irq(ctrl->wake_irq);
[Severity: High]
Can calling enable_irq(ctrl->irq) here replay a pending
SWRM_INTERRUPT_STATUS_CLK_STOP_FINISHED_V2 interrupt and pulse ctrl->hclk
while the bus is in Clock Stop Mode 0?
swrm_runtime_suspend() only masks SWRM_INTERRUPT_STATUS_MASTER_CLASH_DET
in SWRM_REG_INTERRUPT_CPU_EN, leaving
SWRM_INTERRUPT_STATUS_CLK_STOP_FINISHED_V2 enabled, and ctrl->irq is
requested with IRQF_TRIGGER_RISING. When sdw_bus_clk_stop() broadcasts
ClockStopNow, SWRM_INTERRUPT_STATUS_SPECIAL_CMD_ID_FINISHED wakes
qcom_swrm_irq_handler() and completes ctrl->broadcast, while
CLK_STOP_FINISHED_V2 can assert at the frame boundary after
disable_irq(ctrl->irq) and before clk_disable_unprepare(ctrl->hclk)
finishes gating the clock:
CPU0 CPU1
swrm_runtime_suspend() qcom_swrm_irq_handler()
sdw_bus_clk_stop()
complete(&ctrl->broadcast)
...
disable_irq(ctrl->irq)
<hardirq: CLK_STOP_FINISHED_V2>
handle_fasteoi_irq()
/* sets IRQS_PENDING, masks line */
clk_disable_unprepare(ctrl->hclk)
usleep_range(300, 305)
enable_irq(ctrl->irq)
check_irq_resend()
qcom_swrm_irq_handler()
clk_prepare_enable(ctrl->hclk)
/* CLK_STOP_FINISHED_V2 is a no-op */
clk_disable_unprepare(ctrl->hclk)
<-- pulses bus clock while stopped
Because SWRM_INTERRUPT_STATUS_CLK_STOP_FINISHED_V2 is a no-op in
qcom_swrm_irq_handler() and does not resume the controller, the replayed
handler toggles ctrl->hclk on and off without a clock-stop exit or entry
sequence. On platforms such as x1e80100 and glymur where hclk is the
SoundWire bus clock itself, pulsing the clock while peripherals are in
clock stop corrupts peripheral state and causes subsequent clock-stop
exit failures (bus clash, parity errors, AUTO_ENUM_FAILED).
Masking SWRM_INTERRUPT_STATUS_CLK_STOP_FINISHED_V2 alongside
SWRM_INTERRUPT_STATUS_MASTER_CLASH_DET in SWRM_REG_INTERRUPT_CPU_EN
before issuing sdw_bus_clk_stop() (or leaving only SLAVE_PEND_IRQ
enabled during clock stop) would prevent CLK_STOP_FINISHED_V2 from being
latched while ctrl->irq is disabled.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261128-sdw-qcom-irq-v1-1-d053ac530faa@oss.qualcomm.com?part=1
prev parent reply other threads:[~2026-11-28 8:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 7:44 [PATCH] soundwire: qcom: re-arm the controller interrupt after gating the clock Gopi Chandra Sekhar Reddy Kanala
2026-11-28 8:09 ` sashiko-bot [this message]
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=sashiko-outbox-238531@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=gopi.kanala@oss.qualcomm.com \
--cc=linux-sound@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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