Skip to contentSkip to conversation

minor omap dma fixes

PATCH New Rajendra Nayak 2 participants 5 messages Jun 13, 2013 – Jun 18, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover minor omap dma fixes

Hi,

Here are some minor omap dma fixes.

v2:
Patch 3/3 was wrongly fixed by just changing the kfree() order. As Russell suggested the kfree() was that for platform_data and wrong to begin with. So Patch 3/3 now removes all instances of kfree() of platform_data.

R Sricharan (2):
ARM: OMAP: dma: Remove the wrong dev_id check
ARM: OMAP: dma: Fix the dma_chan_link_map init order

Rajendra Nayak (1):
ARM: OMAP: dma: Remove the erroneous freeing of platform data

 arch/arm/plat-omap/dma.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/3 ARM: OMAP: dma: Remove the wrong dev_id check

From: R Sricharan <[email protected]>

Once a free channel is found, the check for dev_id == 0 does not make any sense. Get rid of it.

---
 arch/arm/plat-omap/dma.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-omap/dma.c +2 -2
index e06c34b..2f99331 100644
@@ -701,8 +701,8 @@ int omap_request_dma(int dev_id, const char *dev_name,
 	for (ch = 0; ch < dma_chan_count; ch++) {
 		if (free_ch == -1 && dma_chan[ch].dev_id == -1) {
 			free_ch = ch;
-			if (dev_id == 0)
-				break;
+			/* Exit after first free channel found */
+			break;
 		}
 	}
 	if (free_ch == -1) {
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v2 2/3 ARM: OMAP: dma: Fix the dma_chan_link_map init order

In reply to Rajendra Nayak

From: R Sricharan <[email protected]>

Init dma_chan_link_map[lch] *after* its memset to 0.

---
 arch/arm/plat-omap/dma.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/plat-omap/dma.c +2 -1
index 2f99331..8a71f75 100644
@@ -894,11 +894,12 @@ void omap_start_dma(int lch)
 		int next_lch, cur_lch;
 		char dma_chan_link_map[MAX_LOGICAL_DMA_CH_COUNT];
 
-		dma_chan_link_map[lch] = 1;
 		/* Set the link register of the first channel */
 		enable_lnk(lch);
 
 		memset(dma_chan_link_map, 0, sizeof(dma_chan_link_map));
+		dma_chan_link_map[lch] = 1;
+
 		cur_lch = dma_chan[lch].next_lch;
 		do {
 			next_lch = dma_chan[cur_lch].next_lch;
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v2 3/3 ARM: OMAP: dma: Remove the erroneous freeing of platform data

In reply to Rajendra Nayak

Given p = pdev->dev.platform_data; and

      d = p->dma_attr;

the freeing of either one of these by the driver
seems just plain wrong.

Get rid of them in the .probe failure path as well as the .remove.

---
 arch/arm/plat-omap/dma.c |    4 ----
 1 file changed, 4 deletions(-)
arch/arm/plat-omap/dma.c +0 -4
index 8a71f75..4d463ca 100644
@@ -2111,8 +2111,6 @@ exit_dma_irq_fail:
 	}
 
 exit_dma_lch_fail:
-	kfree(p);
-	kfree(d);
 	kfree(dma_chan);
 	return ret;
 }
@@ -2133,8 +2131,6 @@ static int omap_system_dma_remove(struct platform_device *pdev)
 			free_irq(dma_irq, (void *)(irq_rel + 1));
 		}
 	}
-	kfree(p);
-	kfree(d);
 	kfree(dma_chan);
 	return 0;
 }
Signature · 1 line
1.7.9.5
#4 lore raw

v2 cover minor omap dma fixes

In reply to Rajendra Nayak
Quoted 10 lines · Rajendra Nayak

Hi,

Here are some minor omap dma fixes.

v2:
Patch 3/3 was wrongly fixed by just changing the kfree() order. As Russell suggested the kfree() was that for platform_data and wrong to begin with. So Patch 3/3 now removes all instances of kfree() of platform_data.

Thanks applying into omap-for-v3.11/dma.

Regards,

Tony

Quoted 13 lines

R Sricharan (2):
ARM: OMAP: dma: Remove the wrong dev_id check
ARM: OMAP: dma: Fix the dma_chan_link_map init order

Rajendra Nayak (1):
ARM: OMAP: dma: Remove the erroneous freeing of platform data

 arch/arm/plat-omap/dma.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
Signature · 1 line
1.7.9.5