dw_dmac: mark dwc_dump_lli inline
PATCH 1/3 dw_dmac: mark dwc_dump_lli inline
--- drivers/dma/dw_dmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/dw_dmac.c +1 -1
@@ -413,7 +413,7 @@ static void dwc_scan_descriptors(struct dw_dma *dw, struct dw_dma_chan *dwc)spin_unlock_irqrestore (&dwc->lock, flags); } -static void dwc_dump_lli (struct dw_dma_chan *dwc,struct dw_lli *lli) +static inline void dwc_dump_lli (struct dw_dma_chan *dwc,struct dw_lli *lli) { dev_printk(KERN_CRIT, chan2dev(&dwc->chan), " desc: s0x%llx d0x%llx l0x%llx c0x%x:%x\n",
Signature · 1 line
1.7.10.4
PATCH 2/3 dw_dmac: use 'u32' for LLI structure members, not dma_addr_t
Use 'u32' for the LLI structure members, which are defined by hardware to be 32-bit. dma_addr_t is much more vague about its actual size.
--- drivers/dma/dw_dmac.c | 7 ++----- drivers/dma/dw_dmac_regs.h | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-)
drivers/dma/dw_dmac.c +2 -5
@@ -416,11 +416,8 @@ static void dwc_scan_descriptors(struct dw_dma *dw, struct dw_dma_chan *dwc)static inline void dwc_dump_lli (struct dw_dma_chan *dwc,struct dw_lli *lli) {dev_printk (KERN_CRIT ,chan2dev (&dwc->chan), -" desc: s0x%llx d0x%llx l0x%llx c0x%x:%x\n" , - (unsigned long long )lli->sar, - (unsigned long long )lli->dar, - (unsigned long long )lli->llp, - lli->ctlhi, lli->ctllo); +" desc: s0x%x d0x%x l0x%x c0x%x:%x\n" , + lli->sar, lli->dar, lli->llp, lli->ctlhi, lli->ctllo); }static void dwc_handle_error (struct dw_dma *dw,struct dw_dma_chan *dwc)
drivers/dma/dw_dmac_regs.h +3 -3
@@ -219,9 +219,9 @@ static inline struct dw_dma *to_dw_dma(struct dma_device *ddev)/* LLI == Linked List Item; a.k.a. DMA block descriptor */ struct dw_lli {/* values that are not changed by hardware */ -dma_addr_t sar; -dma_addr_t dar; -dma_addr_t llp;/* chain to next lli */ +u32 sar; +u32 dar; +u32 llp;/* chain to next lli */ u32 ctllo;/* values that may get written back: */ u32 ctlhi;
Signature · 1 line
1.7.10.4
Re: [PATCH 2/3] dw_dmac: use 'u32' for LLI structure members, not dma_addr_t
Quoted 34 lines · Andy Shevchenko
Use 'u32' for the LLI structure members, which are defined by hardware to be 32-bit.
dma_addr_tis much more vague about its actual size.Signed-off-by Andy Shevchenko <[email protected]>--- drivers/dma/dw_dmac.c | 7 ++----- drivers/dma/dw_dmac_regs.h | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-)drivers/dma/dw_dmac.c +2
-5@@ -416,11 +416,8 @@ static void dwc_scan_descriptors(struct dw_dma *dw, struct dw_dma_chan *dwc)static inline void dwc_dump_lli (struct dw_dma_chan *dwc,struct dw_lli *lli) {dev_printk (KERN_CRIT ,chan2dev (&dwc->chan), -" desc: s0x%llx d0x%llx l0x%llx c0x%x:%x\n" , - (unsigned long long )lli->sar, - (unsigned long long )lli->dar, - (unsigned long long )lli->llp, - lli->ctlhi, lli->ctllo); +" desc: s0x%x d0x%x l0x%x c0x%x:%x\n" , + lli->sar, lli->dar, lli->llp, lli->ctlhi, lli->ctllo); }static void dwc_handle_error (struct dw_dma *dw,struct dw_dma_chan *dwc)drivers/dma/dw_dmac_regs.h +0
-0@@ -219,9 +219,9 @@ static inline struct dw_dma *to_dw_dma(struct dma_device *ddev)/* LLI == Linked List Item; a.k.a. DMA block descriptor */ struct dw_lli {
drivers/dma/dw_dmac_regs.h static inline struct dw_dma *to_dw_dma(struct dma_device *ddev) · line 227
Quoted 10 lines
drivers/dma/dw_dmac_regs.h +3
-3/* values that are not changed by hardware */ -dma_addr_t sar; -dma_addr_t dar; -dma_addr_t llp;/* chain to next lli */ +u32 sar; +u32 dar; +u32 llp;/* chain to next lli */ u32 ctllo;/* values that may get written back: */ u32 ctlhi;
PATCH 3/3 dw_dmac: set default alignment
In reply to Andy ShevchenkoThe default values are filled to support at least mem-to-mem tests provided by dmatest module. It makes sense to choose the 4 bytes (2 least significant bits) alignment by the default.
--- drivers/dma/dw_dmac.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/dma/dw_dmac.c +6 -0
@@ -1485,6 +1485,12 @@ static int __devinit dw_probe(struct platform_device *pdev) dw->dma.device_tx_status = dwc_tx_status; dw->dma.device_issue_pending = dwc_issue_pending; +/* Set default alignment */ + dw->dma.copy_align =2 ; + dw->dma.xor_align =2 ; + dw->dma.pq_align =2 ; + dw->dma.fill_align =2 ; +dma_writel (dw,CFG ,DW_CFG_DMA_EN ); printk(KERN_INFO "%s: DesignWare DMA Controller, %d channels\n",
Signature · 1 line
1.7.10.4
Re: [PATCH 3/3] dw_dmac: set default alignment
It would be nice to keep spear-devel in cc, as this is the second platform that uses this driver.
Quoted 14 lines · Andy Shevchenko
The default values are filled to support at least mem-to-mem tests provided by dmatest module. It makes sense to choose the 4 bytes (2 least significant bits) alignment by the default.
Signed-off-by Andy Shevchenko <[email protected]>--- drivers/dma/dw_dmac.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/dma/dw_dmac.c +0
-0
drivers/dma/dw_dmac.c static int __devinit dw_probe(struct platform_device *pdev) · line 1492
Quoted 8 lines
drivers/dma/dw_dmac.c +5
-0@@ -1485,6 +1485,12 @@ static int __devinit dw_probe(struct platform_device *pdev) dw->dma.device_tx_status = dwc_tx_status; dw->dma.device_issue_pending = dwc_issue_pending; +/* Set default alignment */ + dw->dma.copy_align =2 ; + dw->dma.xor_align =2 ; + dw->dma.pq_align =2 ; + dw->dma.fill_align =2 ;
To understand it more, what does this mean? We will not support transfers with unaligned
addresses/length to word size?
--
viresh
Re: [PATCH 3/3] dw_dmac: set default alignment
Quoted 2 lines · viresh kumar
It would be nice to keep spear-devel in cc, as this is the second platform that uses this driver.
I used to get the list of recipients via get_maintainer script. Will try to not forget about that address in the future.
Quoted 12 lines
Quoted 12 lines
The default values are filled to support at least mem-to-mem tests provided by dmatest module. It makes sense to choose the 4 bytes (2 least significant bits) alignment by the default.
drivers/dma/dw_dmac.c +0
-0@@ -1485,6 +1485,12 @@ static int __devinit dw_probe(struct platform_device *pdev) dw->dma.device_tx_status = dwc_tx_status; dw->dma.device_issue_pending = dwc_issue_pending;
Quoted 9 lines
drivers/dma/dw_dmac.c static int __devinit dw_probe(struct platform_device *pdev) · line 1492
Quoted 5 lines
drivers/dma/dw_dmac.c +5
-0+/* Set default alignment */ + dw->dma.copy_align =2 ; + dw->dma.xor_align =2 ; + dw->dma.pq_align =2 ; + dw->dma.fill_align =2 ;To understand it more, what does this mean? We will not support transfers with unaligned
addresses/length to word size?
The dmatest module uses those constants to get source, destination addresses and length of the test data aligned. On the other hand we can't use unaligned address in LLI because of the hardware restriction (2 bits are used for choosing AHB master).
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH 3/3] dw_dmac: set default alignment
Quoted 7 lines · Andy Shevchenko
Quoted 3 lines
Quoted 3 lines
To understand it more, what does this mean? We will not support transfers with unaligned
addresses/length to word size?The dmatest module uses those constants to get source, destination addresses and length of the test data aligned. On the other hand we can't use unaligned address in LLI because of the hardware restriction (2 bits are used for choosing AHB master).
To be clear, we can't use unaligned address of an LLI struct, but src/dest address inside LLI can be unaligned.
I wanted to ask, will normal memcpy for anybody will work with unaligned addresses with this patch? I believe they will.
--
Viresh
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Re: [PATCH 3/3] dw_dmac: set default alignment
Quoted 2 lines · viresh kumar
I wanted to ask, will normal memcpy for anybody will work with unaligned addresses with this patch? I believe they will.
Hmm... I just rechecked and it seems it works without this patch. I didn't remember why this patch still in my pool.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH 3/3] dw_dmac: set default alignment
Quoted 5 lines · Andy Shevchenko
Quoted 2 lines · viresh kumar
I wanted to ask, will normal memcpy for anybody will work with unaligned addresses with this patch? I believe they will.
Hmm... I just rechecked and it seems it works without this patch. I didn't remember why this patch still in my pool.
Sorry, got confused now. What works without this patch? And what doesn't work without it?
--
Viresh
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Re: [PATCH 3/3] dw_dmac: set default alignment
Quoted 1 line · viresh kumar
Sorry, got confused now. What works without this patch? And what doesn't work without it?
It seems this patch is redundant.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 10 lines · Andy Shevchenko
Signed-off-by Andy Shevchenko <[email protected]>--- drivers/dma/dw_dmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/dma/dw_dmac.c +0
-0
drivers/dma/dw_dmac.c static void dwc_scan_descriptors(struct dw_dma *dw, struct dw_dma_chan *dwc) · line 419
Quoted 8 lines
drivers/dma/dw_dmac.c +1
-1@@ -413,7 +413,7 @@ static void dwc_scan_descriptors(struct dw_dma *dw, struct dw_dma_chan *dwc)spin_unlock_irqrestore (&dwc->lock, flags); } -static void dwc_dump_lli (struct dw_dma_chan *dwc,struct dw_lli *lli) +static inline void dwc_dump_lli (struct dw_dma_chan *dwc,struct dw_lli *lli) { dev_printk(KERN_CRIT, chan2dev(&dwc->chan), " desc: s0x%llx d0x%llx l0x%llx c0x%x:%x\n",
On Fri, 2012-07-13 at 11:09 +0300, Andy Shevchenko wrote:
Applied 1 & 2 only, Thanks
Signature · 1 line
~Vinod