Re: [PATCH 1/1] dmaengine: fsl-edma: support edma memcpy

From: kernel test robot
Date: Sat Oct 09 2021 - 13:08:03 EST


Hi Joy,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on vkoul-dmaengine/next]
[also build test WARNING on v5.15-rc4 next-20211008]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Joy-Zou/dmaengine-fsl-edma-support-edma-memcpy/20211009-175846
base: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next
config: xtensa-randconfig-s032-20211009 (attached as .config)
compiler: xtensa-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/5ab92681f29355b4b9ff8c603e7d9849c168e636
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Joy-Zou/dmaengine-fsl-edma-support-edma-memcpy/20211009-175846
git checkout 5ab92681f29355b4b9ff8c603e7d9849c168e636
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=xtensa SHELL=/bin/bash drivers/dma/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)
drivers/dma/fsl-edma-common.c:360:28: sparse: sparse: cast from restricted __le32
drivers/dma/fsl-edma-common.c:361:28: sparse: sparse: cast from restricted __le32
drivers/dma/fsl-edma-common.c:363:28: sparse: sparse: cast from restricted __le16
drivers/dma/fsl-edma-common.c:364:30: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected unsigned short [usertype] val @@ got restricted __le16 [usertype] soff @@
drivers/dma/fsl-edma-common.c:364:30: sparse: expected unsigned short [usertype] val
drivers/dma/fsl-edma-common.c:364:30: sparse: got restricted __le16 [usertype] soff
drivers/dma/fsl-edma-common.c:366:28: sparse: sparse: cast from restricted __le32
drivers/dma/fsl-edma-common.c:367:28: sparse: sparse: cast from restricted __le32
drivers/dma/fsl-edma-common.c:369:28: sparse: sparse: cast from restricted __le16
drivers/dma/fsl-edma-common.c:370:28: sparse: sparse: cast from restricted __le16
drivers/dma/fsl-edma-common.c:371:28: sparse: sparse: cast from restricted __le16
drivers/dma/fsl-edma-common.c:373:28: sparse: sparse: cast from restricted __le32
>> drivers/dma/fsl-edma-common.c:377:26: sparse: sparse: invalid assignment: |=
>> drivers/dma/fsl-edma-common.c:377:26: sparse: left side has type restricted __le16
>> drivers/dma/fsl-edma-common.c:377:26: sparse: right side has type unsigned long
drivers/dma/fsl-edma-common.c:379:28: sparse: sparse: cast from restricted __le16

vim +377 drivers/dma/fsl-edma-common.c

344
345 static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan,
346 struct fsl_edma_hw_tcd *tcd)
347 {
348 struct fsl_edma_engine *edma = fsl_chan->edma;
349 struct edma_regs *regs = &fsl_chan->edma->regs;
350 u32 ch = fsl_chan->vchan.chan.chan_id;
351
352 /*
353 * TCD parameters are stored in struct fsl_edma_hw_tcd in little
354 * endian format. However, we need to load the TCD registers in
355 * big- or little-endian obeying the eDMA engine model endian,
356 * and this is performed from specific edma_write functions
357 */
358 edma_writew(edma, 0, &regs->tcd[ch].csr);
359
360 edma_writel(edma, (s32)tcd->saddr, &regs->tcd[ch].saddr);
361 edma_writel(edma, (s32)tcd->daddr, &regs->tcd[ch].daddr);
362
363 edma_writew(edma, (s16)tcd->attr, &regs->tcd[ch].attr);
364 edma_writew(edma, tcd->soff, &regs->tcd[ch].soff);
365
366 edma_writel(edma, (s32)tcd->nbytes, &regs->tcd[ch].nbytes);
367 edma_writel(edma, (s32)tcd->slast, &regs->tcd[ch].slast);
368
369 edma_writew(edma, (s16)tcd->citer, &regs->tcd[ch].citer);
370 edma_writew(edma, (s16)tcd->biter, &regs->tcd[ch].biter);
371 edma_writew(edma, (s16)tcd->doff, &regs->tcd[ch].doff);
372
373 edma_writel(edma, (s32)tcd->dlast_sga,
374 &regs->tcd[ch].dlast_sga);
375
376 if (fsl_chan->is_sw)
> 377 tcd->csr |= EDMA_TCD_CSR_START;
378
379 edma_writew(edma, (s16)tcd->csr, &regs->tcd[ch].csr);
380 }
381

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip