Skip to contentSkip to conversation

dmaengine: qcom_hidma: prevent disable in error

PATCH Applied Sinan Kaya 2 participants 2 messages Oct 6, 2016 – Oct 18, 2016

Subsystems (3)
lore
Share & tools
lore

Sinan Kaya

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/dma/qcom/hidma_ll.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)
drivers/dma/qcom/hidma_ll.c +2 -13
index 3224f24..c3a66c9 100644
@@ -564,19 +564,8 @@ int hidma_ll_disable(struct hidma_lldev *lldev)
 	u32 val;
 	int ret;
 
-	val = readl(lldev->evca + HIDMA_EVCA_CTRLSTS_REG);
-	lldev->evch_state = HIDMA_CH_STATE(val);
-	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))
+	/* The channel needs to be in working state */
+	if (!hidma_ll_isenabled(lldev))
 		return 0;
 
 	val = readl(lldev->trca + HIDMA_TRCA_CTRLSTS_REG);
Signature · 1 line
1.9.1
Applied
#1 lore raw
Quoted 6 lines · Sinan Kaya

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.

Applied, thanks

Signature · 1 line
~Vinod