[PATCH 0/2] soundwire: qcom: Fix port handling bugs
From: Srinivas Kandagatla
Date: Wed Jul 01 2026 - 15:31:55 EST
This series fixes two bugs in the Qualcomm SoundWire controller driver
spotted by sashiko-bot:
1. An off-by-one in the port exhaustion check: find_first_zero_bit()
returns the size argument (not size+1) when no free bit is found, so
the existing `pn > maxport` guard is never true. The driver would
silently assign an out-of-range port instead of returning -EBUSY.
2. The sruntime[] array was sized by a hardcoded SWRM_MAX_DAIS constant
(0xF = 15), while the actual port count comes from hardware and can
exceed that with controllers supporting up to 17 ports. Switch to a
dynamic allocation at probe time so the limit tracks the hardware
automatically.
Srinivas Kandagatla (2):
soundwire: qcom: Fix port exhaustion check in stream_alloc_ports
soundwire: qcom: Allocate sruntime array dynamically
drivers/soundwire/qcom.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--
2.53.0