Re: [PATCH v2 6/6] spi: Move cadence-quadspi driver to drivers/spi/

From: kbuild test robot
Date: Wed May 27 2020 - 17:07:58 EST


Hi Vignesh,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on spi/for-next]
[also build test WARNING on linus/master v5.7-rc7 next-20200526]
[cannot apply to mtd/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Vignesh-Raghavendra/mtd-spi-nor-Move-cadence-qaudspi-to-spi-mem-framework/20200526-174159
base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa

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

All warnings (new ones prefixed by >>, old ones prefixed by <<):

In file included from include/linux/err.h:5,
from include/linux/clk.h:12,
from drivers/spi/spi-cadence-quadspi.c:9:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/xtensa/include/asm/page.h:193:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
193 | ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/xtensa/include/asm/page.h:201:32: note: in expansion of macro 'pfn_valid'
201 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
| ^~~~~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from ./arch/xtensa/include/generated/asm/bug.h:1,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from arch/xtensa/include/asm/current.h:18,
from include/linux/mutex.h:14,
from include/linux/notifier.h:14,
from include/linux/clk.h:14,
from drivers/spi/spi-cadence-quadspi.c:9:
include/linux/dma-mapping.h: In function 'dma_map_resource':
arch/xtensa/include/asm/page.h:193:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
193 | ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
| ^~
include/asm-generic/bug.h:139:27: note: in definition of macro 'WARN_ON_ONCE'
139 | int __ret_warn_once = !!(condition); | ^~~~~~~~~
include/linux/dma-mapping.h:352:19: note: in expansion of macro 'pfn_valid'
352 | if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
| ^~~~~~~~~
In file included from include/linux/shm.h:6,
from include/linux/sched.h:16,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from drivers/spi/spi-cadence-quadspi.c:12:
drivers/spi/spi-cadence-quadspi.c: In function 'cqspi_direct_read_execute':
arch/xtensa/include/asm/page.h:193:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
193 | ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
| ^~
arch/xtensa/include/asm/page.h:201:32: note: in expansion of macro 'pfn_valid'
201 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
| ^~~~~~~~~
>> drivers/spi/spi-cadence-quadspi.c:911:26: note: in expansion of macro 'virt_addr_valid'
911 | if (!cqspi->rx_chan || !virt_addr_valid(buf)) {
| ^~~~~~~~~~~~~~~

vim +/virt_addr_valid +911 drivers/spi/spi-cadence-quadspi.c

ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 898
d467c948c5d40f drivers/mtd/spi-nor/controllers/cadence-quadspi.c Ramuthevar Vadivel Murugan 2020-05-26 899 static int cqspi_direct_read_execute(struct cqspi_flash_pdata *f_pdata,
d467c948c5d40f drivers/mtd/spi-nor/controllers/cadence-quadspi.c Ramuthevar Vadivel Murugan 2020-05-26 900 u_char *buf, loff_t from, size_t len)
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 901 {
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 902 struct cqspi_st *cqspi = f_pdata->cqspi;
d467c948c5d40f drivers/mtd/spi-nor/controllers/cadence-quadspi.c Ramuthevar Vadivel Murugan 2020-05-26 903 struct device *dev = &cqspi->pdev->dev;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 904 enum dma_ctrl_flags flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 905 dma_addr_t dma_src = (dma_addr_t)cqspi->mmap_phys_base + from;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 906 int ret = 0;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 907 struct dma_async_tx_descriptor *tx;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 908 dma_cookie_t cookie;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 909 dma_addr_t dma_dst;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 910
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 @911 if (!cqspi->rx_chan || !virt_addr_valid(buf)) {
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 912 memcpy_fromio(buf, cqspi->ahb_base + from, len);
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 913 return 0;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 914 }
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 915
d467c948c5d40f drivers/mtd/spi-nor/controllers/cadence-quadspi.c Ramuthevar Vadivel Murugan 2020-05-26 916 dma_dst = dma_map_single(dev, buf, len, DMA_FROM_DEVICE);
d467c948c5d40f drivers/mtd/spi-nor/controllers/cadence-quadspi.c Ramuthevar Vadivel Murugan 2020-05-26 917 if (dma_mapping_error(dev, dma_dst)) {
d467c948c5d40f drivers/mtd/spi-nor/controllers/cadence-quadspi.c Ramuthevar Vadivel Murugan 2020-05-26 918 dev_err(dev, "dma mapping failed\n");
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 919 return -ENOMEM;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 920 }
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 921 tx = dmaengine_prep_dma_memcpy(cqspi->rx_chan, dma_dst, dma_src,
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 922 len, flags);
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 923 if (!tx) {
d467c948c5d40f drivers/mtd/spi-nor/controllers/cadence-quadspi.c Ramuthevar Vadivel Murugan 2020-05-26 924 dev_err(dev, "device_prep_dma_memcpy error\n");
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 925 ret = -EIO;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 926 goto err_unmap;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 927 }
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 928
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 929 tx->callback = cqspi_rx_dma_callback;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 930 tx->callback_param = cqspi;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 931 cookie = tx->tx_submit(tx);
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 932 reinit_completion(&cqspi->rx_dma_complete);
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 933
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 934 ret = dma_submit_error(cookie);
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 935 if (ret) {
d467c948c5d40f drivers/mtd/spi-nor/controllers/cadence-quadspi.c Ramuthevar Vadivel Murugan 2020-05-26 936 dev_err(dev, "dma_submit_error %d\n", cookie);
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 937 ret = -EIO;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 938 goto err_unmap;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 939 }
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 940
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 941 dma_async_issue_pending(cqspi->rx_chan);
3938c0d4cf6047 drivers/mtd/spi-nor/cadence-quadspi.c Nicholas Mc Guire 2018-07-21 942 if (!wait_for_completion_timeout(&cqspi->rx_dma_complete,
3938c0d4cf6047 drivers/mtd/spi-nor/cadence-quadspi.c Nicholas Mc Guire 2018-07-21 943 msecs_to_jiffies(len))) {
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 944 dmaengine_terminate_sync(cqspi->rx_chan);
d467c948c5d40f drivers/mtd/spi-nor/controllers/cadence-quadspi.c Ramuthevar Vadivel Murugan 2020-05-26 945 dev_err(dev, "DMA wait_for_completion_timeout\n");
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 946 ret = -ETIMEDOUT;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 947 goto err_unmap;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 948 }
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 949
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 950 err_unmap:
d467c948c5d40f drivers/mtd/spi-nor/controllers/cadence-quadspi.c Ramuthevar Vadivel Murugan 2020-05-26 951 dma_unmap_single(dev, dma_dst, len, DMA_FROM_DEVICE);
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 952
91d7b67000c6e9 drivers/mtd/spi-nor/cadence-quadspi.c Christophe JAILLET 2018-10-16 953 return ret;
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 954 }
ffa639e069fb55 drivers/mtd/spi-nor/cadence-quadspi.c Vignesh R 2018-04-10 955

:::::: The code at line 911 was first introduced by commit
:::::: ffa639e069fb55a150a2f14af6762b2c429e6d50 mtd: spi-nor: cadence-quadspi: Add DMA support for direct mode reads

:::::: TO: Vignesh R <vigneshr@xxxxxx>
:::::: CC: Boris Brezillon <boris.brezillon@xxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip