Skip to contentSkip to conversation

soundwire: stream: restore cumulative bus bandwidth when compute_params callback failed

PATCH Applied Bard Liao 2 participants 2 messages Mar 16, 2023 SoundWire

lore
Share & tools
lore

Bard Liao

author maintainer
#0 lore raw

PATCH 1/1 soundwire: stream: restore cumulative bus bandwidth when compute_params callback failed

From: Shuming Fan <[email protected]>

The _sdw_prepare_stream function just returns the error code when compute_params callback failed.
The cumulative bus bandwidth will keep the value and won't be decreased by sdw_deprepare_stream function.
We should restore the value of cumulative bus bandwidth when compute_params callback failed.

---
 drivers/soundwire/stream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soundwire/stream.c +1 -1
index 8c6da1739e3d..136b6850a3f0 100644
@@ -1369,7 +1369,7 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream,
 			if (ret < 0) {
 				dev_err(bus->dev, "Compute params failed: %d\n",
 					ret);
-				return ret;
+				goto restore_params;
 			}
 		}
 
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 8 lines · Bard Liao

From: Shuming Fan <[email protected]>

The _sdw_prepare_stream function just returns the error code when compute_params callback failed.
The cumulative bus bandwidth will keep the value and won't be decreased by sdw_deprepare_stream function.
We should restore the value of cumulative bus bandwidth when compute_params callback failed.

Applied, thanks

Signature · 1 line
~Vinod