[xlnx:master 98/137] drivers/misc/xilinx-ai-engine/ai-engine-dev.c:507:16: error: redefinition of 'aie_partition_request'
by kernel test robot
Hi Wendy,
FYI, the error/warning still remains.
tree: https://github.com/Xilinx/linux-xlnx master
head: 566441779cdc25e377c2baab9277342b09b4249b
commit: eb3512d6a32d517e5f7deff8a5ed51ffb0640908 [98/137] misc: xilinx-ai-engine: Add extern functions to request AI engine partition
config: sh-allmodconfig (attached as .config)
compiler: sh4-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
git checkout eb3512d6a32d517e5f7deff8a5ed51ffb0640908
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/misc/xilinx-ai-engine/ai-engine-dev.c:507:16: error: redefinition of 'aie_partition_request'
507 | struct device *aie_partition_request(struct aie_partition_req *req)
| ^~~~~~~~~~~~~~~~~~~~~
In file included from drivers/misc/xilinx-ai-engine/ai-engine-dev.c:24:
include/linux/xlnx-ai-engine.h:24:1: note: previous definition of 'aie_partition_request' was here
24 | aie_partition_request(struct aie_partition_req *req)
| ^~~~~~~~~~~~~~~~~~~~~
>> drivers/misc/xilinx-ai-engine/ai-engine-dev.c:541:5: error: redefinition of 'aie_partition_get_fd'
541 | int aie_partition_get_fd(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~
In file included from drivers/misc/xilinx-ai-engine/ai-engine-dev.c:24:
include/linux/xlnx-ai-engine.h:29:19: note: previous definition of 'aie_partition_get_fd' was here
29 | static inline int aie_partition_get_fd(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~
>> drivers/misc/xilinx-ai-engine/ai-engine-dev.c:565:6: error: redefinition of 'aie_partition_release'
565 | void aie_partition_release(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~
In file included from drivers/misc/xilinx-ai-engine/ai-engine-dev.c:24:
include/linux/xlnx-ai-engine.h:34:20: note: previous definition of 'aie_partition_release' was here
34 | static inline void aie_partition_release(struct device *dev) {}
| ^~~~~~~~~~~~~~~~~~~~~
In file included from drivers/misc/xilinx-ai-engine/ai-engine-dev.c:17:
include/linux/module.h:128:42: error: redefinition of '__inittest'
128 | static inline initcall_t __maybe_unused __inittest(void) \
| ^~~~~~~~~~
include/linux/device.h:1903:1: note: in expansion of macro 'module_init'
1903 | module_init(__driver##_init); \
| ^~~~~~~~~~~
include/linux/platform_device.h:238:2: note: in expansion of macro 'module_driver'
238 | module_driver(__platform_driver, platform_driver_register, \
| ^~~~~~~~~~~~~
drivers/misc/xilinx-ai-engine/ai-engine-dev.c:605:1: note: in expansion of macro 'module_platform_driver'
605 | module_platform_driver(xilinx_ai_engine_driver);
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/module.h:128:42: note: previous definition of '__inittest' was here
128 | static inline initcall_t __maybe_unused __inittest(void) \
| ^~~~~~~~~~
include/linux/module.h:111:32: note: in expansion of macro 'module_init'
111 | #define postcore_initcall(fn) module_init(fn)
| ^~~~~~~~~~~
drivers/misc/xilinx-ai-engine/ai-engine-dev.c:596:1: note: in expansion of macro 'postcore_initcall'
596 | postcore_initcall(xilinx_ai_engine_init);
| ^~~~~~~~~~~~~~~~~
include/linux/module.h:130:6: error: redefinition of 'init_module'
130 | int init_module(void) __copy(initfn) __attribute__((alias(#initfn)));
| ^~~~~~~~~~~
include/linux/device.h:1903:1: note: in expansion of macro 'module_init'
1903 | module_init(__driver##_init); \
| ^~~~~~~~~~~
include/linux/platform_device.h:238:2: note: in expansion of macro 'module_driver'
238 | module_driver(__platform_driver, platform_driver_register, \
| ^~~~~~~~~~~~~
drivers/misc/xilinx-ai-engine/ai-engine-dev.c:605:1: note: in expansion of macro 'module_platform_driver'
605 | module_platform_driver(xilinx_ai_engine_driver);
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/module.h:130:6: note: previous definition of 'init_module' was here
130 | int init_module(void) __copy(initfn) __attribute__((alias(#initfn)));
| ^~~~~~~~~~~
include/linux/module.h:111:32: note: in expansion of macro 'module_init'
111 | #define postcore_initcall(fn) module_init(fn)
| ^~~~~~~~~~~
drivers/misc/xilinx-ai-engine/ai-engine-dev.c:596:1: note: in expansion of macro 'postcore_initcall'
596 | postcore_initcall(xilinx_ai_engine_init);
| ^~~~~~~~~~~~~~~~~
include/linux/module.h:134:42: error: redefinition of '__exittest'
134 | static inline exitcall_t __maybe_unused __exittest(void) \
| ^~~~~~~~~~
include/linux/device.h:1908:1: note: in expansion of macro 'module_exit'
1908 | module_exit(__driver##_exit);
| ^~~~~~~~~~~
include/linux/platform_device.h:238:2: note: in expansion of macro 'module_driver'
238 | module_driver(__platform_driver, platform_driver_register, \
| ^~~~~~~~~~~~~
drivers/misc/xilinx-ai-engine/ai-engine-dev.c:605:1: note: in expansion of macro 'module_platform_driver'
605 | module_platform_driver(xilinx_ai_engine_driver);
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/module.h:134:42: note: previous definition of '__exittest' was here
134 | static inline exitcall_t __maybe_unused __exittest(void) \
| ^~~~~~~~~~
drivers/misc/xilinx-ai-engine/ai-engine-dev.c:603:1: note: in expansion of macro 'module_exit'
603 | module_exit(xilinx_ai_engine_exit);
| ^~~~~~~~~~~
include/linux/module.h:136:7: error: redefinition of 'cleanup_module'
136 | void cleanup_module(void) __copy(exitfn) __attribute__((alias(#exitfn)));
| ^~~~~~~~~~~~~~
include/linux/device.h:1908:1: note: in expansion of macro 'module_exit'
1908 | module_exit(__driver##_exit);
| ^~~~~~~~~~~
include/linux/platform_device.h:238:2: note: in expansion of macro 'module_driver'
238 | module_driver(__platform_driver, platform_driver_register, \
| ^~~~~~~~~~~~~
drivers/misc/xilinx-ai-engine/ai-engine-dev.c:605:1: note: in expansion of macro 'module_platform_driver'
605 | module_platform_driver(xilinx_ai_engine_driver);
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/module.h:136:7: note: previous definition of 'cleanup_module' was here
136 | void cleanup_module(void) __copy(exitfn) __attribute__((alias(#exitfn)));
| ^~~~~~~~~~~~~~
drivers/misc/xilinx-ai-engine/ai-engine-dev.c:603:1: note: in expansion of macro 'module_exit'
603 | module_exit(xilinx_ai_engine_exit);
| ^~~~~~~~~~~
vim +/aie_partition_request +507 drivers/misc/xilinx-ai-engine/ai-engine-dev.c
495
496 /**
497 * aie_partition_request() - Request an AI engine partition
498 * @req: AI engine partition requesting arguments
499 * @return: pointer to the AI engine partition device, error value for failure.
500 *
501 * This function looks up the AI engine class devices to find the AI engine
502 * partition whose partition ID matches the given partition ID in @req. If
503 * the partition can be found, it will try to request it. It will get a file
504 * for the requested AI engine partition. User can only use the AI engine
505 * partition after it is successfully requested.
506 */
> 507 struct device *aie_partition_request(struct aie_partition_req *req)
508 {
509 struct aie_partition *apart;
510 int ret;
511
512 if (!req)
513 return ERR_PTR(-EINVAL);
514
515 apart = aie_class_find_partition_from_id(req->partition_id);
516 if (!apart)
517 return ERR_PTR(-ENODEV);
518
519 ret = mutex_lock_interruptible(&apart->mlock);
520 if (ret)
521 return ERR_PTR(ret);
522
523 ret = aie_partition_get(apart, req);
524 mutex_unlock(&apart->mlock);
525 if (ret)
526 return ERR_PTR(ret);
527
528 return &apart->dev;
529 }
530 EXPORT_SYMBOL_GPL(aie_partition_request);
531
532 /**
533 * aie_partition_get_fd() - get AI engine partition file descriptor
534 * @dev: AI engine partition device pointer
535 * @return: file descriptor for the AI engine partition for success, and
536 * negative value for failure.
537 *
538 * This function allocate a file descriptor for the AI engine requested
539 * partition, and increase the reference count to the AI engine partition file.
540 */
> 541 int aie_partition_get_fd(struct device *dev)
542 {
543 struct aie_partition *apart;
544 int ret;
545
546 if (!dev)
547 return -EINVAL;
548
549 apart = dev_to_aiepart(dev);
550
551 ret = aie_partition_fd(apart);
552 if (ret < 0)
553 return ret;
554
555 get_file(apart->filep);
556
557 return ret;
558 }
559 EXPORT_SYMBOL_GPL(aie_partition_get_fd);
560
561 /**
562 * aie_partition_release() - Recrease refcount of the AI engine partition
563 * @dev: AI engine partition device
564 */
> 565 void aie_partition_release(struct device *dev)
566 {
567 struct aie_partition *apart;
568
569 if (WARN_ON(!dev))
570 return;
571
572 apart = dev_to_aiepart(dev);
573 fput(apart->filep);
574 }
575 EXPORT_SYMBOL_GPL(aie_partition_release);
576
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[xlnx:master 137/137] drivers/misc/xilinx-ai-engine/ai-engine-dma.c:83:24: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'}
by kernel test robot
tree: https://github.com/Xilinx/linux-xlnx master
head: 566441779cdc25e377c2baab9277342b09b4249b
commit: 566441779cdc25e377c2baab9277342b09b4249b [137/137] misc: xilinx-ai-engine: add setting shim dma bd operation
config: mips-allyesconfig (attached as .config)
compiler: mips-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
git checkout 566441779cdc25e377c2baab9277342b09b4249b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/cdev.h:8,
from drivers/misc/xilinx-ai-engine/ai-engine-internal.h:13,
from drivers/misc/xilinx-ai-engine/ai-engine-dma.c:8:
drivers/misc/xilinx-ai-engine/ai-engine-dma.c: In function 'aie_part_get_dmabuf_da':
>> drivers/misc/xilinx-ai-engine/ai-engine-dma.c:83:24: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
83 | dev_err(&apart->dev, "failed to find vma for %p, 0x%lx.\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:1658:22: note: in definition of macro 'dev_fmt'
1658 | #define dev_fmt(fmt) fmt
| ^~~
drivers/misc/xilinx-ai-engine/ai-engine-dma.c:83:3: note: in expansion of macro 'dev_err'
83 | dev_err(&apart->dev, "failed to find vma for %p, 0x%lx.\n",
| ^~~~~~~
drivers/misc/xilinx-ai-engine/ai-engine-dma.c:83:56: note: format string is defined here
83 | dev_err(&apart->dev, "failed to find vma for %p, 0x%lx.\n",
| ~~^
| |
| long unsigned int
| %x
In file included from include/linux/cdev.h:8,
from drivers/misc/xilinx-ai-engine/ai-engine-internal.h:13,
from drivers/misc/xilinx-ai-engine/ai-engine-dma.c:8:
drivers/misc/xilinx-ai-engine/ai-engine-dma.c:103:4: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
103 | "failed to get dma address for %p, 0x%lx.\n", va, len);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:1658:22: note: in definition of macro 'dev_fmt'
1658 | #define dev_fmt(fmt) fmt
| ^~~
drivers/misc/xilinx-ai-engine/ai-engine-dma.c:102:3: note: in expansion of macro 'dev_err'
102 | dev_err(&apart->dev,
| ^~~~~~~
drivers/misc/xilinx-ai-engine/ai-engine-dma.c:103:43: note: format string is defined here
103 | "failed to get dma address for %p, 0x%lx.\n", va, len);
| ~~^
| |
| long unsigned int
| %x
vim +83 drivers/misc/xilinx-ai-engine/ai-engine-dma.c
> 8 #include "ai-engine-internal.h"
9 #include <linux/dma-buf.h>
10 #include <linux/kernel.h>
11 #include <linux/mm.h>
12 #include <linux/refcount.h>
13 #include <linux/slab.h>
14 #include <linux/types.h>
15 #include <linux/uaccess.h>
16
17 /**
18 * struct aie_dmabuf - AI engine dmabuf information
19 * @attach: dmabuf attachment pointer
20 * @sgt: scatter/gather table
21 * @refs: refcount of the attached aie_dmabuf
22 * @node: list node
23 */
24 struct aie_dmabuf {
25 struct dma_buf_attachment *attach;
26 struct sg_table *sgt;
27 refcount_t refs;
28 struct list_head node;
29 };
30
31 /**
32 * aie_part_find_dmabuf_from_file() - find a attached dmabuf from file
33 * @apart: AI engine partition
34 * @file: file which belongs to a dmabuf
35 * @return: pointer to AI engine dmabuf struct of the found dmabuf, if dmabuf
36 * is not found, returns NULL.
37 *
38 * This function scans all the attached dmabufs of the AI engine partition,
39 * it checks the file with the attached dmabufs, if it founds a match, it
40 * returns the aie_dmabuf pointer.
41 */
42 static struct aie_dmabuf *
43 aie_part_find_dmabuf_from_file(struct aie_partition *apart,
44 const struct file *file)
45 {
46 struct aie_dmabuf *adbuf;
47
48 list_for_each_entry(adbuf, &apart->dbufs, node) {
49 if (file == adbuf->attach->dmabuf->file)
50 return adbuf;
51 }
52
53 return NULL;
54 }
55
56 /**
57 * aie_part_get_dmabuf_da() - get DMA address from the va
58 * @apart: AI engine partition
59 * @va: virtual address
60 * @len: memory length
61 * @return: dma address of of the specified va, or 0 if va is not valid
62 *
63 * This function returns DMA address if the has been mapped to a dmabuf which
64 * has been attached to the AI engine partition.
65 */
66 static dma_addr_t aie_part_get_dmabuf_da(struct aie_partition *apart,
67 void *va, size_t len)
68 {
69 struct vm_area_struct *vma;
70 struct aie_dmabuf *adbuf;
71 unsigned long va_start, va_off;
72 dma_addr_t da;
73
74 va_start = (unsigned long)((uintptr_t)va);
75 if (!current->mm) {
76 dev_err(&apart->dev,
77 "failed to get dma address from va, no process mm.\n");
78 return 0;
79 }
80
81 vma = find_vma(current->mm, va_start);
82 if (!vma) {
> 83 dev_err(&apart->dev, "failed to find vma for %p, 0x%lx.\n",
84 va, len);
85 return 0;
86 }
87
88 adbuf = aie_part_find_dmabuf_from_file(apart, vma->vm_file);
89 if (!adbuf) {
90 dev_err(&apart->dev,
91 "failed to get dma address for %p, no dma buf is found.\n",
92 va);
93 return 0;
94 }
95
96 va_off = va_start - vma->vm_start;
97 /*
98 * As we only support continuous DMA memory which is guaranteed from
99 * dmabuf attachment, we will compared with the size of the dmabuf only
100 */
101 if (va_off + len >= adbuf->attach->dmabuf->size) {
102 dev_err(&apart->dev,
103 "failed to get dma address for %p, 0x%lx.\n", va, len);
104 return 0;
105 }
106
107 da = sg_dma_address(adbuf->sgt->sgl) + va_off;
108 return da;
109 }
110
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
drivers/net/wireless/intel/iwlwifi/pcie/drv.c:1032 iwl_pci_probe() warn: we never enter this loop
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 00e4db51259a5f936fec1424b884f029479d3981
commit: 2a612a60ab440e6480c77b73403dfee061f74e4b iwlwifi: implement a new device configuration table
date: 7 months ago
config: parisc-randconfig-m031-20200811 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
New smatch warnings:
drivers/net/wireless/intel/iwlwifi/pcie/drv.c:1032 iwl_pci_probe() warn: we never enter this loop
Old smatch warnings:
drivers/net/wireless/intel/iwlwifi/pcie/drv.c:1035 iwl_pci_probe() warn: impossible condition '(dev_info->device == (~0)) => (0-u16max == (-1))'
drivers/net/wireless/intel/iwlwifi/pcie/drv.c:1037 iwl_pci_probe() warn: impossible condition '(dev_info->subdevice == (~0)) => (0-u16max == (-1))'
vim +1032 drivers/net/wireless/intel/iwlwifi/pcie/drv.c
1002
1003 static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1004 {
1005 const struct iwl_cfg_trans_params *trans =
1006 (struct iwl_cfg_trans_params *)(ent->driver_data);
1007 const struct iwl_cfg *cfg_7265d __maybe_unused = NULL;
1008 struct iwl_trans *iwl_trans;
1009 struct iwl_trans_pcie *trans_pcie;
1010 unsigned long flags;
1011 int i, ret;
1012 /*
1013 * This is needed for backwards compatibility with the old
1014 * tables, so we don't need to change all the config structs
1015 * at the same time. The cfg is used to compare with the old
1016 * full cfg structs.
1017 */
1018 const struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data);
1019
1020 /* make sure trans is the first element in iwl_cfg */
1021 BUILD_BUG_ON(offsetof(struct iwl_cfg, trans));
1022
1023 iwl_trans = iwl_trans_pcie_alloc(pdev, ent, trans);
1024 if (IS_ERR(iwl_trans))
1025 return PTR_ERR(iwl_trans);
1026
1027 trans_pcie = IWL_TRANS_GET_PCIE_TRANS(iwl_trans);
1028
1029 /* the trans_cfg should never change, so set it now */
1030 iwl_trans->trans_cfg = trans;
1031
> 1032 for (i = 0; i < ARRAY_SIZE(iwl_dev_info_table); i++) {
1033 const struct iwl_dev_info *dev_info = &iwl_dev_info_table[i];
1034
1035 if ((dev_info->device == IWL_CFG_ANY ||
1036 dev_info->device == pdev->device) &&
1037 (dev_info->subdevice == IWL_CFG_ANY ||
1038 dev_info->subdevice == pdev->subsystem_device)) {
1039 iwl_trans->cfg = dev_info->cfg;
1040 goto found;
1041 }
1042 }
1043
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
net/ipv4/tcp_cong.c:228:24: sparse: sparse: incorrect type in argument 3 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 00e4db51259a5f936fec1424b884f029479d3981
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 8 weeks ago
config: s390-randconfig-s032-20200811 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.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.2-168-g9554805c-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> net/ipv4/tcp_cong.c:228:24: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected struct tcp_congestion_ops const [noderef] __rcu * @@ got struct tcp_congestion_ops *[assigned] ca @@
>> net/ipv4/tcp_cong.c:228:24: sparse: expected struct tcp_congestion_ops const [noderef] __rcu *
net/ipv4/tcp_cong.c:228:24: sparse: got struct tcp_congestion_ops *[assigned] ca
net/ipv4/tcp_cong.c:228:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct tcp_congestion_ops const *prev @@ got struct tcp_congestion_ops const [noderef] __rcu *[assigned] __old @@
net/ipv4/tcp_cong.c:228:22: sparse: expected struct tcp_congestion_ops const *prev
net/ipv4/tcp_cong.c:228:22: sparse: got struct tcp_congestion_ops const [noderef] __rcu *[assigned] __old
vim +228 net/ipv4/tcp_cong.c
317a76f9a44b437 Stephen Hemminger 2005-06-23 213
317a76f9a44b437 Stephen Hemminger 2005-06-23 214 /* Used by sysctl to change default congestion control */
6670e152447732b Stephen Hemminger 2017-11-14 215 int tcp_set_default_congestion_control(struct net *net, const char *name)
317a76f9a44b437 Stephen Hemminger 2005-06-23 216 {
317a76f9a44b437 Stephen Hemminger 2005-06-23 217 struct tcp_congestion_ops *ca;
6670e152447732b Stephen Hemminger 2017-11-14 218 const struct tcp_congestion_ops *prev;
6670e152447732b Stephen Hemminger 2017-11-14 219 int ret;
317a76f9a44b437 Stephen Hemminger 2005-06-23 220
6670e152447732b Stephen Hemminger 2017-11-14 221 rcu_read_lock();
6670e152447732b Stephen Hemminger 2017-11-14 222 ca = tcp_ca_find_autoload(net, name);
6670e152447732b Stephen Hemminger 2017-11-14 223 if (!ca) {
6670e152447732b Stephen Hemminger 2017-11-14 224 ret = -ENOENT;
0baf26b0fcd74bb Martin KaFai Lau 2020-01-08 225 } else if (!bpf_try_module_get(ca, ca->owner)) {
6670e152447732b Stephen Hemminger 2017-11-14 226 ret = -EBUSY;
6670e152447732b Stephen Hemminger 2017-11-14 227 } else {
6670e152447732b Stephen Hemminger 2017-11-14 @228 prev = xchg(&net->ipv4.tcp_congestion_control, ca);
6670e152447732b Stephen Hemminger 2017-11-14 229 if (prev)
0baf26b0fcd74bb Martin KaFai Lau 2020-01-08 230 bpf_module_put(prev, prev->owner);
317a76f9a44b437 Stephen Hemminger 2005-06-23 231
6670e152447732b Stephen Hemminger 2017-11-14 232 ca->flags |= TCP_CONG_NON_RESTRICTED;
317a76f9a44b437 Stephen Hemminger 2005-06-23 233 ret = 0;
317a76f9a44b437 Stephen Hemminger 2005-06-23 234 }
6670e152447732b Stephen Hemminger 2017-11-14 235 rcu_read_unlock();
317a76f9a44b437 Stephen Hemminger 2005-06-23 236
317a76f9a44b437 Stephen Hemminger 2005-06-23 237 return ret;
317a76f9a44b437 Stephen Hemminger 2005-06-23 238 }
317a76f9a44b437 Stephen Hemminger 2005-06-23 239
:::::: The code at line 228 was first introduced by commit
:::::: 6670e152447732ba90626f36dfc015a13fbf150e tcp: Namespace-ify sysctl_tcp_default_congestion_control
:::::: TO: Stephen Hemminger <stephen(a)networkplumber.org>
:::::: CC: David S. Miller <davem(a)davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[xlnx:master 133/137] drivers/misc/xilinx-ai-engine/ai-engine-dev.c:517:6: error: redefinition of 'aie_partition_is_available'
by kernel test robot
tree: https://github.com/Xilinx/linux-xlnx master
head: 566441779cdc25e377c2baab9277342b09b4249b
commit: 0687b131fdf966fe718891f1b6cf515fa8d395dd [133/137] misc: xilinx-ai-engine: Add function to enquire if a partition is available
config: alpha-allmodconfig (attached as .config)
compiler: alpha-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
git checkout 0687b131fdf966fe718891f1b6cf515fa8d395dd
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/misc/xilinx-ai-engine/ai-engine-dev.c:517:6: error: redefinition of 'aie_partition_is_available'
517 | bool aie_partition_is_available(struct aie_partition_req *req)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/misc/xilinx-ai-engine/ai-engine-dev.c:24:
include/linux/xlnx-ai-engine.h:24:20: note: previous definition of 'aie_partition_is_available' was here
24 | static inline bool aie_partition_is_available(struct aie_partition_req *req)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/xilinx-ai-engine/ai-engine-dev.c:554:16: error: redefinition of 'aie_partition_request'
554 | struct device *aie_partition_request(struct aie_partition_req *req)
| ^~~~~~~~~~~~~~~~~~~~~
In file included from drivers/misc/xilinx-ai-engine/ai-engine-dev.c:24:
include/linux/xlnx-ai-engine.h:30:1: note: previous definition of 'aie_partition_request' was here
30 | aie_partition_request(struct aie_partition_req *req)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/misc/xilinx-ai-engine/ai-engine-dev.c:588:5: error: redefinition of 'aie_partition_get_fd'
588 | int aie_partition_get_fd(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~
In file included from drivers/misc/xilinx-ai-engine/ai-engine-dev.c:24:
include/linux/xlnx-ai-engine.h:35:19: note: previous definition of 'aie_partition_get_fd' was here
35 | static inline int aie_partition_get_fd(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~
drivers/misc/xilinx-ai-engine/ai-engine-dev.c:612:6: error: redefinition of 'aie_partition_release'
612 | void aie_partition_release(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~
In file included from drivers/misc/xilinx-ai-engine/ai-engine-dev.c:24:
include/linux/xlnx-ai-engine.h:40:20: note: previous definition of 'aie_partition_release' was here
40 | static inline void aie_partition_release(struct device *dev) {}
| ^~~~~~~~~~~~~~~~~~~~~
vim +/aie_partition_is_available +517 drivers/misc/xilinx-ai-engine/ai-engine-dev.c
496
497 /**
498 * aie_partition_is_available() - Check if an AI engine partition is available
499 * @req: AI engine partition requesting arguments
500 * @return: true if the AI engine partition is not in use, otherwise, false
501 *
502 * This function looks up the AI engine class devices to find the AI engine
503 * partition whose partition ID matches the given partition ID in @req. If
504 * the partition can be found, if will check if the partition is in use.
505 *
506 * In case the AI engine release function is called from kernel context, the
507 * release() will be scheduled when the AI engine partition reference count is
508 * reduced to 0 instead of get called synchronously, and thus, this is a helper
509 * function for another kernel module to check if the partitions is released
510 * after calling release function from kernel context
511 *
512 * However, if closing the partition is from user context, it will not return
513 * until the release is complete when there is no reference to the AI engine
514 * partition file. In this case, user doesn't need to call this function to
515 * check if the partition is released.
516 */
> 517 bool aie_partition_is_available(struct aie_partition_req *req)
518 {
519 struct aie_partition *apart;
520 int ret;
521
522 if (!req)
523 return false;
524
525 apart = aie_class_find_partition_from_id(req->partition_id);
526 if (!apart)
527 return false;
528
529 ret = mutex_lock_interruptible(&apart->mlock);
530 if (ret)
531 return false;
532
533 if (apart->status & XAIE_PART_STATUS_INUSE) {
534 mutex_unlock(&apart->mlock);
535 return false;
536 }
537
538 mutex_unlock(&apart->mlock);
539 return true;
540 }
541 EXPORT_SYMBOL_GPL(aie_partition_is_available);
542
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[mlankhorst:locking-rework 30/31] ERROR: modpost: "stack_depot_fetch" undefined!
by kernel test robot
tree: git://people.freedesktop.org/~mlankhorst/linux locking-rework
head: acf91034f3b9d3272705e05fbc1a3836fbd0d9cf
commit: 8402858e024b71e954aafa5ac083ddd711080423 [30/31] drm/i915: Add freed object debugging by freeing synchronously.
config: x86_64-randconfig-a006-20200811 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
git checkout 8402858e024b71e954aafa5ac083ddd711080423
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> ERROR: modpost: "stack_depot_fetch" [drivers/gpu/drm/i915/i915.ko] undefined!
>> ERROR: modpost: "stack_depot_save" [drivers/gpu/drm/i915/i915.ko] undefined!
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[frank-w-bpi-r2-4.14:5.8-main 17/58] drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:191:6: error: no previous prototype for 'mtk_wcn_consys_power_on'
by kernel test robot
Hi Frank,
First bad commit (maybe != root cause):
tree: https://github.com/frank-w/BPI-R2-4.14 5.8-main
head: 3fc4f1d2748b72489057cd07d270b4a259880fb0
commit: 47ca5358d0035b974a89981e97432d30817566a8 [17/58] mt6625l: set MTK_PLATFORM in Makefile if none is set via *config
config: arm-randconfig-r026-20200811 (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
git checkout 47ca5358d0035b974a89981e97432d30817566a8
# 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(a)intel.com>
All errors (new ones prefixed by >>):
cc1: error: drivers/misc/mediatek/include/mt-plat/mt7623/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: drivers/misc/mediatek/include/mt-plat/mt7623/include/mach: No such file or directory [-Werror=missing-include-dirs]
>> drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:191:6: error: no previous prototype for 'mtk_wcn_consys_power_on' [-Werror=missing-prototypes]
191 | VOID mtk_wcn_consys_power_on(VOID)
| ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:207:6: error: no previous prototype for 'mtk_wcn_consys_power_off' [-Werror=missing-prototypes]
207 | VOID mtk_wcn_consys_power_off(VOID)
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:224:7: error: no previous prototype for 'mtk_wcn_consys_hw_reg_ctrl' [-Werror=missing-prototypes]
224 | INT32 mtk_wcn_consys_hw_reg_ctrl(UINT32 on, UINT32 co_clock_type)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:335:7: error: no previous prototype for 'mtk_wcn_consys_hw_gpio_ctrl' [-Werror=missing-prototypes]
335 | INT32 mtk_wcn_consys_hw_gpio_ctrl(UINT32 on)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:539:7: error: no previous prototype for 'mtk_wcn_consys_hw_restore' [-Werror=missing-prototypes]
539 | INT32 mtk_wcn_consys_hw_restore(struct device *device)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:592:5: error: no previous prototype for 'reserve_memory_consys_fn' [-Werror=missing-prototypes]
592 | int reserve_memory_consys_fn(struct reserved_mem *rmem)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c: In function 'mtk_wcn_consys_get_pinctrl':
>> drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:713:17: error: old-style function definition [-Werror=old-style-definition]
713 | struct pinctrl *mtk_wcn_consys_get_pinctrl()
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
--
cc1: error: drivers/misc/mediatek/include/mt-plat/mt7623/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: drivers/misc/mediatek/include/mt-plat/mt7623/include/mach: No such file or directory [-Werror=missing-include-dirs]
>> drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/wmt_plat_alps.c:255:13: error: no previous prototype for 'wmt_plat_bgf_irq_isr' [-Werror=missing-prototypes]
255 | irqreturn_t wmt_plat_bgf_irq_isr(INT32 i, VOID *arg)
| ^~~~~~~~~~~~~~~~~~~~
>> drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/wmt_plat_alps.c:296:8: error: no previous prototype for 'wmt_plat_soc_co_clock_flag_get' [-Werror=missing-prototypes]
296 | UINT32 wmt_plat_soc_co_clock_flag_get(VOID)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/wmt_plat_alps.c:39:
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/include/stp_dbg.h:61:20: error: 'gStpDbgType' defined but not used [-Werror=unused-const-variable=]
61 | static char *const gStpDbgType[] = {
| ^~~~~~~~~~~
cc1: all warnings being treated as errors
--
cc1: error: drivers/misc/mediatek/include/mt-plat/mt7623/include: No such file or directory [-Werror=missing-include-dirs]
>> cc1: error: drivers/misc/mediatek/mach/mt7623/include/mach: No such file or directory [-Werror=missing-include-dirs]
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_btif.c:191:7: error: no previous prototype for 'mtk_wcn_consys_stp_btif_rx' [-Werror=missing-prototypes]
191 | INT32 mtk_wcn_consys_stp_btif_rx(UINT8 *pBuf, UINT32 len)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
--
cc1: error: drivers/misc/mediatek/include/mt-plat/mt7623/include: No such file or directory [-Werror=missing-include-dirs]
>> cc1: error: drivers/misc/mediatek/mach/mt7623/include/mach: No such file or directory [-Werror=missing-include-dirs]
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c: In function 'wcn_wmtd_timeout_collect_ftrace':
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:456:8: error: variable 'len' set but not used [-Werror=unused-but-set-variable]
456 | INT32 len;
| ^~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:455:9: error: variable 'pbuf' set but not used [-Werror=unused-but-set-variable]
455 | PUINT8 pbuf;
| ^~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c: In function 'wcn_psm_flag_trigger_collect_ftrace':
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:474:8: error: variable 'len' set but not used [-Werror=unused-but-set-variable]
474 | INT32 len;
| ^~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:473:9: error: variable 'pbuf' set but not used [-Werror=unused-but-set-variable]
473 | PUINT8 pbuf;
| ^~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c: In function 'wcn_btif_rxd_blocked_collect_ftrace':
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:501:8: error: variable 'len' set but not used [-Werror=unused-but-set-variable]
501 | INT32 len;
| ^~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:500:9: error: variable 'pbuf' set but not used [-Werror=unused-but-set-variable]
500 | PUINT8 pbuf;
| ^~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c: In function 'wcn_core_dump_timeout':
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:520:8: error: variable 'len' set but not used [-Werror=unused-but-set-variable]
520 | INT32 len;
| ^~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:519:9: error: variable 'pbuf' set but not used [-Werror=unused-but-set-variable]
519 | PUINT8 pbuf;
| ^~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c: At top level:
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:1032:5: error: no previous prototype for 'stp_gdb_notify_btm_dmp_wq' [-Werror=missing-prototypes]
1032 | int stp_gdb_notify_btm_dmp_wq(MTKSTP_DBG_T *stp_dbg)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:1056:5: error: no previous prototype for 'stp_dbg_dmp_in' [-Werror=missing-prototypes]
1056 | int stp_dbg_dmp_in(MTKSTP_DBG_T *stp_dbg, char *buf, int len)
| ^~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c: In function 'stp_dbg_nl_bind':
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:1254:8: error: variable 'mydata' set but not used [-Werror=unused-but-set-variable]
1254 | char *mydata;
| ^~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c: At top level:
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:1346:8: error: no previous prototype for '_stp_dbg_id_to_task' [-Werror=missing-prototypes]
1346 | UINT8 *_stp_dbg_id_to_task(UINT32 id)
| ^~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:1362:7: error: no previous prototype for '_stp_dbg_parser_assert_str' [-Werror=missing-prototypes]
1362 | INT32 _stp_dbg_parser_assert_str(PINT8 str, ENUM_ASSERT_INFO_PARSER_TYPE type)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:1530:20: error: no previous prototype for 'stp_dbg_cpupcr_init' [-Werror=missing-prototypes]
1530 | P_STP_DBG_CPUPCR_T stp_dbg_cpupcr_init(VOID)
| ^~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:1547:21: error: no previous prototype for 'stp_dbg_dmaregs_init' [-Werror=missing-prototypes]
1547 | P_STP_DBG_DMAREGS_T stp_dbg_dmaregs_init(VOID)
| ^~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:1564:6: error: no previous prototype for 'stp_dbg_cpupcr_deinit' [-Werror=missing-prototypes]
1564 | VOID stp_dbg_cpupcr_deinit(P_STP_DBG_CPUPCR_T pCpupcr)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.c:1573:6: error: no previous prototype for 'stp_dbg_dmaregs_deinit' [-Werror=missing-prototypes]
1573 | VOID stp_dbg_dmaregs_deinit(P_STP_DBG_DMAREGS_T pDmaRegs)
| ^~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
--
cc1: error: drivers/misc/mediatek/include/mt-plat/mt7623/include: No such file or directory [-Werror=missing-include-dirs]
>> cc1: error: drivers/misc/mediatek/mach/mt7623/include/mach: No such file or directory [-Werror=missing-include-dirs]
cc1: all warnings being treated as errors
--
cc1: error: drivers/misc/mediatek/include/mt-plat/mt7623/include: No such file or directory [-Werror=missing-include-dirs]
>> cc1: error: drivers/misc/mediatek/mach/mt7623/include/mach: No such file or directory [-Werror=missing-include-dirs]
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1289:7: error: no previous prototype for 'wmt_dev_dbg_setup' [-Werror=missing-prototypes]
1289 | INT32 wmt_dev_dbg_setup(VOID)
| ^~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1303:7: error: no previous prototype for 'wmt_dev_dbg_remove' [-Werror=missing-prototypes]
1303 | INT32 wmt_dev_dbg_remove(VOID)
| ^~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1374:7: error: no previous prototype for 'wmt_dev_proc_for_aee_setup' [-Werror=missing-prototypes]
1374 | INT32 wmt_dev_proc_for_aee_setup(VOID)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1390:7: error: no previous prototype for 'wmt_dev_proc_for_aee_remove' [-Werror=missing-prototypes]
1390 | INT32 wmt_dev_proc_for_aee_remove(VOID)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1435:7: error: no previous prototype for 'wmt_dev_read_file' [-Werror=missing-prototypes]
1435 | INT32 wmt_dev_read_file(PUINT8 pName, const PPUINT8 ppBufPtr, INT32 offset, INT32 padSzBuf)
| ^~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1597:14: error: no previous prototype for 'wmt_dev_is_file_exist' [-Werror=missing-prototypes]
1597 | MTK_WCN_BOOL wmt_dev_is_file_exist(PUINT8 pFileName)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1645:14: error: no previous prototype for 'wmt_dev_tra_bitf_update' [-Werror=missing-prototypes]
1645 | extern INT32 wmt_dev_tra_bitf_update(void)
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1703:6: error: no previous prototype for 'wmt_dev_tm_temp_query' [-Werror=missing-prototypes]
1703 | long wmt_dev_tm_temp_query(void)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1801:9: error: no previous prototype for 'WMT_write' [-Werror=missing-prototypes]
1801 | ssize_t WMT_write(struct file *filp, const char __user *buf, size_t count, loff_t *f_pos)
| ^~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1834:9: error: no previous prototype for 'WMT_read' [-Werror=missing-prototypes]
1834 | ssize_t WMT_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
| ^~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1865:14: error: no previous prototype for 'WMT_poll' [-Werror=missing-prototypes]
1865 | unsigned int WMT_poll(struct file *filp, poll_table *wait)
| ^~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1885:6: error: no previous prototype for 'WMT_unlocked_ioctl' [-Werror=missing-prototypes]
1885 | long WMT_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
| ^~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c: In function 'WMT_unlocked_ioctl':
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1985:11: error: variable 'u4Wait' set but not used [-Werror=unused-but-set-variable]
1985 | UINT32 u4Wait;
| ^~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:2154:21: error: variable 'pTemp' set but not used [-Werror=unused-but-set-variable]
2154 | P_WMT_PATCH_INFO pTemp = NULL;
| ^~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c: At top level:
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:2368:6: error: no previous prototype for 'wmt_dev_bgw_desense_init' [-Werror=missing-prototypes]
2368 | void wmt_dev_bgw_desense_init(VOID)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:2373:6: error: no previous prototype for 'wmt_dev_bgw_desense_deinit' [-Werror=missing-prototypes]
2373 | void wmt_dev_bgw_desense_deinit(VOID)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:2544:5: error: no previous prototype for 'mtk_wcn_soc_common_drv_init' [-Werror=missing-prototypes]
2544 | int mtk_wcn_soc_common_drv_init(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:2550:6: error: no previous prototype for 'mtk_wcn_soc_common_drv_exit' [-Werror=missing-prototypes]
2550 | void mtk_wcn_soc_common_drv_exit(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
--
cc1: error: drivers/misc/mediatek/include/mt-plat/mt7623/include: No such file or directory [-Werror=missing-include-dirs]
>> cc1: error: drivers/misc/mediatek/mach/mt7623/include/mach: No such file or directory [-Werror=missing-include-dirs]
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_exp.c:131:14: error: no previous prototype for '_mtk_wcn_wmt_func_off' [-Werror=missing-prototypes]
131 | MTK_WCN_BOOL _mtk_wcn_wmt_func_off(ENUM_WMTDRV_TYPE_T type)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_exp.c:153:14: error: no previous prototype for '_mtk_wcn_wmt_func_on' [-Werror=missing-prototypes]
153 | MTK_WCN_BOOL _mtk_wcn_wmt_func_on(ENUM_WMTDRV_TYPE_T type)
| ^~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_exp.c:189:6: error: no previous prototype for '_mtk_wcn_wmt_therm_ctrl' [-Werror=missing-prototypes]
189 | INT8 _mtk_wcn_wmt_therm_ctrl(ENUM_WMTTHERM_TYPE_T eType)
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_exp.c:254:22: error: no previous prototype for '_mtk_wcn_wmt_hwver_get' [-Werror=missing-prototypes]
254 | ENUM_WMTHWVER_TYPE_T _mtk_wcn_wmt_hwver_get(VOID)
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_exp.c:269:14: error: no previous prototype for '_mtk_wcn_wmt_dsns_ctrl' [-Werror=missing-prototypes]
269 | MTK_WCN_BOOL _mtk_wcn_wmt_dsns_ctrl(ENUM_WMTDSNS_TYPE_T eType)
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_exp.c:330:7: error: no previous prototype for '_mtk_wcn_wmt_msgcb_reg' [-Werror=missing-prototypes]
330 | INT32 _mtk_wcn_wmt_msgcb_reg(ENUM_WMTDRV_TYPE_T eType, PF_WMT_CB pCb)
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_exp.c:342:7: error: no previous prototype for '_mtk_wcn_wmt_msgcb_unreg' [-Werror=missing-prototypes]
342 | INT32 _mtk_wcn_wmt_msgcb_unreg(ENUM_WMTDRV_TYPE_T eType)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_exp.c:354:7: error: no previous prototype for '_mtk_wcn_stp_wmt_sdio_op_reg' [-Werror=missing-prototypes]
354 | INT32 _mtk_wcn_stp_wmt_sdio_op_reg(PF_WMT_SDIO_PSOP own_cb)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_exp.c:367:7: error: no previous prototype for '_mtk_wcn_stp_wmt_sdio_host_awake' [-Werror=missing-prototypes]
367 | INT32 _mtk_wcn_stp_wmt_sdio_host_awake(VOID)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_exp.c:380:14: error: no previous prototype for '_mtk_wcn_wmt_assert' [-Werror=missing-prototypes]
380 | MTK_WCN_BOOL _mtk_wcn_wmt_assert(ENUM_WMTDRV_TYPE_T type, UINT32 reason)
| ^~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_exp.c:608:6: error: no previous prototype for 'mtk_wcn_wmt_set_wifi_ver' [-Werror=missing-prototypes]
608 | VOID mtk_wcn_wmt_set_wifi_ver(UINT32 Value)
| ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/mtk_wcn_consys_power_on +191 drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c
1d4087fef69d21 Frank Wunderlich 2020-06-15 190
1d4087fef69d21 Frank Wunderlich 2020-06-15 @191 VOID mtk_wcn_consys_power_on(VOID)
1d4087fef69d21 Frank Wunderlich 2020-06-15 192 {
1d4087fef69d21 Frank Wunderlich 2020-06-15 193 INT32 iRet = -1;
1d4087fef69d21 Frank Wunderlich 2020-06-15 194 iRet = pm_runtime_get_sync(&my_pdev->dev);
1d4087fef69d21 Frank Wunderlich 2020-06-15 195 if (iRet)
1d4087fef69d21 Frank Wunderlich 2020-06-15 196 WMT_PLAT_ERR_FUNC("pm_runtime_get_sync() fail(%d)\n", iRet);
1d4087fef69d21 Frank Wunderlich 2020-06-15 197 else
1d4087fef69d21 Frank Wunderlich 2020-06-15 198 WMT_PLAT_INFO_FUNC("pm_runtime_get_sync() CONSYS ok\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 199
1d4087fef69d21 Frank Wunderlich 2020-06-15 200 iRet = device_init_wakeup(&my_pdev->dev, true);
1d4087fef69d21 Frank Wunderlich 2020-06-15 201 if (iRet)
1d4087fef69d21 Frank Wunderlich 2020-06-15 202 WMT_PLAT_ERR_FUNC("device_init_wakeup(true) fail.\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 203 else
1d4087fef69d21 Frank Wunderlich 2020-06-15 204 WMT_PLAT_INFO_FUNC("device_init_wakeup(true) CONSYS ok\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 205 }
1d4087fef69d21 Frank Wunderlich 2020-06-15 206
1d4087fef69d21 Frank Wunderlich 2020-06-15 @207 VOID mtk_wcn_consys_power_off(VOID)
1d4087fef69d21 Frank Wunderlich 2020-06-15 208 {
1d4087fef69d21 Frank Wunderlich 2020-06-15 209 INT32 iRet = -1;
1d4087fef69d21 Frank Wunderlich 2020-06-15 210
1d4087fef69d21 Frank Wunderlich 2020-06-15 211 iRet = pm_runtime_put_sync(&my_pdev->dev);
1d4087fef69d21 Frank Wunderlich 2020-06-15 212 if (iRet)
1d4087fef69d21 Frank Wunderlich 2020-06-15 213 WMT_PLAT_ERR_FUNC("pm_runtime_put_sync() fail.\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 214 else
1d4087fef69d21 Frank Wunderlich 2020-06-15 215 WMT_PLAT_INFO_FUNC("pm_runtime_put_sync() CONSYS ok\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 216
1d4087fef69d21 Frank Wunderlich 2020-06-15 217 iRet = device_init_wakeup(&my_pdev->dev, false);
1d4087fef69d21 Frank Wunderlich 2020-06-15 218 if (iRet)
1d4087fef69d21 Frank Wunderlich 2020-06-15 219 WMT_PLAT_ERR_FUNC("device_init_wakeup(false) fail.\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 220 else
1d4087fef69d21 Frank Wunderlich 2020-06-15 221 WMT_PLAT_INFO_FUNC("device_init_wakeup(false) CONSYS ok\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 222 }
1d4087fef69d21 Frank Wunderlich 2020-06-15 223
1d4087fef69d21 Frank Wunderlich 2020-06-15 @224 INT32 mtk_wcn_consys_hw_reg_ctrl(UINT32 on, UINT32 co_clock_type)
1d4087fef69d21 Frank Wunderlich 2020-06-15 225 {
1d4087fef69d21 Frank Wunderlich 2020-06-15 226 UINT32 retry = 10;
1d4087fef69d21 Frank Wunderlich 2020-06-15 227 UINT32 consysHwChipId = 0;
1d4087fef69d21 Frank Wunderlich 2020-06-15 228
1d4087fef69d21 Frank Wunderlich 2020-06-15 229 WMT_PLAT_DBG_FUNC("CONSYS-HW-REG-CTRL(0x%08x),start\n", on);
1d4087fef69d21 Frank Wunderlich 2020-06-15 230 if (on) {
1d4087fef69d21 Frank Wunderlich 2020-06-15 231 WMT_PLAT_DBG_FUNC("++\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 232 /*need PMIC driver provide new API protocol */
1d4087fef69d21 Frank Wunderlich 2020-06-15 233 /*1.AP power on VCN_1V8 LDO (with PMIC_WRAP API) VCN_1V8 */
1d4087fef69d21 Frank Wunderlich 2020-06-15 234 regulator_set_mode(reg_VCN18, REGULATOR_MODE_STANDBY);
1d4087fef69d21 Frank Wunderlich 2020-06-15 235 /* VOL_DEFAULT, VOL_1200, VOL_1300, VOL_1500, VOL_1800... */
1d4087fef69d21 Frank Wunderlich 2020-06-15 236 if (reg_VCN18) {
1d4087fef69d21 Frank Wunderlich 2020-06-15 237 regulator_set_voltage(reg_VCN18, 1800000, 1800000);
1d4087fef69d21 Frank Wunderlich 2020-06-15 238 if (regulator_enable(reg_VCN18))
1d4087fef69d21 Frank Wunderlich 2020-06-15 239 WMT_PLAT_ERR_FUNC("enable VCN18 fail\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 240 else
1d4087fef69d21 Frank Wunderlich 2020-06-15 241 WMT_PLAT_DBG_FUNC("enable VCN18 ok\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 242 }
1d4087fef69d21 Frank Wunderlich 2020-06-15 243 udelay(150);
1d4087fef69d21 Frank Wunderlich 2020-06-15 244 if (co_clock_type) {
1d4087fef69d21 Frank Wunderlich 2020-06-15 245 /*step0,clk buf ctrl */
1d4087fef69d21 Frank Wunderlich 2020-06-15 246 WMT_PLAT_INFO_FUNC("co clock type(%d),turn on clk buf\n", co_clock_type);
1d4087fef69d21 Frank Wunderlich 2020-06-15 247 #if CONSYS_CLOCK_BUF_CTRL
1d4087fef69d21 Frank Wunderlich 2020-06-15 248 clk_buf_ctrl(CLK_BUF_CONN, 1);
1d4087fef69d21 Frank Wunderlich 2020-06-15 249 #endif
1d4087fef69d21 Frank Wunderlich 2020-06-15 250 /*if co-clock mode: */
1d4087fef69d21 Frank Wunderlich 2020-06-15 251 /*2.set VCN28 to SW control mode (with PMIC_WRAP API) */
1d4087fef69d21 Frank Wunderlich 2020-06-15 252 /*turn on VCN28 LDO only when FMSYS is activated" */
1d4087fef69d21 Frank Wunderlich 2020-06-15 253 regmap_update_bits(pmic_regmap, 0x41C, 0x1 << 14, 0x0 << 14);/*V28*/
1d4087fef69d21 Frank Wunderlich 2020-06-15 254 } else {
1d4087fef69d21 Frank Wunderlich 2020-06-15 255 /*if NOT co-clock: */
1d4087fef69d21 Frank Wunderlich 2020-06-15 256 /*2.1.switch VCN28 to HW control mode (with PMIC_WRAP API) */
1d4087fef69d21 Frank Wunderlich 2020-06-15 257 regmap_update_bits(pmic_regmap, 0x41C, 0x1 << 14, 0x1 << 14);/*V28*/
1d4087fef69d21 Frank Wunderlich 2020-06-15 258 /*2.2.turn on VCN28 LDO (with PMIC_WRAP API)" */
1d4087fef69d21 Frank Wunderlich 2020-06-15 259 /*fix vcn28 not balance warning */
1d4087fef69d21 Frank Wunderlich 2020-06-15 260 if (reg_VCN28) {
1d4087fef69d21 Frank Wunderlich 2020-06-15 261 regulator_set_voltage(reg_VCN28, 2800000, 2800000);
1d4087fef69d21 Frank Wunderlich 2020-06-15 262 if (regulator_enable(reg_VCN28))
1d4087fef69d21 Frank Wunderlich 2020-06-15 263 WMT_PLAT_ERR_FUNC("enable VCN_2V8 fail!\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 264 else
1d4087fef69d21 Frank Wunderlich 2020-06-15 265 WMT_PLAT_DBG_FUNC("enable VCN_2V8 ok\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 266 }
1d4087fef69d21 Frank Wunderlich 2020-06-15 267 }
1d4087fef69d21 Frank Wunderlich 2020-06-15 268
1d4087fef69d21 Frank Wunderlich 2020-06-15 269 /*3.assert CONNSYS CPU SW reset 0x10007018 "[12]=1'b1 [31:24]=8'h88 (key)" */
1d4087fef69d21 Frank Wunderlich 2020-06-15 270 reset_control_reset(rstc);
1d4087fef69d21 Frank Wunderlich 2020-06-15 271 mtk_wcn_consys_power_on();
1d4087fef69d21 Frank Wunderlich 2020-06-15 272 /*11.26M is ready now, delay 10us for mem_pd de-assert */
1d4087fef69d21 Frank Wunderlich 2020-06-15 273 udelay(10);
1d4087fef69d21 Frank Wunderlich 2020-06-15 274 /*enable AP bus clock : connmcu_bus_pd API: enable_clock() ++?? */
1d4087fef69d21 Frank Wunderlich 2020-06-15 275 clk_prepare_enable(clk_infra_conn_main);
1d4087fef69d21 Frank Wunderlich 2020-06-15 276 WMT_PLAT_DBG_FUNC("[CCF]enable clk_infra_conn_main\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 277 /*12.poll CONNSYS CHIP ID until chipid is returned 0x18070008 */
1d4087fef69d21 Frank Wunderlich 2020-06-15 278 while (retry-- > 0) {
1d4087fef69d21 Frank Wunderlich 2020-06-15 279 consysHwChipId = CONSYS_REG_READ(conn_reg.mcu_base + CONSYS_CHIP_ID_OFFSET) - 0xf6d;
1d4087fef69d21 Frank Wunderlich 2020-06-15 280
1d4087fef69d21 Frank Wunderlich 2020-06-15 281 if ((consysHwChipId == 0x0321) || (consysHwChipId == 0x0335) || (consysHwChipId == 0x0337)) {
1d4087fef69d21 Frank Wunderlich 2020-06-15 282 WMT_PLAT_INFO_FUNC("retry(%d)consys chipId(0x%08x)\n", retry, consysHwChipId);
1d4087fef69d21 Frank Wunderlich 2020-06-15 283 break;
1d4087fef69d21 Frank Wunderlich 2020-06-15 284 }
1d4087fef69d21 Frank Wunderlich 2020-06-15 285 if ((consysHwChipId == 0x8163) || (consysHwChipId == 0x8127) || (consysHwChipId == 0x7623)) {
1d4087fef69d21 Frank Wunderlich 2020-06-15 286 WMT_PLAT_INFO_FUNC("retry(%d)consys chipId(0x%08x)\n", retry, consysHwChipId);
1d4087fef69d21 Frank Wunderlich 2020-06-15 287 break;
1d4087fef69d21 Frank Wunderlich 2020-06-15 288 }
1d4087fef69d21 Frank Wunderlich 2020-06-15 289
1d4087fef69d21 Frank Wunderlich 2020-06-15 290 WMT_PLAT_ERR_FUNC("Read CONSYS chipId(0x%08x)", consysHwChipId);
1d4087fef69d21 Frank Wunderlich 2020-06-15 291 msleep(20);
1d4087fef69d21 Frank Wunderlich 2020-06-15 292 }
1d4087fef69d21 Frank Wunderlich 2020-06-15 293
1d4087fef69d21 Frank Wunderlich 2020-06-15 294 if ((0 == retry) || (0 == consysHwChipId))
1d4087fef69d21 Frank Wunderlich 2020-06-15 295 WMT_PLAT_ERR_FUNC("Maybe has a consys power on issue,(0x%08x)\n", consysHwChipId);
1d4087fef69d21 Frank Wunderlich 2020-06-15 296
1d4087fef69d21 Frank Wunderlich 2020-06-15 297 msleep(40);
1d4087fef69d21 Frank Wunderlich 2020-06-15 298
1d4087fef69d21 Frank Wunderlich 2020-06-15 299 } else {
1d4087fef69d21 Frank Wunderlich 2020-06-15 300
1d4087fef69d21 Frank Wunderlich 2020-06-15 301 clk_disable_unprepare(clk_infra_conn_main);
1d4087fef69d21 Frank Wunderlich 2020-06-15 302 WMT_PLAT_DBG_FUNC("[CCF] clk_disable_unprepare(clk_infra_conn_main) calling\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 303 mtk_wcn_consys_power_off();
1d4087fef69d21 Frank Wunderlich 2020-06-15 304
1d4087fef69d21 Frank Wunderlich 2020-06-15 305 if (co_clock_type) {
1d4087fef69d21 Frank Wunderlich 2020-06-15 306 /*VCN28 has been turned off by GPS OR FM */
1d4087fef69d21 Frank Wunderlich 2020-06-15 307 #if CONSYS_CLOCK_BUF_CTRL
1d4087fef69d21 Frank Wunderlich 2020-06-15 308 clk_buf_ctrl(CLK_BUF_CONN, 0);
1d4087fef69d21 Frank Wunderlich 2020-06-15 309 #endif
1d4087fef69d21 Frank Wunderlich 2020-06-15 310 } else {
1d4087fef69d21 Frank Wunderlich 2020-06-15 311 regmap_update_bits(pmic_regmap, 0x41C, 0x1 << 14, 0x0 << 14);/*V28*/
1d4087fef69d21 Frank Wunderlich 2020-06-15 312 /*turn off VCN28 LDO (with PMIC_WRAP API)" */
1d4087fef69d21 Frank Wunderlich 2020-06-15 313 if (reg_VCN28) {
1d4087fef69d21 Frank Wunderlich 2020-06-15 314 if (regulator_disable(reg_VCN28))
1d4087fef69d21 Frank Wunderlich 2020-06-15 315 WMT_PLAT_ERR_FUNC("disable VCN_2V8 fail!\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 316 else
1d4087fef69d21 Frank Wunderlich 2020-06-15 317 WMT_PLAT_DBG_FUNC("disable VCN_2V8 ok\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 318 }
1d4087fef69d21 Frank Wunderlich 2020-06-15 319 }
1d4087fef69d21 Frank Wunderlich 2020-06-15 320
1d4087fef69d21 Frank Wunderlich 2020-06-15 321 /*AP power off MT6625L VCN_1V8 LDO */
1d4087fef69d21 Frank Wunderlich 2020-06-15 322 regulator_set_mode(reg_VCN18, REGULATOR_MODE_STANDBY);
1d4087fef69d21 Frank Wunderlich 2020-06-15 323 if (reg_VCN18) {
1d4087fef69d21 Frank Wunderlich 2020-06-15 324 if (regulator_disable(reg_VCN18))
1d4087fef69d21 Frank Wunderlich 2020-06-15 325 WMT_PLAT_ERR_FUNC("disable VCN_1V8 fail!\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 326 else
1d4087fef69d21 Frank Wunderlich 2020-06-15 327 WMT_PLAT_DBG_FUNC("disable VCN_1V8 ok\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 328 }
1d4087fef69d21 Frank Wunderlich 2020-06-15 329
1d4087fef69d21 Frank Wunderlich 2020-06-15 330 }
1d4087fef69d21 Frank Wunderlich 2020-06-15 331 WMT_PLAT_DBG_FUNC("CONSYS-HW-REG-CTRL(0x%08x),finish\n", on);
1d4087fef69d21 Frank Wunderlich 2020-06-15 332 return 0;
1d4087fef69d21 Frank Wunderlich 2020-06-15 333 }
1d4087fef69d21 Frank Wunderlich 2020-06-15 334
1d4087fef69d21 Frank Wunderlich 2020-06-15 @335 INT32 mtk_wcn_consys_hw_gpio_ctrl(UINT32 on)
1d4087fef69d21 Frank Wunderlich 2020-06-15 336 {
1d4087fef69d21 Frank Wunderlich 2020-06-15 337 INT32 iRet = 0;
1d4087fef69d21 Frank Wunderlich 2020-06-15 338
1d4087fef69d21 Frank Wunderlich 2020-06-15 339 WMT_PLAT_DBG_FUNC("CONSYS-HW-GPIO-CTRL(0x%08x), start\n", on);
1d4087fef69d21 Frank Wunderlich 2020-06-15 340
1d4087fef69d21 Frank Wunderlich 2020-06-15 341 if (on) {
1d4087fef69d21 Frank Wunderlich 2020-06-15 342
1d4087fef69d21 Frank Wunderlich 2020-06-15 343 /* TODO: [FixMe][GeorgeKuo] double check if BGF_INT is implemented ok */
1d4087fef69d21 Frank Wunderlich 2020-06-15 344 /* iRet += wmt_plat_gpio_ctrl(PIN_BGF_EINT, PIN_STA_MUX); */
1d4087fef69d21 Frank Wunderlich 2020-06-15 345 iRet += wmt_plat_eirq_ctrl(PIN_BGF_EINT, PIN_STA_INIT);
1d4087fef69d21 Frank Wunderlich 2020-06-15 346 iRet += wmt_plat_eirq_ctrl(PIN_BGF_EINT, PIN_STA_EINT_DIS);
1d4087fef69d21 Frank Wunderlich 2020-06-15 347 WMT_PLAT_DBG_FUNC("CONSYS-HW, BGF IRQ registered and disabled\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 348
1d4087fef69d21 Frank Wunderlich 2020-06-15 349 } else {
1d4087fef69d21 Frank Wunderlich 2020-06-15 350
1d4087fef69d21 Frank Wunderlich 2020-06-15 351 /* set bgf eint/all eint to deinit state, namely input low state */
1d4087fef69d21 Frank Wunderlich 2020-06-15 352 iRet += wmt_plat_eirq_ctrl(PIN_BGF_EINT, PIN_STA_EINT_DIS);
1d4087fef69d21 Frank Wunderlich 2020-06-15 353 iRet += wmt_plat_eirq_ctrl(PIN_BGF_EINT, PIN_STA_DEINIT);
1d4087fef69d21 Frank Wunderlich 2020-06-15 354 WMT_PLAT_DBG_FUNC("CONSYS-HW, BGF IRQ unregistered and disabled\n");
1d4087fef69d21 Frank Wunderlich 2020-06-15 355 /* iRet += wmt_plat_gpio_ctrl(PIN_BGF_EINT, PIN_STA_DEINIT); */
1d4087fef69d21 Frank Wunderlich 2020-06-15 356 }
1d4087fef69d21 Frank Wunderlich 2020-06-15 357 WMT_PLAT_DBG_FUNC("CONSYS-HW-GPIO-CTRL(0x%08x), finish\n", on);
1d4087fef69d21 Frank Wunderlich 2020-06-15 358 return iRet;
1d4087fef69d21 Frank Wunderlich 2020-06-15 359
:::::: The code at line 191 was first introduced by commit
:::::: 1d4087fef69d21eeb0bdb3f34b978298f6609d91 mt6625l: add driver-folder from 5.7
:::::: TO: Frank Wunderlich <frank-w(a)public-files.de>
:::::: CC: Frank Wunderlich <linux(a)fw-web.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
sound/soc/codecs/max98373-sdw.c:325:4: warning: Variable 'i' is reassigned a value before the old one has been used.
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 086ba2ec163b638abd2a90ef3e8bab0238d02e56
commit: 56a5b7910e965c6905d112ce94fd9a9f5561f326 ASoC: codecs: max98373: add SoundWire support
date: 5 weeks ago
compiler: mipsel-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck warnings: (new ones prefixed by >>)
>> sound/soc/codecs/max98373-sdw.c:325:4: warning: Variable 'i' is reassigned a value before the old one has been used. [redundantAssignment]
i = 0;
^
sound/soc/codecs/max98373-sdw.c:313:4: note: Variable 'i' is reassigned a value before the old one has been used.
i++;
^
sound/soc/codecs/max98373-sdw.c:325:4: note: Variable 'i' is reassigned a value before the old one has been used.
i = 0;
^
sound/soc/codecs/max98373-sdw.c:344:9: warning: Variable 'i' is reassigned a value before the old one has been used. [redundantAssignment]
for (i = 0; i < num_of_ports; i++)
^
sound/soc/codecs/max98373-sdw.c:333:4: note: Variable 'i' is reassigned a value before the old one has been used.
i++;
^
sound/soc/codecs/max98373-sdw.c:344:9: note: Variable 'i' is reassigned a value before the old one has been used.
for (i = 0; i < num_of_ports; i++)
^
vim +/i +325 sound/soc/codecs/max98373-sdw.c
281
282 static int max98373_read_prop(struct sdw_slave *slave)
283 {
284 struct sdw_slave_prop *prop = &slave->prop;
285 int nval, i, num_of_ports;
286 u32 bit;
287 unsigned long addr;
288 struct sdw_dpn_prop *dpn;
289
290 /* BITMAP: 00001000 Dataport 3 is active */
291 prop->source_ports = BIT(3);
292 /* BITMAP: 00000010 Dataport 1 is active */
293 prop->sink_ports = BIT(1);
294 prop->paging_support = true;
295 prop->clk_stop_timeout = 20;
296
297 nval = hweight32(prop->source_ports);
298 num_of_ports = nval;
299 prop->src_dpn_prop = devm_kcalloc(&slave->dev, nval,
300 sizeof(*prop->src_dpn_prop),
301 GFP_KERNEL);
302 if (!prop->src_dpn_prop)
303 return -ENOMEM;
304
305 i = 0;
306 dpn = prop->src_dpn_prop;
307 addr = prop->source_ports;
308 for_each_set_bit(bit, &addr, 32) {
309 dpn[i].num = bit;
310 dpn[i].type = SDW_DPN_FULL;
311 dpn[i].simple_ch_prep_sm = true;
312 dpn[i].ch_prep_timeout = 10;
313 i++;
314 }
315
316 /* do this again for sink now */
317 nval = hweight32(prop->sink_ports);
318 num_of_ports += nval;
319 prop->sink_dpn_prop = devm_kcalloc(&slave->dev, nval,
320 sizeof(*prop->sink_dpn_prop),
321 GFP_KERNEL);
322 if (!prop->sink_dpn_prop)
323 return -ENOMEM;
324
> 325 i = 0;
326 dpn = prop->sink_dpn_prop;
327 addr = prop->sink_ports;
328 for_each_set_bit(bit, &addr, 32) {
329 dpn[i].num = bit;
330 dpn[i].type = SDW_DPN_FULL;
331 dpn[i].simple_ch_prep_sm = true;
332 dpn[i].ch_prep_timeout = 10;
333 i++;
334 }
335
336 /* Allocate port_ready based on num_of_ports */
337 slave->port_ready = devm_kcalloc(&slave->dev, num_of_ports,
338 sizeof(*slave->port_ready),
339 GFP_KERNEL);
340 if (!slave->port_ready)
341 return -ENOMEM;
342
343 /* Initialize completion */
344 for (i = 0; i < num_of_ports; i++)
345 init_completion(&slave->port_ready[i]);
346
347 /* set the timeout values */
348 prop->clk_stop_timeout = 20;
349
350 return 0;
351 }
352
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[omap-audio:peter/ti-linux-5.4.y/wip 3077/8798] drivers/pci/endpoint/functions/pci-epf-ntb.c:296:18: warning: variable 'epc' set but not used
by kernel test robot
Hi Kishon,
FYI, the error/warning still remains.
tree: https://github.com/omap-audio/linux-audio peter/ti-linux-5.4.y/wip
head: b4f85091e9145f08540a95ccfc77702508dc77b2
commit: e931ab2e52fa70488b568ee9e88873206e3b1118 [3077/8798] PCI: endpoint: Add EP function driver to provide NTB functionality
config: s390-randconfig-r002-20200811 (attached as .config)
compiler: s390-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
git checkout e931ab2e52fa70488b568ee9e88873206e3b1118
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/pci/endpoint/functions/pci-epf-ntb.c: In function 'epf_ntb_peer_spad_bar_set':
>> drivers/pci/endpoint/functions/pci-epf-ntb.c:296:18: warning: variable 'epc' set but not used [-Wunused-but-set-variable]
296 | struct pci_epc *epc;
| ^~~
drivers/pci/endpoint/functions/pci-epf-ntb.c: In function 'epf_ntb_config_spad_bar_alloc_interface':
drivers/pci/endpoint/functions/pci-epf-ntb.c:403:18: warning: variable 'epc' set but not used [-Wunused-but-set-variable]
403 | struct pci_epc *epc;
| ^~~
>> drivers/pci/endpoint/functions/pci-epf-ntb.c:398:17: warning: variable 'peer_barno' set but not used [-Wunused-but-set-variable]
398 | enum pci_barno peer_barno;
| ^~~~~~~~~~
vim +/epc +296 drivers/pci/endpoint/functions/pci-epf-ntb.c
284
285 static int
286 epf_ntb_peer_spad_bar_set(struct epf_ntb *ntb, enum pci_epc_interface_type type)
287 {
288 struct epf_ntb_epc *peer_ntb_epc;
289 struct pci_epf_bar *peer_epf_bar;
290 struct epf_ntb_epc *ntb_epc;
291 struct pci_epf_bar *epf_bar;
292 enum pci_barno peer_barno;
293 u32 peer_spad_offset;
294 enum pci_barno barno;
295 u8 vfunc_no, func_no;
> 296 struct pci_epc *epc;
297 struct device *dev;
298 int ret;
299
300 dev = &ntb->epf->dev;
301
302 peer_ntb_epc = ntb->epc[!type];
303 peer_barno = peer_ntb_epc->epf_ntb_bar[BAR_CONFIG];
304 peer_epf_bar = &peer_ntb_epc->epf_bar[peer_barno];
305
306 ntb_epc = ntb->epc[type];
307 barno = ntb_epc->epf_ntb_bar[BAR_PEER_SPAD];
308 epf_bar = &ntb_epc->epf_bar[barno];
309 func_no = ntb_epc->func_no;
310 vfunc_no = ntb_epc->vfunc_no;
311 epc = ntb_epc->epc;
312
313 peer_spad_offset = peer_ntb_epc->reg->spad_offset;
314 epf_bar->phys_addr = peer_epf_bar->phys_addr + peer_spad_offset;
315 epf_bar->size = peer_ntb_epc->spad_size;
316 epf_bar->barno = barno;
317 epf_bar->flags = PCI_BASE_ADDRESS_MEM_TYPE_32;
318
319 ret = pci_epc_set_bar(ntb_epc->epc, func_no, vfunc_no, epf_bar);
320 if (ret) {
321 dev_err(dev, "%s intf: peer SPAD BAR set failed\n",
322 pci_epc_interface_string(type));
323 return ret;
324 }
325
326 return 0;
327 }
328
329 static void epf_ntb_config_sspad_bar_clear(struct epf_ntb_epc *ntb_epc)
330 {
331 struct pci_epf_bar *epf_bar;
332 u8 vfunc_no, func_no;
333 enum pci_barno barno;
334 struct pci_epc *epc;
335
336 epc = ntb_epc->epc;
337 func_no = ntb_epc->func_no;
338 vfunc_no = ntb_epc->vfunc_no;
339 barno = ntb_epc->epf_ntb_bar[BAR_CONFIG];
340 epf_bar = &ntb_epc->epf_bar[barno];
341 pci_epc_clear_bar(epc, func_no, vfunc_no, epf_bar);
342 }
343
344 static int epf_ntb_config_sspad_bar_set(struct epf_ntb_epc *ntb_epc)
345 {
346 struct pci_epf_bar *epf_bar;
347 enum pci_barno barno;
348 u8 vfunc_no, func_no;
349 struct epf_ntb *ntb;
350 struct pci_epc *epc;
351 struct device *dev;
352 int ret;
353
354 ntb = ntb_epc->epf_ntb;
355 dev = &ntb->epf->dev;
356
357 epc = ntb_epc->epc;
358 func_no = ntb_epc->func_no;
359 vfunc_no = ntb_epc->vfunc_no;
360 barno = ntb_epc->epf_ntb_bar[BAR_CONFIG];
361 epf_bar = &ntb_epc->epf_bar[barno];
362
363 ret = pci_epc_set_bar(epc, func_no, vfunc_no, epf_bar);
364 if (ret) {
365 dev_err(dev, "%s inft: Config/Status/SPAD BAR set failed\n",
366 pci_epc_interface_string(ntb_epc->type));
367 return ret;
368 }
369
370 return 0;
371 }
372
373 static void epf_ntb_config_spad_bar_free(struct epf_ntb *ntb)
374 {
375 enum pci_epc_interface_type type;
376 struct epf_ntb_epc *ntb_epc;
377 enum pci_barno barno;
378 struct pci_epf *epf;
379
380 epf = ntb->epf;
381 for (type = PRIMARY_INTERFACE; type <= SECONDARY_INTERFACE; type++) {
382 ntb_epc = ntb->epc[type];
383 barno = ntb_epc->epf_ntb_bar[BAR_CONFIG];
384 if (ntb_epc->reg)
385 pci_epf_free_space(epf, ntb_epc->reg, barno, type);
386 }
387 }
388
389 static int
390 epf_ntb_config_spad_bar_alloc_interface(struct epf_ntb *ntb,
391 enum pci_epc_interface_type type)
392 {
393 const struct pci_epc_features *peer_epc_features;
394 const struct pci_epc_features *epc_features;
395 struct epf_ntb_epc *peer_ntb_epc;
396 struct epf_ntb_epc *ntb_epc;
397 struct epf_ntb_ctrl *ctrl;
> 398 enum pci_barno peer_barno;
399 struct device_node *node;
400 u32 spad_size, ctrl_size;
401 enum pci_barno barno;
402 u64 size, peer_size;
403 struct pci_epc *epc;
404 struct pci_epf *epf;
405 struct device *dev;
406 u32 spad_count;
407 size_t align;
408 void *base;
409
410 epf = ntb->epf;
411 node = epf->node;
412 dev = &epf->dev;
413 ntb_epc = ntb->epc[type];
414 epc = ntb_epc->epc;
415
416 epc_features = ntb_epc->epc_features;
417 barno = ntb_epc->epf_ntb_bar[BAR_CONFIG];
418 size = epc_features->bar_fixed_size[barno];
419 align = epc_features->align;
420
421 peer_ntb_epc = ntb->epc[!type];
422 peer_epc_features = peer_ntb_epc->epc_features;
423 peer_barno = ntb_epc->epf_ntb_bar[BAR_PEER_SPAD];
424 peer_size = peer_epc_features->bar_fixed_size[barno];
425
426 /* Check if epc_features is populated incorrectly */
427 if ((!IS_ALIGNED(size, align)))
428 return -EINVAL;
429
430 spad_count = SPAD_COUNT;
431 of_property_read_u32(node, "spad-count", &spad_count);
432
433 ctrl_size = sizeof(struct epf_ntb_ctrl);
434 spad_size = spad_count * 4;
435
436 if (!align) {
437 ctrl_size = roundup_pow_of_two(ctrl_size);
438 spad_size = roundup_pow_of_two(spad_size);
439 } else {
440 ctrl_size = ALIGN(ctrl_size, align);
441 spad_size = ALIGN(spad_size, align);
442 }
443
444 if (peer_size) {
445 if (peer_size < spad_size)
446 spad_count = peer_size / 4;
447 spad_size = peer_size;
448 }
449
450 /*
451 * In order to make sure SPAD offset is aligned to its size,
452 * expand control region size to the size of SPAD if SPAD size
453 * is greater than control region size.
454 */
455 if (spad_size > ctrl_size)
456 ctrl_size = spad_size;
457
458 if (!size)
459 size = ctrl_size + spad_size;
460 else if (size < ctrl_size + spad_size)
461 return -EINVAL;
462
463 base = pci_epf_alloc_space(epf, size, barno, align, type);
464 if (!base) {
465 dev_err(dev, "%s intf: Config/Status/SPAD alloc region fail\n",
466 pci_epc_interface_string(type));
467 return -ENOMEM;
468 }
469
470 ntb_epc->reg = base;
471
472 ctrl = ntb_epc->reg;
473 ctrl->spad_offset = ctrl_size;
474 ctrl->spad_count = spad_count;
475 ctrl->num_mws = ntb->num_mws;
476 ctrl->db_entry_size = align ? align : 4;
477 ntb_epc->spad_size = spad_size;
478
479 return 0;
480 }
481
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month