Unverified Commit 579a49aa authored by Pei Xiao's avatar Pei Xiao Committed by Mark Brown
Browse files

spi: hisi-kunpeng: Add timeout warning in FIFO flush function



When flushing the FIFO, the driver waits for the busy flag to clear
with a timeout. Change the loop condition to use pre-decrement (--limit)
instead of post-decrement (limit--) so that warning message can show. Add a
ratelimited warning message to log SPI busy timeout events, aiding in
debugging.

Signed-off-by: default avatarPei Xiao <xiaopei01@kylinos.cn>
Link: https://patch.msgid.link/dad95ce42fb5677edfed32bc1f9b3e54df2cf8de.1773889292.git.xiaopei01@kylinos.cn


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9f61daf2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -208,7 +208,10 @@ static void hisi_spi_flush_fifo(struct hisi_spi *hs)
			break;
		}

	} while (hisi_spi_busy(hs) && limit--);
	} while (hisi_spi_busy(hs) && --limit);

	if (!limit)
		dev_warn_ratelimited(hs->dev, "SPI busy timeout\n");
}

/* Disable the controller and all interrupts */