ASoC: rockchip: i2s: Fix concurrency between tx/rx
authorSugar Zhang <sugar.zhang@rock-chips.com>
Fri, 3 Sep 2021 13:07:14 +0000 (21:07 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 3 Sep 2021 15:19:01 +0000 (16:19 +0100)
commitfcb958ee8e832e9cdf43408535207e15f14af755
tree7e73f5dab66462ea741b812989238ecf0f191317
parent7eac1e24fbf6c56c9e3be302748ae73104bb40bd
ASoC: rockchip: i2s: Fix concurrency between tx/rx

This patch adds lock to fix comcurrency between tx/rx
to fix 'rockchip-i2s ff070000.i2s; fail to clear'

Considering the situation;

       tx stream              rx stream
           |                      |
           |                   disable
         enable                   |
           |                    reset

After this patch:

         lock
           |
       tx stream
           |
         enable
           |
        unlock
       --------               ---------
                                lock
                                  |
                              rx stream
                                  |
                               disable
                                  |
                                reset
                                  |
                               unlock

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1630674434-650-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/rockchip/rockchip_i2s.c