RE: [PATCH v2] dmaengine: sh: rz-dmac: Set DMA transfer parameters based on the direction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Vinod,

Thanks for the feedback.

> Subject: Re: [PATCH v2] dmaengine: sh: rz-dmac: Set DMA transfer
> parameters based on the direction
> 
> On 09-04-22, 17:53, Biju Das wrote:
> > Client drivers configure DMA transfer parameters based on the DMA
> > transfer direction.
> >
> > This patch sets corresponding parameters in rz_dmac_config() based on
> > the DMA transfer direction.
> >
> > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> > Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
> > ---
> > v1->v2:
> >  * Updated commit description
> > ---
> >  drivers/dma/sh/rz-dmac.c | 26 +++++++++++++-------------
> >  1 file changed, 13 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c index
> > ee2872e7d64c..de57ae006879 100644
> > --- a/drivers/dma/sh/rz-dmac.c
> > +++ b/drivers/dma/sh/rz-dmac.c
> > @@ -597,24 +597,24 @@ static int rz_dmac_config(struct dma_chan *chan,
> >  			  struct dma_slave_config *config)  {
> >  	struct rz_dmac_chan *channel = to_rz_dmac_chan(chan);
> > -	u32 val;
> > +	u32 val, data_sz;
> >
> > -	channel->src_per_address = config->src_addr;
> > -	channel->src_word_size = config->src_addr_width;
> > -	channel->dst_per_address = config->dst_addr;
> > -	channel->dst_word_size = config->dst_addr_width;
> > -
> > -	val = rz_dmac_ds_to_val_mapping(config->dst_addr_width);
> > -	if (val == CHCFG_DS_INVALID)
> > -		return -EINVAL;
> > -
> > -	channel->chcfg |= CHCFG_FILL_DDS(val);
> > +	if (config->direction == DMA_DEV_TO_MEM) {
> 
> This is a deprecated field, pls do not use this...
> 
> Above code is correct and then based on direction of the descriptor you
> would use either src or dstn parameters

OK, I get -EINVAL because of [1] as client driver is filling
{src,dst}_addr_width based on direction. 

Maybe I should remove the check from this function or
Fix [1], as it is deprecated?? Please share your views on this.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/spi/spi-rspi.c?h=v5.18-rc2#n1112

Regards,
Biju




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux