Skip to contentSkip to conversation

ARM: S3C64XX: Stop and flush requests on freeing

PATCH New Maurus Cuelenaere 2 participants 4 messages May 31, 2010 – Aug 15, 2010

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

PATCH 3/3 ARM: S3C64XX: Stop and flush requests on freeing

When a DMA channel is freed, its pending requests should be flushed and the channel should be halted. This patch ensures that happens.

---
 arch/arm/mach-s3c64xx/dma.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/mach-s3c64xx/dma.c +2 -1
index 1fd9d0c..e1f22af 100644
@@ -560,7 +560,8 @@ int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client)
 		       channel, chan->client, client);
 	}
 
-	/* sort out stopping and freeing the channel */
+	s3c64xx_dma_flush(chan);
+	s3c64xx_dma_stop(chan);
 
 
 	chan->client = NULL;
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 3/3 ARM: S3C64XX: Stop and flush requests on freeing

Quoted 13 lines · Maurus Cuelenaere

When a DMA channel is freed, its pending requests should be flushed and the channel should be halted. This patch ensures that happens.

---
?arch/arm/mach-s3c64xx/dma.c | ? ?3 ++-
?1 files changed, 2 insertions(+), 1 deletions(-)

arch/arm/mach-s3c64xx/dma.c +0 -0
index 1fd9d0c..e1f22af 100644

arch/arm/mach-s3c64xx/dma.c int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client) · line 564

Quoted 6 lines
arch/arm/mach-s3c64xx/dma.c +2 -1
@@ -560,7 +560,8 @@ int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client)
 ? ? ? ? ? ? ? ? ? ? ? channel, chan->client, client);
 ? ? ? ?}
 
- ? ? ? /* sort out stopping and freeing the channel */
+ ? ? ? s3c64xx_dma_flush(chan);
+ ? ? ? s3c64xx_dma_stop(chan);

I think, the order should be reverted.

#2 lore raw

PATCH 3/3 ARM: S3C64XX: Stop and flush requests on freeing

Quoted 18 lines · Jassi Brar
Quoted 16 lines · Maurus Cuelenaere

When a DMA channel is freed, its pending requests should be flushed and the channel should be halted. This patch ensures that happens.

---
?arch/arm/mach-s3c64xx/dma.c | ? ?3 ++-
?1 files changed, 2 insertions(+), 1 deletions(-)

arch/arm/mach-s3c64xx/dma.c +0 -0
index 1fd9d0c..e1f22af 100644
@@ -560,7 +560,8 @@ int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client)
 ? ? ? ? ? ? ? ? ? ? ? channel, chan->client, client);
 ? ? ? ?}
 
Quoted 5 lines

arch/arm/mach-s3c64xx/dma.c int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client) · line 564

Quoted 3 lines
arch/arm/mach-s3c64xx/dma.c +2 -1
- ? ? ? /* sort out stopping and freeing the channel */
+ ? ? ? s3c64xx_dma_flush(chan);
+ ? ? ? s3c64xx_dma_stop(chan);

I think, the order should be reverted.

Though it's a matter of S3C DMA API spec.
Shouldn't the client be made to explicitly do S3C2410_DMAOP_FLUSH a pending req before freeing the channel? If so, the patch may not be needed.

#3 lore raw

PATCH 3/3 ARM: S3C64XX: Stop and flush requests on freeing

Op 15-08-10 15:36, Jassi Brar schreef:

Quoted 19 lines · Jassi Brar
Quoted 18 lines
Quoted 16 lines · Maurus Cuelenaere

When a DMA channel is freed, its pending requests should be flushed and the channel should be halted. This patch ensures that happens.

---
 arch/arm/mach-s3c64xx/dma.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/mach-s3c64xx/dma.c +0 -0
index 1fd9d0c..e1f22af 100644
@@ -560,7 +560,8 @@ int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client)
                      channel, chan->client, client);
       }
 
Quoted 4 lines
Quoted 4 lines

arch/arm/mach-s3c64xx/dma.c int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client) · line 564

Quoted 3 lines
arch/arm/mach-s3c64xx/dma.c +2 -1
-       /* sort out stopping and freeing the channel */
+       s3c64xx_dma_flush(chan);
+       s3c64xx_dma_stop(chan);

I think, the order should be reverted.

You're probably right.

Quoted 3 lines

Though it's a matter of S3C DMA API spec.
Shouldn't the client be made to explicitly do S3C2410_DMAOP_FLUSH a pending req before freeing the channel? If so, the patch may not be needed.

I can't find anything about the client needing to flush the request itself.

Documentation/arm/Samsung-S3C24XX/DMA.txt doesn't mention anything regarding it and the comment above s3c2410_dma_free() says "release the given channel back to the system, will stop and flush any outstanding transfers, and ensure the channel is ready for the next claimant."

Signature · 1 line
Maurus Cuelenaere