asoc: Fix port collision interrupt in WSA
During multiple PDR usecases, due to sync issues
port collision interrupt is observed.
set wsa state to device down before cancelling the ocp
workqueue and bail out from the workqueue when wsa state
is set to device down.
Change-Id: Ibefb338c1d6d2901b8773928fa2c0c48b51ac6f7
Signed-off-by: Prasad Kumpatla <nkumpat@codeaurora.org>
diff --git a/soc/swr-mstr-ctrl.c b/soc/swr-mstr-ctrl.c
index 539f9b9..5f6329d 100644
--- a/soc/swr-mstr-ctrl.c
+++ b/soc/swr-mstr-ctrl.c
@@ -3280,12 +3280,19 @@
break;
case SWR_DEVICE_SSR_DOWN:
trace_printk("%s: swr device down called\n", __func__);
+ mutex_lock(&swrm->mlock);
+ if (swrm->state == SWR_MSTR_DOWN)
+ dev_dbg(swrm->dev, "%s:SWR master is already Down:%d\n",
+ __func__, swrm->state);
+ else
+ swrm_device_down(&pdev->dev);
mutex_lock(&swrm->devlock);
swrm->dev_up = false;
mutex_unlock(&swrm->devlock);
mutex_lock(&swrm->reslock);
swrm->state = SWR_MSTR_SSR;
mutex_unlock(&swrm->reslock);
+ mutex_unlock(&swrm->mlock);
break;
case SWR_DEVICE_SSR_UP:
/* wait for clk voting to be zero */