* [PATCH 1/2] soundwire: bus: downgrade expected unattach warnings to dev_dbg
2026-02-17 23:35 [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset Cole Leavitt
@ 2026-02-17 23:35 ` Cole Leavitt
2026-02-17 23:35 ` [PATCH 2/2] ASoC: cs35l56: set unattach_pending before SoundWire system reset Cole Leavitt
` (5 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Cole Leavitt @ 2026-02-17 23:35 UTC (permalink / raw)
To: vkoul, yung-chuan.liao
Cc: pierre-louis.bossart, david.rhodes, rf, lgirdwood, broonie, perex,
tiwai, linux-sound, patches, linux-kernel, cole
The sdw_handle_slave_status() function emits dev_warn() whenever a
peripheral transitions to UNATTACHED from a previously ATTACHED state.
While useful for debugging genuinely unexpected detachments, this
warning also fires during normal operation when a codec driver
intentionally triggers a system reset (e.g., after firmware download),
causing unnecessary noise in the kernel log on every boot.
Add an 'unattach_pending' flag to struct sdw_slave that codec drivers
can set before triggering an expected detach. When this flag is set,
the bus layer emits a dev_dbg() instead of dev_warn() and clears the
flag, preserving the warning for genuinely unexpected detachments.
Signed-off-by: Cole Leavitt <cole@unwrap.rs>
---
drivers/soundwire/bus.c | 9 +++++++--
include/linux/soundwire/sdw.h | 1 +
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
index fb68738dfb9b..a5a71ab1feed 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -1899,8 +1899,13 @@ int sdw_handle_slave_status(struct sdw_bus *bus,
if (status[i] == SDW_SLAVE_UNATTACHED &&
slave->status != SDW_SLAVE_UNATTACHED) {
- dev_warn(&slave->dev, "Slave %d state check1: UNATTACHED, status was %d\n",
- i, slave->status);
+ if (slave->unattach_pending)
+ dev_dbg(&slave->dev, "Slave %d state check1: UNATTACHED (expected), status was %d\n",
+ i, slave->status);
+ else
+ dev_warn(&slave->dev, "Slave %d state check1: UNATTACHED, status was %d\n",
+ i, slave->status);
+ slave->unattach_pending = false;
sdw_modify_slave_status(slave, SDW_SLAVE_UNATTACHED);
/* Ensure driver knows that peripheral unattached */
diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h
index f462717acf20..4318f2b144e1 100644
--- a/include/linux/soundwire/sdw.h
+++ b/include/linux/soundwire/sdw.h
@@ -682,6 +682,7 @@ struct sdw_slave {
struct completion enumeration_complete;
struct completion initialization_complete;
u32 unattach_request;
+ bool unattach_pending;
bool first_interrupt_done;
bool is_mockup_device;
struct mutex sdw_dev_lock; /* protect callbacks/remove races */
--
2.52.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 2/2] ASoC: cs35l56: set unattach_pending before SoundWire system reset
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
2026-02-18 10:14 ` [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset Richard Fitzgerald
` (4 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Cole Leavitt @ 2026-02-17 23:35 UTC (permalink / raw)
To: vkoul, yung-chuan.liao
Cc: pierre-louis.bossart, david.rhodes, rf, lgirdwood, broonie, perex,
tiwai, linux-sound, patches, linux-kernel, cole
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
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset
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 ` [PATCH 2/2] ASoC: cs35l56: set unattach_pending before SoundWire system reset Cole Leavitt
@ 2026-02-18 10:14 ` Richard Fitzgerald
2026-02-18 10:50 ` Pierre-Louis Bossart
2026-02-18 13:55 ` [PATCH v2] soundwire: bus: demote UNATTACHED slave warnings to dev_dbg Cole Leavitt
` (3 subsequent siblings)
6 siblings, 1 reply; 13+ messages in thread
From: Richard Fitzgerald @ 2026-02-18 10:14 UTC (permalink / raw)
To: Cole Leavitt, vkoul, yung-chuan.liao
Cc: pierre-louis.bossart, david.rhodes, lgirdwood, broonie, perex,
tiwai, linux-sound, patches, linux-kernel
On 17/2/26 23:35, Cole Leavitt wrote:
> On systems with CS35L56 SoundWire codecs (e.g. Lenovo ThinkPad P16
> Gen3), every boot produces misleading dev_warn() messages:
>
> 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
>
Is this really a problem?
They are warns, not errors. Nothing in that message says that this is
an error, or that it's unexpected. The message is accurate.
> These fire when the CS35L56 driver triggers a system reset after
> firmware download, which physically detaches the codec from the bus.
> This is expected and handled gracefully -- the driver waits for
> re-enumeration and the codec recovers within milliseconds.
>
> The warnings were added in commit d1b328557058 ("soundwire: bus: add
> dev_warn() messages to track UNATTACHED devices") to debug genuine
> attachment failures. They remain valuable for unexpected detachments,
> but firing on every boot for normal codec operation degrades their
> diagnostic value.
>
> This series adds a simple boolean flag (unattach_pending) to struct
> sdw_slave that codec drivers can set before triggering an expected
> detach. When set, the bus layer emits dev_dbg() instead of dev_warn()
> and auto-clears the flag.
>
> Note: There is also a separate set of UNATTACHED warnings during
> initial multi-device enumeration, caused by the known PING frame race
> documented in cadence_master.c. That is a different problem with
> different constraints and is not addressed here.
>
> Cole Leavitt (2):
> soundwire: bus: downgrade expected unattach warnings to dev_dbg
> ASoC: cs35l56: set unattach_pending before SoundWire system reset
>
> drivers/soundwire/bus.c | 9 +++++++--
> include/linux/soundwire/sdw.h | 1 +
> sound/soc/codecs/cs35l56.c | 4 ++++
> 3 files changed, 12 insertions(+), 2 deletions(-)
>
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset
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
0 siblings, 2 replies; 13+ messages in thread
From: Pierre-Louis Bossart @ 2026-02-18 10:50 UTC (permalink / raw)
To: Richard Fitzgerald, Cole Leavitt, vkoul, yung-chuan.liao
Cc: david.rhodes, lgirdwood, broonie, perex, tiwai, linux-sound,
patches, linux-kernel
On 2/18/26 11:14, Richard Fitzgerald wrote:
> On 17/2/26 23:35, Cole Leavitt wrote:
>> On systems with CS35L56 SoundWire codecs (e.g. Lenovo ThinkPad P16
>> Gen3), every boot produces misleading dev_warn() messages:
>>
>> 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
>>
>
> Is this really a problem?
> They are warns, not errors. Nothing in that message says that this is
> an error, or that it's unexpected. The message is accurate.
I would just demote the dev_warn() to dev_dbg().
If you look at the original commit, we were chasing weird cases where we have dyndng enabled anyways.
Also IIRC the problem with 2 devices on the same link was fixed by Richard, wasn't it?
That would make the dev_warn() even less useful.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset
2026-02-18 10:50 ` Pierre-Louis Bossart
@ 2026-02-18 11:01 ` Richard Fitzgerald
2026-02-18 12:49 ` Charles Keepax
1 sibling, 0 replies; 13+ messages in thread
From: Richard Fitzgerald @ 2026-02-18 11:01 UTC (permalink / raw)
To: Pierre-Louis Bossart, Cole Leavitt, vkoul, yung-chuan.liao
Cc: david.rhodes, lgirdwood, broonie, perex, tiwai, linux-sound,
patches, linux-kernel
On 18/2/26 10:50, Pierre-Louis Bossart wrote:
> On 2/18/26 11:14, Richard Fitzgerald wrote:
>> On 17/2/26 23:35, Cole Leavitt wrote:
>>> On systems with CS35L56 SoundWire codecs (e.g. Lenovo ThinkPad P16
>>> Gen3), every boot produces misleading dev_warn() messages:
>>>
>>> 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
>>>
>>
>> Is this really a problem?
>> They are warns, not errors. Nothing in that message says that this is
>> an error, or that it's unexpected. The message is accurate.
>
> I would just demote the dev_warn() to dev_dbg().
> If you look at the original commit, we were chasing weird cases where we have dyndng enabled anyways.
> Also IIRC the problem with 2 devices on the same link was fixed by Richard, wasn't it?
> That would make the dev_warn() even less useful.
>
Oh, does it date all the way back to that multiple device problem?
If that's the one I'm thinking of, as I recall it was Simon Trimmer
who fixed that.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset
2026-02-18 10:50 ` Pierre-Louis Bossart
2026-02-18 11:01 ` Richard Fitzgerald
@ 2026-02-18 12:49 ` Charles Keepax
1 sibling, 0 replies; 13+ messages in thread
From: Charles Keepax @ 2026-02-18 12:49 UTC (permalink / raw)
To: Pierre-Louis Bossart
Cc: Richard Fitzgerald, Cole Leavitt, vkoul, yung-chuan.liao,
david.rhodes, lgirdwood, broonie, perex, tiwai, linux-sound,
patches, linux-kernel
On Wed, Feb 18, 2026 at 11:50:55AM +0100, Pierre-Louis Bossart wrote:
> On 2/18/26 11:14, Richard Fitzgerald wrote:
> > On 17/2/26 23:35, Cole Leavitt wrote:
> >> On systems with CS35L56 SoundWire codecs (e.g. Lenovo ThinkPad P16
> >> Gen3), every boot produces misleading dev_warn() messages:
> >>
> >> 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
> >>
> >
> > Is this really a problem?
> > They are warns, not errors. Nothing in that message says that this is
> > an error, or that it's unexpected. The message is accurate.
>
> I would just demote the dev_warn() to dev_dbg().
> If you look at the original commit, we were chasing weird cases where we have dyndng enabled anyways.
> Also IIRC the problem with 2 devices on the same link was fixed by Richard, wasn't it?
> That would make the dev_warn() even less useful.
I would vote for either this or just leave it as is, doesn't seem
worth the additional complexity to avoid it dynamically.
Thanks,
Charles
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2] soundwire: bus: demote UNATTACHED slave warnings to dev_dbg
2026-02-17 23:35 [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset Cole Leavitt
` (2 preceding siblings ...)
2026-02-18 10:14 ` [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset Richard Fitzgerald
@ 2026-02-18 13:55 ` Cole Leavitt
2026-02-18 14:00 ` [PATCH v3] " Cole Leavitt
` (2 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Cole Leavitt @ 2026-02-18 13:55 UTC (permalink / raw)
To: Vinod Koul, Bard Liao
Cc: Pierre-Louis Bossart, Richard Fitzgerald, Charles Keepax,
linux-sound, linux-kernel, Cole Leavitt
The dev_warn() messages in sdw_handle_slave_status() for UNATTACHED
transitions were added in commit d1b328557058 ("soundwire: bus: add
dev_warn() messages to track UNATTACHED devices") to debug attachment
failures with dynamic debug enabled.
These warnings fire during normal operation -- for example when a codec
driver triggers a system reset after firmware download, or during
initial multi-device enumeration due to the PING frame race documented
in cadence_master.c -- producing misleading noise on every boot.
The original debugging use case is fully served by dev_dbg(), which
remains visible when dynamic debug is enabled. Demote both state
check warnings to dev_dbg().
Signed-off-by: Cole Leavitt <cole@unwrap.rs>
---
drivers/soundwire/bus.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
index fb68738dfb9b..45234cc07f35 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -1899,8 +1899,8 @@ int sdw_handle_slave_status(struct sdw_bus *bus,
if (status[i] == SDW_SLAVE_UNATTACHED &&
slave->status != SDW_SLAVE_UNATTACHED) {
- dev_warn(&slave->dev, "Slave %d state check1: UNATTACHED, status was %d\n",
- i, slave->status);
+ dev_dbg(&slave->dev, "Slave %d state check1: UNATTACHED, status was %d\n",
+ i, slave->status);
sdw_modify_slave_status(slave, SDW_SLAVE_UNATTACHED);
/* Ensure driver knows that peripheral unattached */
@@ -1951,8 +1951,8 @@ int sdw_handle_slave_status(struct sdw_bus *bus,
if (slave->status == SDW_SLAVE_UNATTACHED)
break;
- dev_warn(&slave->dev, "Slave %d state check2: UNATTACHED, status was %d\n",
- i, slave->status);
+ dev_dbg(&slave->dev, "Slave %d state check2: UNATTACHED, status was %d\n",
+ i, slave->status);
sdw_modify_slave_status(slave, SDW_SLAVE_UNATTACHED);
break;
--
2.52.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v3] soundwire: bus: demote UNATTACHED slave warnings to dev_dbg
2026-02-17 23:35 [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset Cole Leavitt
` (3 preceding siblings ...)
2026-02-18 13:55 ` [PATCH v2] soundwire: bus: demote UNATTACHED slave warnings to dev_dbg Cole Leavitt
@ 2026-02-18 14:00 ` 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-03-09 7:05 ` [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset Vinod Koul
6 siblings, 1 reply; 13+ messages in thread
From: Cole Leavitt @ 2026-02-18 14:00 UTC (permalink / raw)
To: Vinod Koul, Bard Liao
Cc: Pierre-Louis Bossart, Richard Fitzgerald, Charles Keepax,
linux-sound, linux-kernel, Cole Leavitt
The dev_warn() messages in sdw_handle_slave_status() for UNATTACHED
transitions were added in commit d1b328557058 ("soundwire: bus: add
dev_warn() messages to track UNATTACHED devices") to debug attachment
failures with dynamic debug enabled.
These warnings fire during normal operation -- for example when a codec
driver triggers a system reset after firmware download, or during
initial multi-device enumeration due to the PING frame race documented
in cadence_master.c -- producing misleading noise on every boot.
The original debugging use case is fully served by dev_dbg(), which
remains visible when dynamic debug is enabled. Demote both state
check warnings to dev_dbg().
Fixes: d1b328557058 ("soundwire: bus: add dev_warn() messages to track UNATTACHED devices")
Signed-off-by: Cole Leavitt <cole@unwrap.rs>
---
Changes in v3:
- Add Fixes tag and version changelog
Changes in v2:
- Drop unattach_pending flag approach entirely per reviewer feedback
(Pierre-Louis, Richard, Charles)
- Simply demote dev_warn() to dev_dbg() unconditionally
- Single patch instead of 2-patch series
drivers/soundwire/bus.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
index fb68738dfb9b..45234cc07f35 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -1899,8 +1899,8 @@ int sdw_handle_slave_status(struct sdw_bus *bus,
if (status[i] == SDW_SLAVE_UNATTACHED &&
slave->status != SDW_SLAVE_UNATTACHED) {
- dev_warn(&slave->dev, "Slave %d state check1: UNATTACHED, status was %d\n",
- i, slave->status);
+ dev_dbg(&slave->dev, "Slave %d state check1: UNATTACHED, status was %d\n",
+ i, slave->status);
sdw_modify_slave_status(slave, SDW_SLAVE_UNATTACHED);
/* Ensure driver knows that peripheral unattached */
@@ -1951,8 +1951,8 @@ int sdw_handle_slave_status(struct sdw_bus *bus,
if (slave->status == SDW_SLAVE_UNATTACHED)
break;
- dev_warn(&slave->dev, "Slave %d state check2: UNATTACHED, status was %d\n",
- i, slave->status);
+ dev_dbg(&slave->dev, "Slave %d state check2: UNATTACHED, status was %d\n",
+ i, slave->status);
sdw_modify_slave_status(slave, SDW_SLAVE_UNATTACHED);
break;
--
2.52.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH v3] soundwire: bus: demote UNATTACHED slave warnings to dev_dbg
2026-02-18 14:00 ` [PATCH v3] " Cole Leavitt
@ 2026-02-18 16:52 ` Pierre-Louis Bossart
0 siblings, 0 replies; 13+ messages in thread
From: Pierre-Louis Bossart @ 2026-02-18 16:52 UTC (permalink / raw)
To: Cole Leavitt, Vinod Koul, Bard Liao
Cc: Richard Fitzgerald, Charles Keepax, linux-sound, linux-kernel
On 2/18/26 15:00, Cole Leavitt wrote:
> The dev_warn() messages in sdw_handle_slave_status() for UNATTACHED
> transitions were added in commit d1b328557058 ("soundwire: bus: add
> dev_warn() messages to track UNATTACHED devices") to debug attachment
> failures with dynamic debug enabled.
>
> These warnings fire during normal operation -- for example when a codec
> driver triggers a system reset after firmware download, or during
> initial multi-device enumeration due to the PING frame race documented
> in cadence_master.c -- producing misleading noise on every boot.
That second sentence doesn't seem right.
The problem documented in cadence_master.c was that devices may report as ATTACHED at the same time, but the detector only sees one device.
As a result only one of the two devices would be assigned a non-zero device number.
But the second device does not lose sync and never becomes UNATTACHED.
> The original debugging use case is fully served by dev_dbg(), which
> remains visible when dynamic debug is enabled. Demote both state
> check warnings to dev_dbg().
>
> Fixes: d1b328557058 ("soundwire: bus: add dev_warn() messages to track UNATTACHED devices")
> Signed-off-by: Cole Leavitt <cole@unwrap.rs>
> ---
> Changes in v3:
> - Add Fixes tag and version changelog
>
> Changes in v2:
> - Drop unattach_pending flag approach entirely per reviewer feedback
> (Pierre-Louis, Richard, Charles)
> - Simply demote dev_warn() to dev_dbg() unconditionally
> - Single patch instead of 2-patch series
>
> drivers/soundwire/bus.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
> index fb68738dfb9b..45234cc07f35 100644
> --- a/drivers/soundwire/bus.c
> +++ b/drivers/soundwire/bus.c
> @@ -1899,8 +1899,8 @@ int sdw_handle_slave_status(struct sdw_bus *bus,
>
> if (status[i] == SDW_SLAVE_UNATTACHED &&
> slave->status != SDW_SLAVE_UNATTACHED) {
> - dev_warn(&slave->dev, "Slave %d state check1: UNATTACHED, status was %d\n",
> - i, slave->status);
> + dev_dbg(&slave->dev, "Slave %d state check1: UNATTACHED, status was %d\n",
> + i, slave->status);
> sdw_modify_slave_status(slave, SDW_SLAVE_UNATTACHED);
>
> /* Ensure driver knows that peripheral unattached */
> @@ -1951,8 +1951,8 @@ int sdw_handle_slave_status(struct sdw_bus *bus,
> if (slave->status == SDW_SLAVE_UNATTACHED)
> break;
>
> - dev_warn(&slave->dev, "Slave %d state check2: UNATTACHED, status was %d\n",
> - i, slave->status);
> + dev_dbg(&slave->dev, "Slave %d state check2: UNATTACHED, status was %d\n",
> + i, slave->status);
>
> sdw_modify_slave_status(slave, SDW_SLAVE_UNATTACHED);
> break;
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v4] soundwire: bus: demote UNATTACHED state warnings to dev_dbg()
2026-02-17 23:35 [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset Cole Leavitt
` (4 preceding siblings ...)
2026-02-18 14:00 ` [PATCH v3] " Cole Leavitt
@ 2026-02-18 18:02 ` 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
6 siblings, 1 reply; 13+ messages in thread
From: Cole Leavitt @ 2026-02-18 18:02 UTC (permalink / raw)
To: vkoul, yung-chuan.liao
Cc: pierre-louis.bossart, rf, ckeepax, linux-sound, linux-kernel,
Cole Leavitt
The dev_warn() messages in sdw_handle_slave_status() for UNATTACHED
transitions were added in commit d1b328557058 ("soundwire: bus: add
dev_warn() messages to track UNATTACHED devices") to debug attachment
failures with dynamic debug enabled.
These warnings fire during normal operation -- for example when a codec
driver triggers a hardware reset after firmware download, causing the
device to momentarily go UNATTACHED before re-attaching -- producing
misleading noise on every boot.
Demote the messages to dev_dbg() so they remain available via dynamic
debug for diagnosing real attachment failures without alarming users
during expected initialization sequences.
Fixes: d1b328557058 ("soundwire: bus: add dev_warn() messages to track UNATTACHED devices")
Signed-off-by: Cole Leavitt <cole@unwrap.rs>
---
Changes in v4:
- Remove incorrect PING frame race reference from commit message
(Pierre-Louis Bossart)
- Clarify that the actual trigger is codec hardware reset after
firmware download
Changes in v3:
- Add Fixes tag and version changelog
Changes in v2:
- Drop unattach_pending flag approach entirely per reviewer feedback
(Pierre-Louis, Richard, Charles)
- Simply demote dev_warn() to dev_dbg() unconditionally
- Single patch instead of 2-patch series
drivers/soundwire/bus.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
index fb68738dfb9b..fe5316d93fef 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -1899,8 +1899,8 @@ int sdw_handle_slave_status(struct sdw_bus *bus,
if (status[i] == SDW_SLAVE_UNATTACHED &&
slave->status != SDW_SLAVE_UNATTACHED) {
- dev_warn(&slave->dev, "Slave %d state check1: UNATTACHED, status was %d\n",
- i, slave->status);
+ dev_dbg(&slave->dev, "Slave %d state check1: UNATTACHED, status was %d\n",
+ i, slave->status);
sdw_modify_slave_status(slave, SDW_SLAVE_UNATTACHED);
/* Ensure driver knows that peripheral unattached */
@@ -1951,8 +1951,8 @@ int sdw_handle_slave_status(struct sdw_bus *bus,
if (slave->status == SDW_SLAVE_UNATTACHED)
break;
- dev_warn(&slave->dev, "Slave %d state check2: UNATTACHED, status was %d\n",
- i, slave->status);
+ dev_dbg(&slave->dev, "Slave %d state check2: UNATTACHED, status was %d\n",
+ i, slave->status);
sdw_modify_slave_status(slave, SDW_SLAVE_UNATTACHED);
break;
--
2.52.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH v4] soundwire: bus: demote UNATTACHED state warnings to dev_dbg()
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
0 siblings, 0 replies; 13+ messages in thread
From: Richard Fitzgerald @ 2026-02-23 15:20 UTC (permalink / raw)
To: Cole Leavitt, vkoul, yung-chuan.liao
Cc: pierre-louis.bossart, ckeepax, linux-sound, linux-kernel
On 18/02/2026 6:02 pm, Cole Leavitt wrote:
> The dev_warn() messages in sdw_handle_slave_status() for UNATTACHED
> transitions were added in commit d1b328557058 ("soundwire: bus: add
> dev_warn() messages to track UNATTACHED devices") to debug attachment
> failures with dynamic debug enabled.
>
> These warnings fire during normal operation -- for example when a codec
> driver triggers a hardware reset after firmware download, causing the
> device to momentarily go UNATTACHED before re-attaching -- producing
> misleading noise on every boot.
>
> Demote the messages to dev_dbg() so they remain available via dynamic
> debug for diagnosing real attachment failures without alarming users
> during expected initialization sequences.
>
> Fixes: d1b328557058 ("soundwire: bus: add dev_warn() messages to track UNATTACHED devices")
> Signed-off-by: Cole Leavitt <cole@unwrap.rs>
> ---
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset
2026-02-17 23:35 [PATCH 0/2] soundwire: suppress expected unattach warnings during codec reset Cole Leavitt
` (5 preceding siblings ...)
2026-02-18 18:02 ` [PATCH v4] soundwire: bus: demote UNATTACHED state warnings to dev_dbg() Cole Leavitt
@ 2026-03-09 7:05 ` Vinod Koul
6 siblings, 0 replies; 13+ messages in thread
From: Vinod Koul @ 2026-03-09 7:05 UTC (permalink / raw)
To: yung-chuan.liao, Cole Leavitt
Cc: pierre-louis.bossart, david.rhodes, rf, lgirdwood, broonie, perex,
tiwai, linux-sound, patches, linux-kernel
On Tue, 17 Feb 2026 16:35:31 -0700, Cole Leavitt wrote:
> On systems with CS35L56 SoundWire codecs (e.g. Lenovo ThinkPad P16
> Gen3), every boot produces misleading dev_warn() messages:
>
> 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
>
> These fire when the CS35L56 driver triggers a system reset after
> firmware download, which physically detaches the codec from the bus.
> This is expected and handled gracefully -- the driver waits for
> re-enumeration and the codec recovers within milliseconds.
>
> [...]
Applied, thanks!
[1/1] soundwire: bus: demote UNATTACHED state warnings to dev_dbg()
commit: 2c96956fe764f8224f9ec93b2a9160a578949a7a
Best regards,
--
~Vinod
^ permalink raw reply [flat|nested] 13+ messages in thread