mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cole Leavitt <cole@unwrap.rs>
To: vkoul@kernel.org, yung-chuan.liao@linux.intel.com
Cc: pierre-louis.bossart@linux.dev, david.rhodes@cirrus.com,
	rf@opensource.cirrus.com, lgirdwood@gmail.com,
	broonie@kernel.org, perex@perex.cz, tiwai@suse.com,
	linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
	linux-kernel@vger.kernel.org, cole@unwrap.rs
Subject: [PATCH 2/2] ASoC: cs35l56: set unattach_pending before SoundWire system reset
Date: Tue, 17 Feb 2026 16:35:33 -0700	[thread overview]
Message-ID: <20260217233533.4716-3-cole@unwrap.rs> (raw)
In-Reply-To: <20260217233533.4716-1-cole@unwrap.rs>

The CS35L56 driver triggers a system reset after firmware download and
during initial probe when no hardware reset GPIO is available. This
reset physically detaches the codec from the SoundWire bus while the
driver waits for re-enumeration, which is expected and handled
gracefully.

However, the bus layer emits a dev_warn() for this intentional
transition to UNATTACHED because it cannot distinguish expected
detachments from genuine failures. This produces misleading warnings
on every boot for systems with CS35L56 codecs on SoundWire:

  cs35l56 sdw:0:2:01fa:3556:01:0: Slave 2 state check1: UNATTACHED, status was 1
  cs35l56 sdw:0:2:01fa:3556:01:1: Slave 1 state check1: UNATTACHED, status was 1

Set the unattach_pending flag on the SoundWire peripheral before
triggering a system reset in both the firmware patch path and the
initial probe soft reset path. This allows the bus layer to downgrade
the warning to dev_dbg() for these expected transitions.

Signed-off-by: Cole Leavitt <cole@unwrap.rs>
---
 sound/soc/codecs/cs35l56.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c
index 2ff8b172b76e..6566350a59c7 100644
--- a/sound/soc/codecs/cs35l56.c
+++ b/sound/soc/codecs/cs35l56.c
@@ -807,6 +807,8 @@ static void cs35l56_patch(struct cs35l56_private *cs35l56, bool firmware_missing
 	reinit_completion(&cs35l56->init_completion);
 
 	cs35l56->soft_resetting = true;
+	if (cs35l56->sdw_peripheral)
+		cs35l56->sdw_peripheral->unattach_pending = true;
 	cs35l56_system_reset(&cs35l56->base, !!cs35l56->sdw_peripheral);
 
 	if (cs35l56->sdw_peripheral) {
@@ -1903,6 +1905,8 @@ int cs35l56_init(struct cs35l56_private *cs35l56)
 	if (!cs35l56->base.reset_gpio) {
 		dev_dbg(cs35l56->base.dev, "No reset gpio: using soft reset\n");
 		cs35l56->soft_resetting = true;
+		if (cs35l56->sdw_peripheral)
+			cs35l56->sdw_peripheral->unattach_pending = true;
 		cs35l56_system_reset(&cs35l56->base, !!cs35l56->sdw_peripheral);
 		if (cs35l56->sdw_peripheral) {
 			/* Keep alive while we wait for re-enumeration */
-- 
2.52.0


  parent reply	other threads:[~2026-02-17 23:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-17 23:35 [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset Cole Leavitt
2026-02-17 23:35 ` [PATCH 1/2] soundwire: bus: downgrade expected unattach warnings to dev_dbg Cole Leavitt
2026-02-17 23:35 ` Cole Leavitt [this message]
2026-02-18 10:14 ` [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset Richard Fitzgerald
2026-02-18 10:50   ` Pierre-Louis Bossart
2026-02-18 11:01     ` Richard Fitzgerald
2026-02-18 12:49     ` Charles Keepax
2026-02-18 13:55 ` [PATCH v2] soundwire: bus: demote UNATTACHED slave warnings to dev_dbg Cole Leavitt
2026-02-18 14:00 ` [PATCH v3] " Cole Leavitt
2026-02-18 16:52   ` Pierre-Louis Bossart
2026-02-18 18:02 ` [PATCH v4] soundwire: bus: demote UNATTACHED state warnings to dev_dbg() Cole Leavitt
2026-02-23 15:20   ` Richard Fitzgerald
2026-03-09  7:05 ` [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset Vinod Koul

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=20260217233533.4716-3-cole@unwrap.rs \
    --to=cole@unwrap.rs \
    --cc=broonie@kernel.org \
    --cc=david.rhodes@cirrus.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=rf@opensource.cirrus.com \
    --cc=tiwai@suse.com \
    --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

all inboxes | Powered by JetHome®