Skip to contentSkip to conversation

dmaengine: intel_mid_dma: minor fixes

PATCH Applied Adrian Hunter 2 participants 6 messages Jan 31, 2012 – Feb 22, 2012 dmaengine

lore
Share & tools
lore
#0 lore raw

cover dmaengine: intel_mid_dma: minor fixes

Hi

Here are 2 minor fixes for intel_mid_dma.

Adrian Hunter (2):
dmaengine: intel_mid_dma: fix error status mask
dmaengine: intel_mid_dma: move pm_runtime_put

 drivers/dma/intel_mid_dma.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Regards
Adrian Hunter

#1 lore raw

PATCH 1/2 dmaengine: intel_mid_dma: fix error status mask

The error status mask (MASK_ERR) has the same format as the other masks (MASK_TFR, MASK_BLOCK etc) and must be cleared the same way.

---
 drivers/dma/intel_mid_dma.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/dma/intel_mid_dma.c +2 -1
index 74f70aa..512e2ab 100644
@@ -1056,7 +1056,8 @@ static irqreturn_t intel_mid_dma_interrupt(int irq, void *data)
 	}
 	err_status &= mid->intr_mask;
 	if (err_status) {
-		iowrite32(MASK_INTR_REG(err_status), mid->dma_base + MASK_ERR);
+		iowrite32((err_status << INT_MASK_WE),
+			  mid->dma_base + MASK_ERR);
 		call_tasklet = 1;
 	}
 	if (call_tasklet)
Signature · 1 line
1.7.6.4
#2 lore raw

Re: [PATCH 1/2] dmaengine: intel_mid_dma: fix error status mask

Quoted 13 lines · Adrian Hunter

The error status mask (MASK_ERR) has the same format as the other masks (MASK_TFR, MASK_BLOCK etc) and must be cleared the same way.

---
 drivers/dma/intel_mid_dma.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/dma/intel_mid_dma.c +0 -0
index 74f70aa..512e2ab 100644

drivers/dma/intel_mid_dma.c static irqreturn_t intel_mid_dma_interrupt(int irq, void *data) · line 1060

Quoted 6 lines
drivers/dma/intel_mid_dma.c +2 -1
@@ -1056,7 +1056,8 @@ static irqreturn_t intel_mid_dma_interrupt(int irq, void *data)
 	}
 	err_status &= mid->intr_mask;
 	if (err_status) {
-		iowrite32(MASK_INTR_REG(err_status), mid->dma_base + MASK_ERR);
+		iowrite32((err_status << INT_MASK_WE),
+			  mid->dma_base + MASK_ERR);

why not use the macro?

Quoted 3 lines
drivers/dma/intel_mid_dma.c +0 -0
 		call_tasklet = 1;
 	}
 	if (call_tasklet)
Signature · 1 line
~Vinod
#3 lore raw

Re: [PATCH 1/2] dmaengine: intel_mid_dma: fix error status mask

Quoted 9 lines · Vinod Koul
Quoted 8 lines · Adrian Hunter

The error status mask (MASK_ERR) has the same format as the other masks (MASK_TFR, MASK_BLOCK etc) and must be cleared the same way.

---
 drivers/dma/intel_mid_dma.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Quoted 12 lines

drivers/dma/intel_mid_dma.c static irqreturn_t intel_mid_dma_interrupt(int irq, void *data) · line 1060

Quoted 11 lines
drivers/dma/intel_mid_dma.c +2 -1
index 74f70aa..512e2ab 100644
@@ -1056,7 +1056,8 @@ static irqreturn_t intel_mid_dma_interrupt(int irq, void *data)
 	}
 	err_status &= mid->intr_mask;
 	if (err_status) {
-		iowrite32(MASK_INTR_REG(err_status), mid->dma_base + MASK_ERR);
+		iowrite32((err_status << INT_MASK_WE),
+			  mid->dma_base + MASK_ERR);

why not use the macro?

The parameter to the macro MASK_INTR_REG is the channel number. err_status is not a channel number.

This is the same as the way it is done for MASK_TFR a few lines up.

Quoted 5 lines
Quoted 3 lines
drivers/dma/intel_mid_dma.c +0 -0
 		call_tasklet = 1;
 	}
 	if (call_tasklet)
#4 lore raw

PATCH 2/2 dmaengine: intel_mid_dma: move pm_runtime_put

In reply to Adrian Hunter

Move pm_runtime_put() to the end of intel_mid_dma_free_chan_resources() because there is no sense in allowing runtime suspend while the driver is still accessing the device.

---
 drivers/dma/intel_mid_dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/dma/intel_mid_dma.c +1 -1
index 512e2ab..923476d 100644
@@ -832,7 +832,6 @@ static void intel_mid_dma_free_chan_resources(struct dma_chan *chan)
 		/*trying to free ch in use!!!!!*/
 		pr_err("ERR_MDMA: trying to free ch in use\n");
 	}
-	pm_runtime_put(&mid->pdev->dev);
 	spin_lock_bh(&midc->lock);
 	midc->descs_allocated = 0;
 	list_for_each_entry_safe(desc, _desc, &midc->active_list, desc_node) {
@@ -853,6 +852,7 @@ static void intel_mid_dma_free_chan_resources(struct dma_chan *chan)
 	/* Disable CH interrupts */
 	iowrite32(MASK_INTR_REG(midc->ch_id), mid->dma_base + MASK_BLOCK);
 	iowrite32(MASK_INTR_REG(midc->ch_id), mid->dma_base + MASK_ERR);
+	pm_runtime_put(&mid->pdev->dev);
 }
 
 /**
Signature · 1 line
1.7.6.4
Applied
#5 lore raw
In reply to Adrian Hunter
Quoted 5 lines · Adrian Hunter

Hi

Here are 2 minor fixes for intel_mid_dma.

Quoted 7 lines

Adrian Hunter (2):
dmaengine: intel_mid_dma: fix error status mask
dmaengine: intel_mid_dma: move pm_runtime_put

 drivers/dma/intel_mid_dma.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Applied, Thanks

Signature · 1 line
~Vinod