Re: [PATCH] soundwire: qcom: wait for fifo space to be available before read/write

2021-04-01 Thread Vinod Koul
On 31-03-21, 18:00, Srinivas Kandagatla wrote: > If we write registers very fast we can endup in a situation where some > of the writes will be dropped without any notice. > > So wait for the fifo space to be available before reading/writing the > soundwire registers. > > Signed-off-by: Srinivas

Re: [PATCH] soundwire: qcom: wait for fifo space to be available before read/write

2021-03-31 Thread Pierre-Louis Bossart
+static int swrm_wait_for_rd_fifo_avail(struct qcom_swrm_ctrl *swrm) +{ + u32 fifo_outstanding_cmd, value; + u8 fifo_retry_count = SWR_OVERFLOW_RETRY_COUNT; + + /* Check for fifo underflow during read */ + swrm->reg_read(swrm, SWRM_CMD_FIFO_STATUS, &value); + fifo_

[PATCH] soundwire: qcom: wait for fifo space to be available before read/write

2021-03-31 Thread Srinivas Kandagatla
If we write registers very fast we can endup in a situation where some of the writes will be dropped without any notice. So wait for the fifo space to be available before reading/writing the soundwire registers. Signed-off-by: Srinivas Kandagatla --- drivers/soundwire/qcom.c | 74 ++