Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Oleg Keri <okerixx@gmail.com>
To: Srinivas Kandagatla <srini@kernel.org>, Vinod Koul <vkoul@kernel.org>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
	linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org, Oleg Keri <okerixx@gmail.com>
Subject: [PATCH v2] soundwire: qcom: disable the interrupt before gating the clock
Date: Fri,  9 Oct 2026 10:26:39 +0200	[thread overview]
Message-ID: <20261009082639.22662-1-okerixx@gmail.com> (raw)
In-Reply-To: <20261007193332.5270-1-okerixx@gmail.com>

swrm_runtime_suspend() gates hclk straight after the ClockStopNow
broadcast, while the interrupt thread that completed it is still
clearing the status and CLK_STOP_FINISHED is about to fire. Both touch
registers with the clock going away; on x1e80100 and glymur hclk is the
SoundWire clock itself. The next clock-stop exit then fails at random
(bus clash, parity errors, AUTO_ENUM_FAILED) and one side of the
speakers stays detached until reboot.

Disable the interrupt before gating the clock and enable it again once
the clock is back.

Fixes: 74e79da9fd46 ("soundwire: qcom: add runtime pm support")
Signed-off-by: Oleg Keri <okerixx@gmail.com>
---
v2: disable_irq() instead of synchronize_irq(), which left a window for
CLK_STOP_FINISHED; about one boot in four still hit it.

 drivers/soundwire/qcom.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index 6e0c5fb10efa..147e55b7a600 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -1801,6 +1801,7 @@ static int __maybe_unused swrm_runtime_resume(struct device *dev)
 	}
 
 	clk_prepare_enable(ctrl->hclk);
+	enable_irq(ctrl->irq);
 
 	if (ctrl->clock_stop_not_supported) {
 		reinit_completion(&ctrl->enumeration);
@@ -1887,6 +1888,7 @@ static int __maybe_unused swrm_runtime_suspend(struct device *dev)
 		}
 	}
 
+	disable_irq(ctrl->irq);
 	clk_disable_unprepare(ctrl->hclk);
 
 	usleep_range(300, 305);
-- 
2.55.0


  reply	other threads:[~2026-10-09  8:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07 19:33 [PATCH] soundwire: qcom: wait for the interrupt thread before gating the clock Oleg Keri
2026-10-09  8:26 ` Oleg Keri [this message]
2026-10-09  8:37   ` [PATCH v2] soundwire: qcom: disable the interrupt " 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=20261009082639.22662-1-okerixx@gmail.com \
    --to=okerixx@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=srini@kernel.org \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.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