> -----Original Message----- > From: Vinod Koul <vkoul@xxxxxxxxxx> > Sent: Wednesday, July 28, 2021 12:53 PM > To: N, Pandith <pandith.n@xxxxxxxxx> > Cc: Eugeniy.Paltsev@xxxxxxxxxxxx; dmaengine@xxxxxxxxxxxxxxx; Raja > Subramanian, Lakshmi Bai <lakshmi.bai.raja.subramanian@xxxxxxxxx>; Pan, Kris > <kris.pan@xxxxxxxxx>; Sangannavar, Mallikarjunappa > <mallikarjunappa.sangannavar@xxxxxxxxx>; Thokala, Srikanth > <srikanth.thokala@xxxxxxxxx> > Subject: Re: [PATCH V4 1/3] dmaengine: dw-axi-dmac: Remove free slot check > algorithm in dw_axi_dma_set_hw_channel > > On 20-07-21, 23:17, pandith.n@xxxxxxxxx wrote: > > From: Pandith N <pandith.n@xxxxxxxxx> > > > > Removed free slot check algorithm in dw_axi_dma_set_hw_channel. For 8 > > DMA channels, use respective handshake slot in DMA_HS_SEL APB register. > > > > For every channel, an dedicated slot is provided in hardware > > handshake register AXIDMA_CTRL_DMA_HS_SEL_n. Peripheral source number > > is programmed in respective channel slots. > > > > Signed-off-by: Pandith N <pandith.n@xxxxxxxxx> > > Tested-by: Pan Kris <kris.pan@xxxxxxxxx> > > --- > > .../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 49 +++++++------------ > > drivers/dma/dw-axi-dmac/dw-axi-dmac.h | 2 + > > 2 files changed, 21 insertions(+), 30 deletions(-) > > > > diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c > > b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c > > index d9e4ac3edb4e..6b871e20ae27 100644 > > --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c > > +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c > > @@ -470,19 +470,14 @@ static void dma_chan_free_chan_resources(struct > dma_chan *dchan) > > pm_runtime_put(chan->chip->dev); > > } > > > > -static void dw_axi_dma_set_hw_channel(struct axi_dma_chip *chip, > > - u32 handshake_num, bool set) > > +static int dw_axi_dma_set_hw_channel(struct axi_dma_chan *chan, bool > > +set) > > what is point of returning error if that is not checked and action taken in caller? > Yes, change of function return type is not required here. API signature will be: static void dw_axi_dma_set_hw_channel(struct axi_dma_chan *chan, bool set) > > { > > - unsigned long start = 0; > > - unsigned long reg_value; > > - unsigned long reg_mask; > > - unsigned long reg_set; > > - unsigned long mask; > > - unsigned long val; > > + struct axi_dma_chip *chip = chan->chip; > > + unsigned long reg_value, val; > > > > if (!chip->apb_regs) { > > dev_dbg(chip->dev, "apb_regs not initialized\n"); > > - return; > > + return -EINVAL; > > should the above log not be error now? Will change this to dev_err > -- > ~Vinod