summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorTim Surber <me@timsurber.de>2026-11-11 22:51:20 +0100
committerMark Brown <broonie@kernel.org>2026-11-18 18:20:40 +0000
commit6a4f9e7cf13ecbcc45ece48c7a0ce164feb120eb (patch)
treec1aaa0cdd959e6ebd71f599f6396b78ee863ff5c /tools/perf/scripts/python
parentc07bf60ce5878dc3602d5271785589a7e5e1d1fa (diff)
ASoC: rockchip: i2s-tdm: Don't reset a pending clear in consumer mode
When a stream stops, rockchip_snd_xfer_clear() sets the TXC/RXC bits in I2S_CLR and waits for the controller to clear them. The clear only completes while the bit clock runs. In consumer mode the provider may already have stopped the clock, e.g. the RK3588 HDMI receiver while its source sends no audio. The wait then times out, the driver logs "clear failed, reset rx" and pulses the M reset of the direction. The M reset does not cancel the clear; I2S_CLR keeps reading 0x2. The clear still completes once the provider restarts the clock, but on some occasions the reset leaves the controller in a state where it never does. Every later stream then reads no data, its own stop fails the same way, and only a reboot recovers. Don't reset in consumer mode and leave the clear pending instead, and add a prepare callback that waits for a pending clear before the stream is started. On the board below the clear completes about 11 ms after the HDMI receiver has re-enabled its audio output in its hw_params. If the clock does not come back within 100 ms, fail the prepare with -ETIMEDOUT rather than start the transfer with the clear pending. Provider mode is unchanged: the clock is generated from mclk, so a pending clear completes right away. To reproduce, on a FriendlyElec CM3588 NAS (RK3588) with HDMI0 cabled into its HDMI receiver and the HDMI sound cards enabled in the device tree: capture from the receiver a few times while nothing plays, then capture while a tone plays on HDMI0: for i in 1 2 3; do arecord -q -D hw:HDMIIN -f S16_LE -r 48000 -c 2 -d 1 /dev/null done speaker-test -D hw:HDMI0 -c 2 -r 48000 -t sine >/dev/null & sleep 1 arecord -q -D hw:HDMIIN -f S16_LE -r 48000 -c 2 -d 1 /dev/null echo "rc=$?"; kill $! On linux-rockchip for-next the last capture fails: arecord: pcm_read:2285: read error: Input/output error rc=1 rockchip-i2s-tdm fddf8000.i2s: clear failed, reset rx Once this has happened a few times, every capture fails until reboot. The test ran 9 such sequences in a row after a fresh boot: 1, 3, 6 and 10 captures without source audio at 48 kHz, 3 at 32 and 44.1 kHz, and two runs that also stop the source during a capture. Each sequence was followed by two captures with source audio, and the runs that stop the source by two more after that: captures with source audio that returned the tone for-next 1 of 22, stuck from the 2nd sequence on for-next + this patch 22 of 22 With this patch, captures without source audio still return no data, but they now fail in prepare with -ETIMEDOUT and leave the controller usable. Fixes: 081068fd6414 ("ASoC: rockchip: add support for i2s-tdm controller") Signed-off-by: Tim Surber <me@timsurber.de> Link: https://patch.msgid.link/20261111215125.3560398-1-me@timsurber.de Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions