From: Andrea Merello <hidden> Date: 2018-09-07 06:25:23
This patch removes a bit of duplicated code by introducing a new
function that implements calculations for DMA copy size.
Suggested-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Andrea Merello <redacted>
---
Changes in v4:
- introduce this patch in the patch series
Changes in v5:
None
---
drivers/dma/xilinx/xilinx_dma.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
@@ -952,6 +952,19 @@ static int xilinx_dma_alloc_chan_resources(struct dma_chan *dchan)return0;}+/**+*xilinx_dma_calc_copysize-Calculatetheamountofdatatocopy+*@size:Totaldatathatneedstobecopied+*@done:Amountofdatathathasbeenalreadycopied+*+*Return:Amountofdatathathastobecopied+*/+staticintxilinx_dma_calc_copysize(intsize,intdone)+{+returnmin_t(size_t,size-done,+XILINX_DMA_MAX_TRANS_LEN);+}+/***xilinx_dma_tx_status-GetDMAtransactionstatus*@dchan:DMAchannel
@@ -1791,8 +1804,8 @@ static struct dma_async_tx_descriptor *xilinx_dma_prep_slave_sg(*Calculatethemaximumnumberofbytestotransfer,*makingsureitislessthanthehwlimit*/-copy=min_t(size_t,sg_dma_len(sg)-sg_used,-XILINX_DMA_MAX_TRANS_LEN);+copy=xilinx_dma_calc_copysize(sg_dma_len(sg),+sg_used);hw=&segment->hw;/* Fill in the descriptor */
From: Andrea Merello <hidden> Date: 2018-09-07 06:25:25
Whenever a single or cyclic transaction is prepared, the driver
could eventually split it over several SG descriptors in order
to deal with the HW maximum transfer length.
This could end up in DMA operations starting from a misaligned
address. This seems fatal for the HW if DRE (Data Realignment Engine)
is not enabled.
This patch eventually adjusts the transfer size in order to make sure
all operations start from an aligned address.
Cc: Radhey Shyam Pandey <redacted>
Signed-off-by: Andrea Merello <redacted>
Reviewed-by: Radhey Shyam Pandey <redacted>
---
Changes in v2:
- don't introduce copy_mask field, rather rely on already-esistent
copy_align field. Suggested by Radhey Shyam Pandey
- reword title
Changes in v3:
- fix bug introduced in v2: wrong copy size when DRE is enabled
- use implementation suggested by Radhey Shyam Pandey
Changes in v4:
- rework on the top of 1/6
Changes in v5:
- fix typo in commit title
- add hint about "DRE" meaning in commit message
---
drivers/dma/xilinx/xilinx_dma.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
Whenever a single or cyclic transaction is prepared, the driver
could eventually split it over several SG descriptors in order
to deal with the HW maximum transfer length.
This could end up in DMA operations starting from a misaligned
address. This seems fatal for the HW if DRE (Data Realignment Engine)
is not enabled.
This patch eventually adjusts the transfer size in order to make sure
all operations start from an aligned address.
Cc: Radhey Shyam Pandey <redacted>
Signed-off-by: Andrea Merello <redacted>
Reviewed-by: Radhey Shyam Pandey <redacted>
---
Changes in v2:
- don't introduce copy_mask field, rather rely on already-esistent
copy_align field. Suggested by Radhey Shyam Pandey
- reword title
Changes in v3:
- fix bug introduced in v2: wrong copy size when DRE is enabled
- use implementation suggested by Radhey Shyam Pandey
Changes in v4:
- rework on the top of 1/6
Changes in v5:
- fix typo in commit title
- add hint about "DRE" meaning in commit message
---
drivers/dma/xilinx/xilinx_dma.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
so we can do this way in patch 1:
size t copy;
copy = min_t(size_t, size - done,
XILINX_DMA_MAX_TRANS_LEN);
return copy;
and then add these here, feels like we are redoing change introduced in
patch 1..
quoted hunk
+ if ((copy + done < size) &&
+ chan->xdev->common.copy_align) {
+ /*
+ * If this is not the last descriptor, make sure
+ * the next one will be properly aligned
+ */
+ copy = rounddown(copy,
+ (1 << chan->xdev->common.copy_align));
+ }
+ return copy;
}
/**
@@ -1804,7 +1817,7 @@ static struct dma_async_tx_descriptor *xilinx_dma_prep_slave_sg( * Calculate the maximum number of bytes to transfer, * making sure it is less than the hw limit */- copy = xilinx_dma_calc_copysize(sg_dma_len(sg),+ copy = xilinx_dma_calc_copysize(chan, sg_dma_len(sg),
why not keep chan in patch 1 and add only handling in patch 2, seems
less churn to me..
--
~Vinod
From: Andrea Merello <hidden> Date: 2018-09-28 07:11:38
On Tue, Sep 18, 2018 at 6:21 PM Vinod [off-list ref] wrote:
On 07-09-18, 08:24, Andrea Merello wrote:
quoted
Whenever a single or cyclic transaction is prepared, the driver
could eventually split it over several SG descriptors in order
to deal with the HW maximum transfer length.
This could end up in DMA operations starting from a misaligned
address. This seems fatal for the HW if DRE (Data Realignment Engine)
is not enabled.
This patch eventually adjusts the transfer size in order to make sure
all operations start from an aligned address.
Cc: Radhey Shyam Pandey <redacted>
Signed-off-by: Andrea Merello <redacted>
Reviewed-by: Radhey Shyam Pandey <redacted>
---
Changes in v2:
- don't introduce copy_mask field, rather rely on already-esistent
copy_align field. Suggested by Radhey Shyam Pandey
- reword title
Changes in v3:
- fix bug introduced in v2: wrong copy size when DRE is enabled
- use implementation suggested by Radhey Shyam Pandey
Changes in v4:
- rework on the top of 1/6
Changes in v5:
- fix typo in commit title
- add hint about "DRE" meaning in commit message
---
drivers/dma/xilinx/xilinx_dma.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
@@ -954,15 +954,28 @@ static int xilinx_dma_alloc_chan_resources(struct dma_chan *dchan)/***xilinx_dma_calc_copysize-Calculatetheamountofdatatocopy+*@chan:DriverspecificDMAchannel*@size:Totaldatathatneedstobecopied*@done:Amountofdatathathasbeenalreadycopied**Return:Amountofdatathathastobecopied*/-staticintxilinx_dma_calc_copysize(intsize,intdone)+staticintxilinx_dma_calc_copysize(structxilinx_dma_chan*chan,+intsize,intdone)
align to preceeding line opening brace please
After applying, I'm seeing it already aligned as you requested; 4 tabs
+ 4 spaces so the 2nd line starts right under the "s" near the opened
brace..
Patch sent using git, so it should pass through without being ruined;
don't know why you see it misaligned :(
so we can do this way in patch 1:
size t copy;
copy = min_t(size_t, size - done,
XILINX_DMA_MAX_TRANS_LEN);
return copy;
and then add these here, feels like we are redoing change introduced in
patch 1..
OK, this sounds good :)
quoted
+ if ((copy + done < size) &&
+ chan->xdev->common.copy_align) {
+ /*
+ * If this is not the last descriptor, make sure
+ * the next one will be properly aligned
+ */
+ copy = rounddown(copy,
+ (1 << chan->xdev->common.copy_align));
+ }
+ return copy;
}
/**
@@ -1804,7 +1817,7 @@ static struct dma_async_tx_descriptor *xilinx_dma_prep_slave_sg( * Calculate the maximum number of bytes to transfer, * making sure it is less than the hw limit */- copy = xilinx_dma_calc_copysize(sg_dma_len(sg),+ copy = xilinx_dma_calc_copysize(chan, sg_dma_len(sg),
why not keep chan in patch 1 and add only handling in patch 2, seems
less churn to me..
Indeed this was something I was unsure about.. I ended up in feeling
better not to add introduce a function that takes an unused (yet)
argument, but I can change this of course :)
On Tue, Sep 18, 2018 at 6:21 PM Vinod [off-list ref] wrote:
quoted
quoted
@@ -1804,7 +1817,7 @@ static struct dma_async_tx_descriptor *xilinx_dma_prep_slave_sg( * Calculate the maximum number of bytes to transfer, * making sure it is less than the hw limit */- copy = xilinx_dma_calc_copysize(sg_dma_len(sg),+ copy = xilinx_dma_calc_copysize(chan, sg_dma_len(sg),
why not keep chan in patch 1 and add only handling in patch 2, seems
less churn to me..
Indeed this was something I was unsure about.. I ended up in feeling
better not to add introduce a function that takes an unused (yet)
argument, but I can change this of course :)
IMO It is fine to add a user in subsequent patch in a series. Not fine to
add something and not use in "that" series :)
--
~Vinod
From: Andrea Merello <hidden> Date: 2018-09-07 06:25:29
The AXIDMA and CDMA HW can be either direct-access or scatter-gather
version. These are SW incompatible.
The driver can handle both versions: a DT property was used to
tell the driver whether to assume the HW is in scatter-gather mode.
This patch makes the driver to autodetect this information. The DT
property is not required anymore.
No changes for VDMA.
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree at vger.kernel.org
Cc: Radhey Shyam Pandey <redacted>
Signed-off-by: Andrea Merello <redacted>
Reviewed-by: Radhey Shyam Pandey <redacted>
---
Changes in v2:
- autodetect only in !VDMA case
Changes in v3:
- cc DT maintainers/ML
Changes in v4:
- fix typos in commit message
Changes in v5:
None
---
drivers/dma/xilinx/xilinx_dma.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
@@ -2400,7 +2399,6 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,chan->dev=xdev->dev;chan->xdev=xdev;-chan->has_sg=xdev->has_sg;chan->desc_pendingcount=0x0;chan->ext_addr=xdev->ext_addr;/* This variable ensures that descriptors are not
@@ -2493,6 +2491,15 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,chan->stop_transfer=xilinx_dma_stop_transfer;}+/* check if SG is enabled (only for AXIDMA and CDMA) */+if(xdev->dma_config->dmatype!=XDMA_TYPE_VDMA){+if(dma_ctrl_read(chan,XILINX_DMA_REG_DMASR)&+XILINX_DMA_DMASR_SG_MASK)+chan->has_sg=true;+dev_dbg(chan->dev,"ch %d: SG %s\n",chan->id,+chan->has_sg?"enabled":"disabled");+}+/* Initialize the tasklet */tasklet_init(&chan->tasklet,xilinx_dma_do_tasklet,(unsignedlong)chan);
@@ -2631,7 +2638,6 @@ static int xilinx_dma_probe(struct platform_device *pdev)returnPTR_ERR(xdev->regs);/* Retrieve the DMA engine properties from the device tree */-xdev->has_sg=of_property_read_bool(node,"xlnx,include-sg");xdev->max_buffer_len=GENMASK(XILINX_DMA_MAX_TRANS_LEN_MAX-1,0);if(xdev->dma_config->dmatype==XDMA_TYPE_AXIDMA){
From: Andrea Merello <hidden> Date: 2018-09-07 06:25:33
xilinx_vdma_start_transfer() is used only for VDMA IP, still it contains
conditional code on has_sg variable. has_sg is set only whenever the HW
does support SG mode, that is never true for VDMA IP.
This patch drops the never-taken branches.
Signed-off-by: Andrea Merello <redacted>
---
Changes in V4: introduced this patch in series
Changes in v5:
None
---
drivers/dma/xilinx/xilinx_dma.c | 84 +++++++++++++--------------------
1 file changed, 32 insertions(+), 52 deletions(-)
@@ -1093,6 +1093,8 @@ static void xilinx_vdma_start_transfer(struct xilinx_dma_chan *chan)structxilinx_dma_tx_descriptor*desc,*tail_desc;u32reg,j;structxilinx_vdma_tx_segment*tail_segment;+structxilinx_vdma_tx_segment*segment,*last=NULL;+inti=0;/* This function was invoked with lock held */if(chan->err)
@@ -1112,14 +1114,6 @@ static void xilinx_vdma_start_transfer(struct xilinx_dma_chan *chan)tail_segment=list_last_entry(&tail_desc->segments,structxilinx_vdma_tx_segment,node);-/*-*Ifhardwareisidle,thenalldescriptorsontherunninglistsare-*done,startnewtransfers-*/-if(chan->has_sg)-dma_ctrl_write(chan,XILINX_DMA_REG_CURDESC,-desc->async_tx.phys);-/* Configure the hardware using info in the config structure */reg=dma_ctrl_read(chan,XILINX_DMA_REG_DMACR);
@@ -1128,15 +1122,11 @@ static void xilinx_vdma_start_transfer(struct xilinx_dma_chan *chan)elsereg&=~XILINX_DMA_DMACR_FRAMECNT_EN;-/*-*WithSG,startwithcircularmode,sothatBDscanbefetched.-*Indirectregistermode,ifnotparking,enablecircularmode-*/-if(chan->has_sg||!config->park)-reg|=XILINX_DMA_DMACR_CIRC_EN;-+/* If not parking, enable circular mode */if(config->park)reg&=~XILINX_DMA_DMACR_CIRC_EN;+else+reg|=XILINX_DMA_DMACR_CIRC_EN;dma_ctrl_write(chan,XILINX_DMA_REG_DMACR,reg);
@@ -1158,48 +1148,38 @@ static void xilinx_vdma_start_transfer(struct xilinx_dma_chan *chan)return;/* Start the transfer */-if(chan->has_sg){-dma_ctrl_write(chan,XILINX_DMA_REG_TAILDESC,-tail_segment->phys);-list_splice_tail_init(&chan->pending_list,&chan->active_list);-chan->desc_pendingcount=0;-}else{-structxilinx_vdma_tx_segment*segment,*last=NULL;-inti=0;--if(chan->desc_submitcount<chan->num_frms)-i=chan->desc_submitcount;--list_for_each_entry(segment,&desc->segments,node){-if(chan->ext_addr)-vdma_desc_write_64(chan,-XILINX_VDMA_REG_START_ADDRESS_64(i++),-segment->hw.buf_addr,-segment->hw.buf_addr_msb);-else-vdma_desc_write(chan,+if(chan->desc_submitcount<chan->num_frms)+i=chan->desc_submitcount;++list_for_each_entry(segment,&desc->segments,node){+if(chan->ext_addr)+vdma_desc_write_64(chan,+XILINX_VDMA_REG_START_ADDRESS_64(i++),+segment->hw.buf_addr,+segment->hw.buf_addr_msb);+else+vdma_desc_write(chan,XILINX_VDMA_REG_START_ADDRESS(i++),segment->hw.buf_addr);-last=segment;-}--if(!last)-return;+last=segment;+}-/* HW expects these parameters to be same for one transaction */-vdma_desc_write(chan,XILINX_DMA_REG_HSIZE,last->hw.hsize);-vdma_desc_write(chan,XILINX_DMA_REG_FRMDLY_STRIDE,-last->hw.stride);-vdma_desc_write(chan,XILINX_DMA_REG_VSIZE,last->hw.vsize);+if(!last)+return;-chan->desc_submitcount++;-chan->desc_pendingcount--;-list_del(&desc->node);-list_add_tail(&desc->node,&chan->active_list);-if(chan->desc_submitcount==chan->num_frms)-chan->desc_submitcount=0;-}+/* HW expects these parameters to be same for one transaction */+vdma_desc_write(chan,XILINX_DMA_REG_HSIZE,last->hw.hsize);+vdma_desc_write(chan,XILINX_DMA_REG_FRMDLY_STRIDE,+last->hw.stride);+vdma_desc_write(chan,XILINX_DMA_REG_VSIZE,last->hw.vsize);++chan->desc_submitcount++;+chan->desc_pendingcount--;+list_del(&desc->node);+list_add_tail(&desc->node,&chan->active_list);+if(chan->desc_submitcount==chan->num_frms)+chan->desc_submitcount=0;chan->idle=false;}
From: Andrea Merello <hidden> Date: 2018-09-07 06:25:33
The width of the "length register" cannot be autodetected, and it is now
specified with a DT property. Add documentation for it.
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree at vger.kernel.org
Cc: Radhey Shyam Pandey <redacted>
Signed-off-by: Andrea Merello <redacted>
Reviewed-by: Radhey Shyam Pandey <redacted>
---
Changes in v2:
- change property name
- property is now optional
- cc DT maintainer
Changes in v3:
- reword
- cc DT maintainerS and ML
Changes in v4:
- specify the unit, the valid range and the default value
Changes in v5:
- commit message trivial fix
- fix spaces before tab
---
Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt | 4 ++++
1 file changed, 4 insertions(+)
@@ -41,6 +41,10 @@ Optional properties: - xlnx,include-sg: Tells configured for Scatter-mode in the hardware. Optional properties for AXI DMA:+- xlnx,sg-length-width: Should be set to the width in bits of the length+ register as configured in h/w. Takes values {8...26}. If the property+ is missing or invalid then the default value 23 is used. This is the+ maximum value that is supported by all IP versions. - xlnx,mcdma: Tells whether configured for multi-channel mode in the hardware. Optional properties for VDMA: - xlnx,flush-fsync: Tells which channel to Flush on Frame sync.
From: Rob Herring <robh@kernel.org> Date: 2018-09-10 18:19:17
On Fri, 7 Sep 2018 08:24:58 +0200, Andrea Merello wrote:
The width of the "length register" cannot be autodetected, and it is now
specified with a DT property. Add documentation for it.
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree at vger.kernel.org
Cc: Radhey Shyam Pandey <redacted>
Signed-off-by: Andrea Merello <redacted>
Reviewed-by: Radhey Shyam Pandey <redacted>
---
Changes in v2:
- change property name
- property is now optional
- cc DT maintainer
Changes in v3:
- reword
- cc DT maintainerS and ML
Changes in v4:
- specify the unit, the valid range and the default value
Changes in v5:
- commit message trivial fix
- fix spaces before tab
---
Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt | 4 ++++
1 file changed, 4 insertions(+)
From: Andrea Merello <hidden> Date: 2018-09-07 06:25:47
From: Radhey Shyam Pandey <redacted>
AXI-DMA IP supports configurable (c_sg_length_width) buffer length
register width, hence read buffer length (xlnx,sg-length-width) DT
property and ensure that driver doesn't program buffer length
exceeding the supported limit. For VDMA and CDMA there is no change.
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree at vger.kernel.org
Signed-off-by: Radhey Shyam Pandey <redacted>
Signed-off-by: Michal Simek <redacted>
Signed-off-by: Andrea Merello <redacted> [rebase, reword]
---
Changes in v2:
- drop original patch and replace with the one in Xilinx tree
Changes in v3:
- cc DT maintainers/ML
Changes in v4:
- upper bound for the property should be 26, not 23
- add warn for width > 23 as per xilinx original patch
- rework due to changes introduced in 1/6
Changes in v5:
None
---
drivers/dma/xilinx/xilinx_dma.c | 36 +++++++++++++++++++++++++--------
1 file changed, 28 insertions(+), 8 deletions(-)
@@ -2596,7 +2600,7 @@ static int xilinx_dma_probe(struct platform_device *pdev)structxilinx_dma_device*xdev;structdevice_node*child,*np=pdev->dev.of_node;structresource*io;-u32num_frames,addr_width;+u32num_frames,addr_width,len_width;inti,err;/* Allocate and initialize the DMA engine structure */
@@ -2628,8 +2632,24 @@ static int xilinx_dma_probe(struct platform_device *pdev)/* Retrieve the DMA engine properties from the device tree */xdev->has_sg=of_property_read_bool(node,"xlnx,include-sg");-if(xdev->dma_config->dmatype==XDMA_TYPE_AXIDMA)+xdev->max_buffer_len=GENMASK(XILINX_DMA_MAX_TRANS_LEN_MAX-1,0);++if(xdev->dma_config->dmatype==XDMA_TYPE_AXIDMA){xdev->mcdma=of_property_read_bool(node,"xlnx,mcdma");+if(!of_property_read_u32(node,"xlnx,sg-length-width",+&len_width)){+if(len_width<XILINX_DMA_MAX_TRANS_LEN_MIN||+len_width>XILINX_DMA_V2_MAX_TRANS_LEN_MAX){+dev_warn(xdev->dev,+"invalid xlnx,sg-length-width property value. Using default width\n");+}else{+if(len_width>XILINX_DMA_MAX_TRANS_LEN_MAX)+dev_warn(xdev->dev,"Please ensure that IP supports buffer length > 23 bits\n");+xdev->max_buffer_len=+GENMASK(len_width-1,0);+}+}+}if(xdev->dma_config->dmatype==XDMA_TYPE_VDMA){err=of_property_read_u32(node,"xlnx,num-fstores",
From: Radhey Shyam Pandey <redacted>
AXI-DMA IP supports configurable (c_sg_length_width) buffer length
register width, hence read buffer length (xlnx,sg-length-width) DT
property and ensure that driver doesn't program buffer length
exceeding the supported limit. For VDMA and CDMA there is no change.
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree at vger.kernel.org
Signed-off-by: Radhey Shyam Pandey <redacted>
Signed-off-by: Michal Simek <redacted>
Signed-off-by: Andrea Merello <redacted> [rebase, reword]
---
Changes in v2:
- drop original patch and replace with the one in Xilinx tree
Changes in v3:
- cc DT maintainers/ML
Changes in v4:
- upper bound for the property should be 26, not 23
- add warn for width > 23 as per xilinx original patch
- rework due to changes introduced in 1/6
Changes in v5:
None
---
drivers/dma/xilinx/xilinx_dma.c | 36 +++++++++++++++++++++++++--------
1 file changed, 28 insertions(+), 8 deletions(-)
From: Andrea Merello <hidden> Date: 2018-09-28 06:53:28
On Tue, Sep 18, 2018 at 6:25 PM Vinod [off-list ref] wrote:
On 07-09-18, 08:24, Andrea Merello wrote:
quoted
From: Radhey Shyam Pandey <redacted>
AXI-DMA IP supports configurable (c_sg_length_width) buffer length
register width, hence read buffer length (xlnx,sg-length-width) DT
property and ensure that driver doesn't program buffer length
exceeding the supported limit. For VDMA and CDMA there is no change.
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree at vger.kernel.org
Signed-off-by: Radhey Shyam Pandey <redacted>
Signed-off-by: Michal Simek <redacted>
Signed-off-by: Andrea Merello <redacted> [rebase, reword]
---
Changes in v2:
- drop original patch and replace with the one in Xilinx tree
Changes in v3:
- cc DT maintainers/ML
Changes in v4:
- upper bound for the property should be 26, not 23
- add warn for width > 23 as per xilinx original patch
- rework due to changes introduced in 1/6
Changes in v5:
None
---
drivers/dma/xilinx/xilinx_dma.c | 36 +++++++++++++++++++++++++--------
1 file changed, 28 insertions(+), 8 deletions(-)
On Tue, Sep 18, 2018 at 6:25 PM Vinod [off-list ref] wrote:
quoted
quoted
@@ -964,7 +968,7 @@ static int xilinx_dma_calc_copysize(struct xilinx_dma_chan *chan, int size, int done) { size_t copy = min_t(size_t, size - done,- XILINX_DMA_MAX_TRANS_LEN);+ chan->xdev->max_buffer_len);
hmm why not add max_buffer_len in patch 1 again, and then use default
len as XILINX_DMA_MAX_TRANS_LEN and add multiple lengths here :)
Sorry, I'm not getting your point. Could you please elaborate the "add
multiple lengths here" thing ?
IIRC (sorry been travelling and vacation), add
chan->xdev->max_buffer_len in patch 1 and initialize it to
XILINX_DMA_MAX_TRANS_LEN. Then in subsequent patches update the length.
--
~Vinod
From: Andrea Merello <hidden> Date: 2018-10-08 06:46:57
On Tue, Oct 2, 2018 at 4:56 PM Vinod [off-list ref] wrote:
On 28-09-18, 08:53, Andrea Merello wrote:
quoted
On Tue, Sep 18, 2018 at 6:25 PM Vinod [off-list ref] wrote:
quoted
quoted
quoted
@@ -964,7 +968,7 @@ static int xilinx_dma_calc_copysize(struct xilinx_dma_chan *chan, int size, int done) { size_t copy = min_t(size_t, size - done,- XILINX_DMA_MAX_TRANS_LEN);+ chan->xdev->max_buffer_len);
hmm why not add max_buffer_len in patch 1 again, and then use default
len as XILINX_DMA_MAX_TRANS_LEN and add multiple lengths here :)
Sorry, I'm not getting your point. Could you please elaborate the "add
multiple lengths here" thing ?
IIRC (sorry been travelling and vacation), add
chan->xdev->max_buffer_len in patch 1 and initialize it to
XILINX_DMA_MAX_TRANS_LEN. Then in subsequent patches update the length.
Ah ok. IMO introducing max_buffer_len seems more related to what 4/7
does (actually getting the max transfer len from DT, thus it is not
constant anymore) rather than to what 1/7 does (commonizing the
calculation of transfer len as it is).. This is why I've introduced it
in 4/7..
.. But if you prefer this way, I'll change this :) .. Maybe we can
change 1/7 commit message so that this change looks less off-topic..
But I have not found a very good title yet.. Something like "Prepare
for DMA copy size calculation rework" ?
From: Andrea Merello <hidden> Date: 2018-09-07 06:25:52
This property is not needed anymore, because the driver now autodetects it.
Delete references in documentation.
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree at vger.kernel.org
Cc: Radhey Shyam Pandey <redacted>
Signed-off-by: Andrea Merello <redacted>
Reviewed-by: Radhey Shyam Pandey <redacted>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Changes in v2:
- cc DT maintainer
Changes in v3:
- cc DT maintainerS/ML
Changes in v4:
None
Changes in v5:
None
---
Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt | 3 ---
1 file changed, 3 deletions(-)
@@ -37,9 +37,6 @@ Required properties: Required properties for VDMA: - xlnx,num-fstores: Should be the number of framebuffers as configured in h/w.-Optional properties:-- xlnx,include-sg: Tells configured for Scatter-mode in- the hardware. Optional properties for AXI DMA: - xlnx,sg-length-width: Should be set to the width in bits of the length register as configured in h/w. Takes values {8...26}. If the property