Re: [PATCH 3/3] dmaengine: qcom: Add GPI dma driver

From: kernel test robot
Date: Mon Aug 24 2020 - 10:15:40 EST


Hi Vinod,

I love your patch! Perhaps something to improve:

[auto build test WARNING on vkoul-dmaengine/next]
[also build test WARNING on v5.9-rc2 next-20200824]
[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/Vinod-Koul/dmaengine-Add-support-for-Qcom-GSI-dma-controller/20200824-174027
base: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-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=arm

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

All warnings (new ones prefixed by >>):

drivers/dma/qcom/gpi.c:7: warning: "DEBUG" redefined
7 | #define DEBUG
|
<command-line>: note: this is the location of the previous definition
drivers/dma/qcom/gpi.c: In function 'gpi_process_imed_data_event':
drivers/dma/qcom/gpi.c:1048:2: error: implicit declaration of function 'kfree'; did you mean 'vfree'? [-Werror=implicit-function-declaration]
1048 | kfree(gpi_desc);
| ^~~~~
| vfree
In file included from include/linux/printk.h:405,
from include/linux/kernel.h:15,
from include/asm-generic/bug.h:20,
from arch/arm/include/asm/bug.h:60,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/current.h:5,
from ./arch/arm/include/generated/asm/current.h:1,
from include/linux/sched.h:12,
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/dma/qcom/gpi.c:10:
drivers/dma/qcom/gpi.c: In function 'gpi_alloc_ring':
>> drivers/dma/qcom/gpi.c:1450:3: warning: format '%lu' expects argument of type 'long unsigned int', but argument 8 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
1450 | "#el:%u el_size:%u len:%u actual_len:%llu alloc_size:%lu\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
125 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
157 | _dynamic_func_call(fmt,__dynamic_dev_dbg, \
| ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:115:2: note: in expansion of macro 'dynamic_dev_dbg'
115 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~
include/linux/dev_printk.h:115:23: note: in expansion of macro 'dev_fmt'
115 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/dma/qcom/gpi.c:1449:2: note: in expansion of macro 'dev_dbg'
1449 | dev_dbg(gpii->gpi_dev->dev,
| ^~~~~~~
drivers/dma/qcom/gpi.c:1450:58: note: format string is defined here
1450 | "#el:%u el_size:%u len:%u actual_len:%llu alloc_size:%lu\n",
| ~~^
| |
| long unsigned int
| %u
In file included from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from drivers/dma/qcom/gpi.c:10:
drivers/dma/qcom/gpi.c:1458:31: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
1458 | dev_err(gpii->gpi_dev->dev, "could not alloc size:%lu mem for ring\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/dma/qcom/gpi.c:1458:3: note: in expansion of macro 'dev_err'
1458 | dev_err(gpii->gpi_dev->dev, "could not alloc size:%lu mem for ring\n",
| ^~~~~~~
drivers/dma/qcom/gpi.c:1458:55: note: format string is defined here
1458 | dev_err(gpii->gpi_dev->dev, "could not alloc size:%lu mem for ring\n",
| ~~^
| |
| long unsigned int
| %u
In file included from include/linux/printk.h:405,
from include/linux/kernel.h:15,
from include/asm-generic/bug.h:20,
from arch/arm/include/asm/bug.h:60,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/current.h:5,
from ./arch/arm/include/generated/asm/current.h:1,
from include/linux/sched.h:12,
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/dma/qcom/gpi.c:10:
>> drivers/dma/qcom/gpi.c:1478:3: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Wformat=]
1478 | "phy_pre:0x%0llx phy_alig:0x%0llx len:%u el_size:%u elements:%u\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
125 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
157 | _dynamic_func_call(fmt,__dynamic_dev_dbg, \
| ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:115:2: note: in expansion of macro 'dynamic_dev_dbg'
115 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~
include/linux/dev_printk.h:115:23: note: in expansion of macro 'dev_fmt'
115 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/dma/qcom/gpi.c:1477:2: note: in expansion of macro 'dev_dbg'
1477 | dev_dbg(gpii->gpi_dev->dev,
| ^~~~~~~
drivers/dma/qcom/gpi.c:1478:18: note: format string is defined here
1478 | "phy_pre:0x%0llx phy_alig:0x%0llx len:%u el_size:%u elements:%u\n",
| ~~~~^
| |
| long long unsigned int
| %0x
In file included from include/linux/printk.h:405,
from include/linux/kernel.h:15,
from include/asm-generic/bug.h:20,
from arch/arm/include/asm/bug.h:60,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/current.h:5,
from ./arch/arm/include/generated/asm/current.h:1,
from include/linux/sched.h:12,
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/dma/qcom/gpi.c:10:
>> drivers/dma/qcom/gpi.c:1478:3: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'phys_addr_t' {aka 'unsigned int'} [-Wformat=]
1478 | "phy_pre:0x%0llx phy_alig:0x%0llx len:%u el_size:%u elements:%u\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
125 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
157 | _dynamic_func_call(fmt,__dynamic_dev_dbg, \
| ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:115:2: note: in expansion of macro 'dynamic_dev_dbg'
115 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~
include/linux/dev_printk.h:115:23: note: in expansion of macro 'dev_fmt'
115 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/dma/qcom/gpi.c:1477:2: note: in expansion of macro 'dev_dbg'
1477 | dev_dbg(gpii->gpi_dev->dev,
| ^~~~~~~
drivers/dma/qcom/gpi.c:1478:35: note: format string is defined here
1478 | "phy_pre:0x%0llx phy_alig:0x%0llx len:%u el_size:%u elements:%u\n",
| ~~~~^
| |
| long long unsigned int
| %0x
drivers/dma/qcom/gpi.c: In function 'gpi_prep_slave_sg':
drivers/dma/qcom/gpi.c:1772:13: error: implicit declaration of function 'kzalloc'; did you mean 'vzalloc'? [-Werror=implicit-function-declaration]
1772 | gpi_desc = kzalloc(sizeof(*gpi_desc), GFP_NOWAIT);
| ^~~~~~~
| vzalloc
drivers/dma/qcom/gpi.c:1772:11: warning: assignment to 'struct gpi_desc *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1772 | gpi_desc = kzalloc(sizeof(*gpi_desc), GFP_NOWAIT);
| ^
cc1: some warnings being treated as errors

# https://github.com/0day-ci/linux/commit/25062cc46a95e9de91752963ea85b934fe7acfa1
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Vinod-Koul/dmaengine-Add-support-for-Qcom-GSI-dma-controller/20200824-174027
git checkout 25062cc46a95e9de91752963ea85b934fe7acfa1
vim +1450 drivers/dma/qcom/gpi.c

1435
1436 /* allocate memory for transfer and event rings */
1437 static int gpi_alloc_ring(struct gpi_ring *ring, u32 elements,
1438 u32 el_size, struct gpii *gpii)
1439 {
1440 u64 len = elements * el_size;
1441 int bit;
1442
1443 /* ring len must be power of 2 */
1444 bit = find_last_bit((unsigned long *)&len, 32);
1445 if (((1 << bit) - 1) & len)
1446 bit++;
1447 len = 1 << bit;
1448 ring->alloc_size = (len + (len - 1));
1449 dev_dbg(gpii->gpi_dev->dev,
> 1450 "#el:%u el_size:%u len:%u actual_len:%llu alloc_size:%lu\n",
1451 elements, el_size, (elements * el_size), len,
1452 ring->alloc_size);
1453
1454 ring->pre_aligned = dma_alloc_coherent(gpii->gpi_dev->dev,
1455 ring->alloc_size,
1456 &ring->dma_handle, GFP_KERNEL);
1457 if (!ring->pre_aligned) {
1458 dev_err(gpii->gpi_dev->dev, "could not alloc size:%lu mem for ring\n",
1459 ring->alloc_size);
1460 return -ENOMEM;
1461 }
1462
1463 /* align the physical mem */
1464 ring->phys_addr = (ring->dma_handle + (len - 1)) & ~(len - 1);
1465 ring->base = ring->pre_aligned + (ring->phys_addr - ring->dma_handle);
1466 ring->rp = ring->base;
1467 ring->wp = ring->base;
1468 ring->len = len;
1469 ring->el_size = el_size;
1470 ring->elements = ring->len / ring->el_size;
1471 memset(ring->base, 0, ring->len);
1472 ring->configured = true;
1473
1474 /* update to other cores */
1475 smp_wmb();
1476
1477 dev_dbg(gpii->gpi_dev->dev,
> 1478 "phy_pre:0x%0llx phy_alig:0x%0llx len:%u el_size:%u elements:%u\n",
1479 ring->dma_handle, ring->phys_addr, ring->len,
1480 ring->el_size, ring->elements);
1481
1482 return 0;
1483 }
1484

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

Attachment: .config.gz
Description: application/gzip