提交 7dcec757 编写于 作者: S Sinan Kaya 提交者: Vinod Koul

dmaengine: qcom_hidma: prevent disable in error

When an error is observed, we try to disable the channel and prevent
further accesses from the client.

Depending on the type of error, transitioning into disabled state might
not be possible. Adding a check to make sure that HW is in enabled/running
state before the disable transition happens.
Signed-off-by: NSinan Kaya <okaya@codeaurora.org>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 1001354c
...@@ -564,19 +564,8 @@ int hidma_ll_disable(struct hidma_lldev *lldev) ...@@ -564,19 +564,8 @@ int hidma_ll_disable(struct hidma_lldev *lldev)
u32 val; u32 val;
int ret; int ret;
val = readl(lldev->evca + HIDMA_EVCA_CTRLSTS_REG); /* The channel needs to be in working state */
lldev->evch_state = HIDMA_CH_STATE(val); if (!hidma_ll_isenabled(lldev))
val = readl(lldev->trca + HIDMA_TRCA_CTRLSTS_REG);
lldev->trch_state = HIDMA_CH_STATE(val);
/* already suspended by this OS */
if ((lldev->trch_state == HIDMA_CH_SUSPENDED) ||
(lldev->evch_state == HIDMA_CH_SUSPENDED))
return 0;
/* already stopped by the manager */
if ((lldev->trch_state == HIDMA_CH_STOPPED) ||
(lldev->evch_state == HIDMA_CH_STOPPED))
return 0; return 0;
val = readl(lldev->trca + HIDMA_TRCA_CTRLSTS_REG); val = readl(lldev->trca + HIDMA_TRCA_CTRLSTS_REG);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册