Skip to content
Unverified Commit 0ea15e98 authored by Nicolas Frattaroli's avatar Nicolas Frattaroli Committed by Mark Brown
Browse files

ASoC: rockchip: i2s-tdm: Fix refcount test

During development of V5 of the i2s-tdm patch series, I replaced
the atomic refcount with a regular integer, as it was only ever
accessed within a spinlock.

Foolishly, I got the semantics of atomic_dec_and_test wrong, which
resulted in a test for 0 actually becoming a test for >0.

The result was that setting the audio frequency broke; switching
from 44100 Hz audio playback to 96000 Hz audio playback would
garble the sound most unpleasantly.

Fix this by checking for --refcount == 0, which is what it should
have been all along.

Fixes: 081068fd

 ("ASoC: rockchip: add support for i2s-tdm controller")
Signed-off-by: default avatarNicolas Frattaroli <frattaroli.nicolas@gmail.com>
Link: https://lore.kernel.org/r/20211015210730.308946-1-frattaroli.nicolas@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent bc387887
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment