]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
regmap: sdw-mbq: Fix swap of timeout and retry times
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Tue, 11 Aug 2026 13:18:16 +0000 (14:18 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 11 Aug 2026 15:37:59 +0000 (16:37 +0100)
When polling Function Busy using read_poll_timeout() the total timeout
and retry delay arguments are swapped. This leads to only a single retry
being processed, it seems the existing users typically do succeed before
the first retry.

Swap the arguments over to ensure the correct polling time.

Reported-by: Ville Saarinen <wiza@saarinenkoti.fi>
Link: https://lore.kernel.org/linux-sound/ansTPGgVNoDJlA5r@opensource.cirrus.com/T/#m680731a2f307f1f5176b27ed5aa560ddc94e5d62
Fixes: 5bc493bf0c37 ("regmap: sdw-mbq: Add support for SDCA deferred controls")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260811131816.332082-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap-sdw-mbq.c

index 2585933d4946b7e9ea5fc4531800c4adf0bb2f98..6d7c760cbef2b004365d12e4367aa523a4acd123 100644 (file)
@@ -59,7 +59,7 @@ static int regmap_sdw_mbq_poll_busy(struct sdw_slave *slave, unsigned int reg,
        if (ctx->readable_reg(dev, reg)) {
                ret = read_poll_timeout(sdw_read_no_pm, val,
                                        val < 0 || !(val & SDCA_CTL_ENTITY_0_FUNCTION_BUSY),
-                                       ctx->cfg.timeout_us, ctx->cfg.retry_us,
+                                       ctx->cfg.retry_us, ctx->cfg.timeout_us,
                                        false, slave, reg);
                if (val < 0)
                        return val;