* [3/3] dmaengine: xilinx_dma: Fix 64-bit simple CDMA transfer
@ 2018-09-11 7:41 Vinod Koul
0 siblings, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2018-09-11 7:41 UTC (permalink / raw)
To: Radhey Shyam Pandey
Cc: dan.j.williams@intel.com, Michal Simek,
Appana Durga Kedareswara Rao, lars@metafoo.de,
dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
On 07-09-18, 12:08, Radhey Shyam Pandey wrote:
> > > Yeah that part was clear but the implementation can be better..
> I thought over it and it seems having a new interface dma_ctrl_write_64
> taking lsb and msb bits input looks better and scalable. It will be similar
> to existing vdma_desc_write_64 impl. I will send v2 if it looks ok.
Yes that is much better, btw why not reuse same routine as common xilinx
lib functions :)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [3/3] dmaengine: xilinx_dma: Fix 64-bit simple CDMA transfer
@ 2018-09-11 9:31 Radhey Shyam Pandey
0 siblings, 0 replies; 8+ messages in thread
From: Radhey Shyam Pandey @ 2018-09-11 9:31 UTC (permalink / raw)
To: Vinod
Cc: dan.j.williams@intel.com, Michal Simek,
Appana Durga Kedareswara Rao, lars@metafoo.de,
dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
> > > > Yeah that part was clear but the implementation can be better..
> > I thought over it and it seems having a new interface dma_ctrl_write_64
> > taking lsb and msb bits input looks better and scalable. It will be similar
> > to existing vdma_desc_write_64 impl. I will send v2 if it looks ok.
>
> Yes that is much better, btw why not reuse same routine as common xilinx
> lib functions :)
Thanks. vdma_desc_write_64 uses a different offset i.e desc_offset.
For reusing it we need to have an additional check to derive offset
(ctrl_offset/desc_offset) based on channel config type. Considering
it, i think a separate helper interface _64 for desc/control offset
simplifies the flow. Please let me know your thoughts on it.
-Radhey
>
> --
> ~Vinod
^ permalink raw reply [flat|nested] 8+ messages in thread
* [3/3] dmaengine: xilinx_dma: Fix 64-bit simple CDMA transfer
@ 2018-09-07 12:08 Radhey Shyam Pandey
0 siblings, 0 replies; 8+ messages in thread
From: Radhey Shyam Pandey @ 2018-09-07 12:08 UTC (permalink / raw)
To: Vinod
Cc: dan.j.williams@intel.com, Michal Simek,
Appana Durga Kedareswara Rao, lars@metafoo.de,
dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
<snip>
> > > > > - xilinx_write(chan, XILINX_CDMA_REG_SRCADDR, hw-
> > > > >src_addr);
> > > > > - xilinx_write(chan, XILINX_CDMA_REG_DSTADDR, hw-
> > > > >dest_addr);
> > > > > + xilinx_write(chan, XILINX_CDMA_REG_SRCADDR,
> > > > (dma_addr_t)
> > > > > + ((u64)hw->src_addr_msb << 32 | hw-
> >src_addr));
> > > >
> > > > so this is:
> > > > (dma_addr_t)((u64)hw->src_addr_msb << 32 | hw->src_addr)
> > > >
> > > > what is src_addr data type? I think its u32. It would be better to
> > > > update xilinx_write() to take u64 and not dma_addr_t.
> > >
> > > Yes, src_addr_msb and src_addr BD fields are u32. To explain: There is no
> > > prob in xilinx_write it takes dma_addr_t as an arg which is 32/64 bit
> > > depending on _DMA_ADDR_T_64BIT. In 64bit CDMA transfer, there was a
> > bug
> > > i.e in the call to xilinx_write src_addr_msb 32 bits were not passed. To fix
> > > that combine MSB and LSB 32 bits before passing it to xilinx_write.
> >
> > Yeah that part was clear but the implementation can be better..
I thought over it and it seems having a new interface dma_ctrl_write_64
taking lsb and msb bits input looks better and scalable. It will be similar
to existing vdma_desc_write_64 impl. I will send v2 if it looks ok.
Thanks,
Radhey
<snip>
>
> >
> > --
> > ~Vinod
^ permalink raw reply [flat|nested] 8+ messages in thread
* [3/3] dmaengine: xilinx_dma: Fix 64-bit simple CDMA transfer
@ 2018-08-29 17:05 Radhey Shyam Pandey
0 siblings, 0 replies; 8+ messages in thread
From: Radhey Shyam Pandey @ 2018-08-29 17:05 UTC (permalink / raw)
To: Vinod
Cc: dan.j.williams@intel.com, Michal Simek,
Appana Durga Kedareswara Rao, lars@metafoo.de,
dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
> -----Original Message-----
> From: Vinod <vkoul@kernel.org>
> Sent: Wednesday, August 29, 2018 9:31 AM
> To: Radhey Shyam Pandey <radheys@xilinx.com>
> Cc: dan.j.williams@intel.com; Michal Simek <michals@xilinx.com>; Appana
> Durga Kedareswara Rao <appanad@xilinx.com>; lars@metafoo.de;
> dmaengine@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH 3/3] dmaengine: xilinx_dma: Fix 64-bit simple CDMA
> transfer
>
> On 28-08-18, 14:03, Radhey Shyam Pandey wrote:
> > > On 27-07-18, 16:20, Radhey Shyam Pandey wrote:
> > > > In AXI CDMA simple mode also pass MSB bits of source and destination
> > > > address to xilinx_write function. This fixes simple CDMA operation
> > > > mode using 64-bit addressing.
> > > >
> > > > Signed-off-by: Radhey Shyam Pandey
> <radhey.shyam.pandey@xilinx.com>
> > > > Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> > > > ---
> > > > drivers/dma/xilinx/xilinx_dma.c | 6 ++++--
> > > > 1 files changed, 4 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/drivers/dma/xilinx/xilinx_dma.c
> b/drivers/dma/xilinx/xilinx_dma.c
> > > > index a37871e..2e15d86 100644
> > > > --- a/drivers/dma/xilinx/xilinx_dma.c
> > > > +++ b/drivers/dma/xilinx/xilinx_dma.c
> > > > @@ -1245,8 +1245,10 @@ static void xilinx_cdma_start_transfer(struct
> > > xilinx_dma_chan *chan)
> > > >
> > > > hw = &segment->hw;
> > > >
> > > > - xilinx_write(chan, XILINX_CDMA_REG_SRCADDR, hw-
> > > >src_addr);
> > > > - xilinx_write(chan, XILINX_CDMA_REG_DSTADDR, hw-
> > > >dest_addr);
> > > > + xilinx_write(chan, XILINX_CDMA_REG_SRCADDR,
> > > (dma_addr_t)
> > > > + ((u64)hw->src_addr_msb << 32 | hw->src_addr));
> > >
> > > so this is:
> > > (dma_addr_t)((u64)hw->src_addr_msb << 32 | hw->src_addr)
> > >
> > > what is src_addr data type? I think its u32. It would be better to
> > > update xilinx_write() to take u64 and not dma_addr_t.
> >
> > Yes, src_addr_msb and src_addr BD fields are u32. To explain: There is no
> > prob in xilinx_write it takes dma_addr_t as an arg which is 32/64 bit
> > depending on _DMA_ADDR_T_64BIT. In 64bit CDMA transfer, there was a
> bug
> > i.e in the call to xilinx_write src_addr_msb 32 bits were not passed. To fix
> > that combine MSB and LSB 32 bits before passing it to xilinx_write.
>
> Yeah that part was clear but the implementation can be better..
Thanks! Separate fields for source address are needed due to CDMA BD structure.
Please suggest if it doesn't look ok.
>
> --
> ~Vinod
^ permalink raw reply [flat|nested] 8+ messages in thread
* [3/3] dmaengine: xilinx_dma: Fix 64-bit simple CDMA transfer
@ 2018-08-29 4:01 Vinod Koul
0 siblings, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2018-08-29 4:01 UTC (permalink / raw)
To: Radhey Shyam Pandey
Cc: dan.j.williams@intel.com, Michal Simek,
Appana Durga Kedareswara Rao, lars@metafoo.de,
dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
On 28-08-18, 14:03, Radhey Shyam Pandey wrote:
> > On 27-07-18, 16:20, Radhey Shyam Pandey wrote:
> > > In AXI CDMA simple mode also pass MSB bits of source and destination
> > > address to xilinx_write function. This fixes simple CDMA operation
> > > mode using 64-bit addressing.
> > >
> > > Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
> > > Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> > > ---
> > > drivers/dma/xilinx/xilinx_dma.c | 6 ++++--
> > > 1 files changed, 4 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
> > > index a37871e..2e15d86 100644
> > > --- a/drivers/dma/xilinx/xilinx_dma.c
> > > +++ b/drivers/dma/xilinx/xilinx_dma.c
> > > @@ -1245,8 +1245,10 @@ static void xilinx_cdma_start_transfer(struct
> > xilinx_dma_chan *chan)
> > >
> > > hw = &segment->hw;
> > >
> > > - xilinx_write(chan, XILINX_CDMA_REG_SRCADDR, hw-
> > >src_addr);
> > > - xilinx_write(chan, XILINX_CDMA_REG_DSTADDR, hw-
> > >dest_addr);
> > > + xilinx_write(chan, XILINX_CDMA_REG_SRCADDR,
> > (dma_addr_t)
> > > + ((u64)hw->src_addr_msb << 32 | hw->src_addr));
> >
> > so this is:
> > (dma_addr_t)((u64)hw->src_addr_msb << 32 | hw->src_addr)
> >
> > what is src_addr data type? I think its u32. It would be better to
> > update xilinx_write() to take u64 and not dma_addr_t.
>
> Yes, src_addr_msb and src_addr BD fields are u32. To explain: There is no
> prob in xilinx_write it takes dma_addr_t as an arg which is 32/64 bit
> depending on _DMA_ADDR_T_64BIT. In 64bit CDMA transfer, there was a bug
> i.e in the call to xilinx_write src_addr_msb 32 bits were not passed. To fix
> that combine MSB and LSB 32 bits before passing it to xilinx_write.
Yeah that part was clear but the implementation can be better..
^ permalink raw reply [flat|nested] 8+ messages in thread
* [3/3] dmaengine: xilinx_dma: Fix 64-bit simple CDMA transfer
@ 2018-08-28 14:03 Radhey Shyam Pandey
0 siblings, 0 replies; 8+ messages in thread
From: Radhey Shyam Pandey @ 2018-08-28 14:03 UTC (permalink / raw)
To: Vinod
Cc: dan.j.williams@intel.com, Michal Simek,
Appana Durga Kedareswara Rao, lars@metafoo.de,
dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
> -----Original Message-----
> From: Vinod <vkoul@kernel.org>
> Sent: Tuesday, August 21, 2018 9:26 PM
> To: Radhey Shyam Pandey <radheys@xilinx.com>
> Cc: dan.j.williams@intel.com; Michal Simek <michals@xilinx.com>; Appana
> Durga Kedareswara Rao <appanad@xilinx.com>; lars@metafoo.de;
> dmaengine@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH 3/3] dmaengine: xilinx_dma: Fix 64-bit simple CDMA
> transfer
>
> On 27-07-18, 16:20, Radhey Shyam Pandey wrote:
> > In AXI CDMA simple mode also pass MSB bits of source and destination
> > address to xilinx_write function. This fixes simple CDMA operation
> > mode using 64-bit addressing.
> >
> > Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
> > Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> > ---
> > drivers/dma/xilinx/xilinx_dma.c | 6 ++++--
> > 1 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
> > index a37871e..2e15d86 100644
> > --- a/drivers/dma/xilinx/xilinx_dma.c
> > +++ b/drivers/dma/xilinx/xilinx_dma.c
> > @@ -1245,8 +1245,10 @@ static void xilinx_cdma_start_transfer(struct
> xilinx_dma_chan *chan)
> >
> > hw = &segment->hw;
> >
> > - xilinx_write(chan, XILINX_CDMA_REG_SRCADDR, hw-
> >src_addr);
> > - xilinx_write(chan, XILINX_CDMA_REG_DSTADDR, hw-
> >dest_addr);
> > + xilinx_write(chan, XILINX_CDMA_REG_SRCADDR,
> (dma_addr_t)
> > + ((u64)hw->src_addr_msb << 32 | hw->src_addr));
>
> so this is:
> (dma_addr_t)((u64)hw->src_addr_msb << 32 | hw->src_addr)
>
> what is src_addr data type? I think its u32. It would be better to
> update xilinx_write() to take u64 and not dma_addr_t.
Yes, src_addr_msb and src_addr BD fields are u32. To explain: There is no
prob in xilinx_write it takes dma_addr_t as an arg which is 32/64 bit
depending on _DMA_ADDR_T_64BIT. In 64bit CDMA transfer, there was a bug
i.e in the call to xilinx_write src_addr_msb 32 bits were not passed. To fix
that combine MSB and LSB 32 bits before passing it to xilinx_write.
Thanks,
Radhey
>
>
> > + xilinx_write(chan, XILINX_CDMA_REG_DSTADDR,
> (dma_addr_t)
> > + ((u64)hw->dest_addr_msb << 32 | hw-
> >dest_addr));
> >
> > /* Start the transfer */
> > dma_ctrl_write(chan, XILINX_DMA_REG_BTT,
> > --
> > 1.7.1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe dmaengine" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> --
> ~Vinod
^ permalink raw reply [flat|nested] 8+ messages in thread
* [3/3] dmaengine: xilinx_dma: Fix 64-bit simple CDMA transfer
@ 2018-08-21 15:55 Vinod Koul
0 siblings, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2018-08-21 15:55 UTC (permalink / raw)
To: Radhey Shyam Pandey
Cc: dan.j.williams, michal.simek, appana.durga.rao, lars, dmaengine,
linux-arm-kernel, linux-kernel
On 27-07-18, 16:20, Radhey Shyam Pandey wrote:
> In AXI CDMA simple mode also pass MSB bits of source and destination
> address to xilinx_write function. This fixes simple CDMA operation
> mode using 64-bit addressing.
>
> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> drivers/dma/xilinx/xilinx_dma.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
> index a37871e..2e15d86 100644
> --- a/drivers/dma/xilinx/xilinx_dma.c
> +++ b/drivers/dma/xilinx/xilinx_dma.c
> @@ -1245,8 +1245,10 @@ static void xilinx_cdma_start_transfer(struct xilinx_dma_chan *chan)
>
> hw = &segment->hw;
>
> - xilinx_write(chan, XILINX_CDMA_REG_SRCADDR, hw->src_addr);
> - xilinx_write(chan, XILINX_CDMA_REG_DSTADDR, hw->dest_addr);
> + xilinx_write(chan, XILINX_CDMA_REG_SRCADDR, (dma_addr_t)
> + ((u64)hw->src_addr_msb << 32 | hw->src_addr));
so this is:
(dma_addr_t)((u64)hw->src_addr_msb << 32 | hw->src_addr)
what is src_addr data type? I think its u32. It would be better to
update xilinx_write() to take u64 and not dma_addr_t.
> + xilinx_write(chan, XILINX_CDMA_REG_DSTADDR, (dma_addr_t)
> + ((u64)hw->dest_addr_msb << 32 | hw->dest_addr));
>
> /* Start the transfer */
> dma_ctrl_write(chan, XILINX_DMA_REG_BTT,
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe dmaengine" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread* [3/3] dmaengine: xilinx_dma: Fix 64-bit simple CDMA transfer
@ 2018-07-27 10:50 Radhey Shyam Pandey
0 siblings, 0 replies; 8+ messages in thread
From: Radhey Shyam Pandey @ 2018-07-27 10:50 UTC (permalink / raw)
To: dan.j.williams, vkoul, michal.simek, appana.durga.rao, lars,
radhey.shyam.pandey
Cc: dmaengine, linux-arm-kernel, linux-kernel
In AXI CDMA simple mode also pass MSB bits of source and destination
address to xilinx_write function. This fixes simple CDMA operation
mode using 64-bit addressing.
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
drivers/dma/xilinx/xilinx_dma.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index a37871e..2e15d86 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -1245,8 +1245,10 @@ static void xilinx_cdma_start_transfer(struct xilinx_dma_chan *chan)
hw = &segment->hw;
- xilinx_write(chan, XILINX_CDMA_REG_SRCADDR, hw->src_addr);
- xilinx_write(chan, XILINX_CDMA_REG_DSTADDR, hw->dest_addr);
+ xilinx_write(chan, XILINX_CDMA_REG_SRCADDR, (dma_addr_t)
+ ((u64)hw->src_addr_msb << 32 | hw->src_addr));
+ xilinx_write(chan, XILINX_CDMA_REG_DSTADDR, (dma_addr_t)
+ ((u64)hw->dest_addr_msb << 32 | hw->dest_addr));
/* Start the transfer */
dma_ctrl_write(chan, XILINX_DMA_REG_BTT,
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-09-11 9:31 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-11 7:41 [3/3] dmaengine: xilinx_dma: Fix 64-bit simple CDMA transfer Vinod Koul
-- strict thread matches above, loose matches on Subject: below --
2018-09-11 9:31 Radhey Shyam Pandey
2018-09-07 12:08 Radhey Shyam Pandey
2018-08-29 17:05 Radhey Shyam Pandey
2018-08-29 4:01 Vinod Koul
2018-08-28 14:03 Radhey Shyam Pandey
2018-08-21 15:55 Vinod Koul
2018-07-27 10:50 Radhey Shyam Pandey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox