[PATCH 1/2] dmaengine: mv_xor: Minor coding style fix
Subsystems:
dma generic offload engine subsystem , the rest
STALE3748d
4 messages,
3 authors,
2016-06-07 · open the first message on its own page
Remove the space before the "err_free_dma:" label in mv_xor_channel_add().
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Gregory CLEMENT <redacted>
Cc: Thomas Petazzoni <redacted>
Cc: Marcin Wojtas <redacted>
Cc: Vinod Koul <redacted>
---
drivers/dma/mv_xor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 25d1dad..55815c1 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c @@ -1055,7 +1055,7 @@ mv_xor_channel_add(struct mv_xor_device *xordev,
err_free_irq :
free_irq ( mv_chan -> irq , mv_chan );
- err_free_dma :
+ err_free_dma :
dma_free_coherent ( & pdev -> dev , MV_XOR_POOL_SIZE ,
mv_chan -> dma_desc_pool_virt , mv_chan -> dma_desc_pool );
return ERR_PTR ( ret ); --
2.8.3
Upon booting, I occasionally spotted some BUGs triggered by the internal
DMA test routine executed upon driver probing. This was detected by
SLUB_DEBUG ("Freechain corrupt" or "Redzone overwritten"). Tracking
this down located a problem in passing 0 as offset in dma_map_page().
As kmalloc, especially when used with SLUB_DEBUG, may return a non page
aligned address.
This patch fixes this issue by passing the correct offset in
dma_map_page().
Tested on a custom Armada XP board.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Thomas Petazzoni <redacted>
Cc: Gregory CLEMENT <redacted>
Cc: Marcin Wojtas <redacted>
Cc: Vinod Koul <redacted>
---
drivers/dma/mv_xor.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 55815c1..f4c9f98 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c @@ -703,8 +703,9 @@ static int mv_chan_memcpy_self_test(struct mv_xor_chan *mv_chan)
goto free_resources ;
}
- src_dma = dma_map_page ( dma_chan -> device -> dev , virt_to_page ( src ), 0 ,
- PAGE_SIZE , DMA_TO_DEVICE );
+ src_dma = dma_map_page ( dma_chan -> device -> dev , virt_to_page ( src ),
+ ( size_t ) src & ~ PAGE_MASK , PAGE_SIZE ,
+ DMA_TO_DEVICE );
unmap -> addr [ 0 ] = src_dma ;
ret = dma_mapping_error ( dma_chan -> device -> dev , src_dma ); @@ -714,8 +715,9 @@ static int mv_chan_memcpy_self_test(struct mv_xor_chan *mv_chan)
}
unmap -> to_cnt = 1 ;
- dest_dma = dma_map_page ( dma_chan -> device -> dev , virt_to_page ( dest ), 0 ,
- PAGE_SIZE , DMA_FROM_DEVICE );
+ dest_dma = dma_map_page ( dma_chan -> device -> dev , virt_to_page ( dest ),
+ ( size_t ) dest & ~ PAGE_MASK , PAGE_SIZE ,
+ DMA_FROM_DEVICE );
unmap -> addr [ 1 ] = dest_dma ;
ret = dma_mapping_error ( dma_chan -> device -> dev , dest_dma ); --
2.8.3
Hello,
On Wed, 1 Jun 2016 12:43:31 +0200, Stefan Roese wrote: Remove the space before the "err_free_dma:" label in mv_xor_channel_add().
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Gregory CLEMENT <redacted>
Cc: Thomas Petazzoni <redacted>
Cc: Marcin Wojtas <redacted>
Cc: Vinod Koul <redacted>
---
drivers/dma/mv_xor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Thomas Petazzoni <redacted>
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
On Wed, Jun 01, 2016 at 12:43:31PM +0200, Stefan Roese wrote: Remove the space before the "err_free_dma:" label in mv_xor_channel_add().
Applied, both.
Thanks
--
~Vinod