[rppt:memfd-secret/v19.3 4/7] mm/secretmem.c:78:41: error: too many arguments to function call, expected single argument 'page', have 2 arguments
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git memfd-secret/v19.3
head: 3ab055334ff06fa6231e2cf27fe7fff57bb7d87f
commit: 545bdc70882cbd28aebc1d6392fdc0249f795d2f [4/7] mm: introduce memfd_secret system call to create "secret" memory areas
config: arm64-randconfig-r023-20210516 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a80a5036a1f6b9a9eb4038b30458f9ab349efff8)
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
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git/commit/?id...
git remote add rppt https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git
git fetch --no-tags rppt memfd-secret/v19.3
git checkout 545bdc70882cbd28aebc1d6392fdc0249f795d2f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64
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 >>):
>> mm/secretmem.c:78:41: error: too many arguments to function call, expected single argument 'page', have 2 arguments
set_direct_map_default_noflush(page, 1);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
arch/arm64/include/asm/set_memory.h:14:5: note: 'set_direct_map_default_noflush' declared here
int set_direct_map_default_noflush(struct page *page);
^
1 error generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for STRICT_DEVMEM
Depends on MMU && DEVMEM && (ARCH_HAS_DEVMEM_IS_ALLOWED || GENERIC_LIB_DEVMEM_IS_ALLOWED
Selected by
- SECRETMEM
vim +/page +78 mm/secretmem.c
37
38 static bool secretmem_enable __ro_after_init;
39 module_param_named(enable, secretmem_enable, bool, 0400);
40 MODULE_PARM_DESC(secretmem_enable,
41 "Enable secretmem and memfd_secret(2) system call");
42
43 static vm_fault_t secretmem_fault(struct vm_fault *vmf)
44 {
45 struct address_space *mapping = vmf->vma->vm_file->f_mapping;
46 struct inode *inode = file_inode(vmf->vma->vm_file);
47 pgoff_t offset = vmf->pgoff;
48 gfp_t gfp = vmf->gfp_mask;
49 unsigned long addr;
50 struct page *page;
51 int err;
52
53 if (((loff_t)vmf->pgoff << PAGE_SHIFT) >= i_size_read(inode))
54 return vmf_error(-EINVAL);
55
56 retry:
57 page = find_lock_page(mapping, offset);
58 if (!page) {
59 page = alloc_page(gfp | __GFP_ZERO);
60 if (!page)
61 return VM_FAULT_OOM;
62
63 err = set_direct_map_invalid_noflush(page);
64 if (err) {
65 put_page(page);
66 return vmf_error(err);
67 }
68
69 __SetPageUptodate(page);
70 err = add_to_page_cache_lru(page, mapping, offset, gfp);
71 if (unlikely(err)) {
72 put_page(page);
73 /*
74 * If a split of large page was required, it
75 * already happened when we marked the page invalid
76 * which guarantees that this call won't fail
77 */
> 78 set_direct_map_default_noflush(page, 1);
79 if (err == -EEXIST)
80 goto retry;
81
82 return vmf_error(err);
83 }
84
85 addr = (unsigned long)page_address(page);
86 flush_tlb_kernel_range(addr, addr + PAGE_SIZE);
87 }
88
89 vmf->page = page;
90 return VM_FAULT_LOCKED;
91 }
92
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
drivers/watchdog/ath79_wdt.c:161:37: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 63d1cb53e26a9a4168b84a8981b225c0a9cfa235
commit: e5fc436f06eef54ef512ea55a9db8eb9f2e76959 sparse: use static inline for __chk_{user,io}_ptr()
date: 9 months ago
config: arm-randconfig-s031-20210516 (attached as .config)
compiler: arm-linux-gnueabi-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.3-341-g8af24329-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e5fc436f06eef54ef512ea55a9db8eb9f2e76959
# 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__' W=1 ARCH=arm
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 >>)
>> drivers/watchdog/ath79_wdt.c:161:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got char const * @@
drivers/watchdog/ath79_wdt.c:161:37: sparse: expected void const volatile [noderef] __user *ptr
drivers/watchdog/ath79_wdt.c:161:37: sparse: got char const *
drivers/watchdog/ath79_wdt.c:235:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@ expected int ( *write )( ... ) @@ got int ( * )( ... ) @@
drivers/watchdog/ath79_wdt.c:235:27: sparse: expected int ( *write )( ... )
drivers/watchdog/ath79_wdt.c:235:27: sparse: got int ( * )( ... )
vim +161 drivers/watchdog/ath79_wdt.c
f8394f61c66f48 Gabor Juhos 2011-01-04 148
f8394f61c66f48 Gabor Juhos 2011-01-04 149 static ssize_t ath79_wdt_write(struct file *file, const char *data,
f8394f61c66f48 Gabor Juhos 2011-01-04 150 size_t len, loff_t *ppos)
f8394f61c66f48 Gabor Juhos 2011-01-04 151 {
f8394f61c66f48 Gabor Juhos 2011-01-04 152 if (len) {
f8394f61c66f48 Gabor Juhos 2011-01-04 153 if (!nowayout) {
f8394f61c66f48 Gabor Juhos 2011-01-04 154 size_t i;
f8394f61c66f48 Gabor Juhos 2011-01-04 155
f8394f61c66f48 Gabor Juhos 2011-01-04 156 clear_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags);
f8394f61c66f48 Gabor Juhos 2011-01-04 157
f8394f61c66f48 Gabor Juhos 2011-01-04 158 for (i = 0; i != len; i++) {
f8394f61c66f48 Gabor Juhos 2011-01-04 159 char c;
f8394f61c66f48 Gabor Juhos 2011-01-04 160
f8394f61c66f48 Gabor Juhos 2011-01-04 @161 if (get_user(c, data + i))
f8394f61c66f48 Gabor Juhos 2011-01-04 162 return -EFAULT;
f8394f61c66f48 Gabor Juhos 2011-01-04 163
f8394f61c66f48 Gabor Juhos 2011-01-04 164 if (c == 'V')
f8394f61c66f48 Gabor Juhos 2011-01-04 165 set_bit(WDT_FLAGS_EXPECT_CLOSE,
f8394f61c66f48 Gabor Juhos 2011-01-04 166 &wdt_flags);
f8394f61c66f48 Gabor Juhos 2011-01-04 167 }
f8394f61c66f48 Gabor Juhos 2011-01-04 168 }
f8394f61c66f48 Gabor Juhos 2011-01-04 169
f8394f61c66f48 Gabor Juhos 2011-01-04 170 ath79_wdt_keepalive();
f8394f61c66f48 Gabor Juhos 2011-01-04 171 }
f8394f61c66f48 Gabor Juhos 2011-01-04 172
f8394f61c66f48 Gabor Juhos 2011-01-04 173 return len;
f8394f61c66f48 Gabor Juhos 2011-01-04 174 }
f8394f61c66f48 Gabor Juhos 2011-01-04 175
:::::: The code at line 161 was first introduced by commit
:::::: f8394f61c66f48b1fe9d6964ddce492d7f9a4cd9 watchdog: add driver for the Atheros AR71XX/AR724X/AR913X SoCs
:::::: TO: Gabor Juhos <juhosg(a)openwrt.org>
:::::: CC: Wim Van Sebroeck <wim(a)iguana.be>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[rppt:memfd-secret/v19.2 4/7] mm/secretmem.c:63:46: error: too many arguments to function call, expected single argument 'page', have 2 arguments
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git memfd-secret/v19.2
head: 96dd5765c0ba20e58b377b1341358c2c35504098
commit: 9a074a1c16d0fce50b45f82ff886f04452d38904 [4/7] mm: introduce memfd_secret system call to create "secret" memory areas
config: x86_64-randconfig-a015-20210516 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a80a5036a1f6b9a9eb4038b30458f9ab349efff8)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git/commit/?id...
git remote add rppt https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git
git fetch --no-tags rppt memfd-secret/v19.2
git checkout 9a074a1c16d0fce50b45f82ff886f04452d38904
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross 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 >>):
>> mm/secretmem.c:63:46: error: too many arguments to function call, expected single argument 'page', have 2 arguments
err = set_direct_map_invalid_noflush(page, 1);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
arch/x86/include/asm/set_memory.h:83:5: note: 'set_direct_map_invalid_noflush' declared here
int set_direct_map_invalid_noflush(struct page *page);
^
mm/secretmem.c:78:41: error: too many arguments to function call, expected single argument 'page', have 2 arguments
set_direct_map_default_noflush(page, 1);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
arch/x86/include/asm/set_memory.h:84:5: note: 'set_direct_map_default_noflush' declared here
int set_direct_map_default_noflush(struct page *page);
^
mm/secretmem.c:136:39: error: too many arguments to function call, expected single argument 'page', have 2 arguments
set_direct_map_default_noflush(page, 1);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
arch/x86/include/asm/set_memory.h:84:5: note: 'set_direct_map_default_noflush' declared here
int set_direct_map_default_noflush(struct page *page);
^
3 errors generated.
vim +/page +63 mm/secretmem.c
37
38 static bool secretmem_enable __ro_after_init;
39 module_param_named(enable, secretmem_enable, bool, 0400);
40 MODULE_PARM_DESC(secretmem_enable,
41 "Enable secretmem and memfd_secret(2) system call");
42
43 static vm_fault_t secretmem_fault(struct vm_fault *vmf)
44 {
45 struct address_space *mapping = vmf->vma->vm_file->f_mapping;
46 struct inode *inode = file_inode(vmf->vma->vm_file);
47 pgoff_t offset = vmf->pgoff;
48 gfp_t gfp = vmf->gfp_mask;
49 unsigned long addr;
50 struct page *page;
51 int err;
52
53 if (((loff_t)vmf->pgoff << PAGE_SHIFT) >= i_size_read(inode))
54 return vmf_error(-EINVAL);
55
56 retry:
57 page = find_lock_page(mapping, offset);
58 if (!page) {
59 page = alloc_page(gfp | __GFP_ZERO);
60 if (!page)
61 return VM_FAULT_OOM;
62
> 63 err = set_direct_map_invalid_noflush(page, 1);
64 if (err) {
65 put_page(page);
66 return vmf_error(err);
67 }
68
69 __SetPageUptodate(page);
70 err = add_to_page_cache_lru(page, mapping, offset, gfp);
71 if (unlikely(err)) {
72 put_page(page);
73 /*
74 * If a split of large page was required, it
75 * already happened when we marked the page invalid
76 * which guarantees that this call won't fail
77 */
78 set_direct_map_default_noflush(page, 1);
79 if (err == -EEXIST)
80 goto retry;
81
82 return vmf_error(err);
83 }
84
85 addr = (unsigned long)page_address(page);
86 flush_tlb_kernel_range(addr, addr + PAGE_SIZE);
87 }
88
89 vmf->page = page;
90 return VM_FAULT_LOCKED;
91 }
92
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[arm-platforms:irq/domain_cleanup 30/31] drivers/mfd/qcom-pm8xxx.c:218:4: error: implicit declaration of function 'generic_handle_generic_irq'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git irq/domain_cleanup
head: 98b44e2b2b00423e554aa8d9261f6f6749997a03
commit: 3dff5daadd0d219ea72a65cb7ed192fff14bb2a4 [30/31] MFD: Bulk conversion to generic_handle_domain_irq()
config: s390-randconfig-r012-20210516 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a80a5036a1f6b9a9eb4038b30458f9ab349efff8)
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
# install s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/com...
git remote add arm-platforms https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git
git fetch --no-tags arm-platforms irq/domain_cleanup
git checkout 3dff5daadd0d219ea72a65cb7ed192fff14bb2a4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=s390
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 >>):
In file included from drivers/mfd/qcom-pm8xxx.c:10:
In file included from include/linux/irqchip/chained_irq.h:10:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:75:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:36:59: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
^
include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
#define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
^
In file included from drivers/mfd/qcom-pm8xxx.c:10:
In file included from include/linux/irqchip/chained_irq.h:10:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:75:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
#define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
^
In file included from drivers/mfd/qcom-pm8xxx.c:10:
In file included from include/linux/irqchip/chained_irq.h:10:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:75:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> drivers/mfd/qcom-pm8xxx.c:218:4: error: implicit declaration of function 'generic_handle_generic_irq' [-Werror,-Wimplicit-function-declaration]
generic_handle_generic_irq(chip->irqdomain, pmirq);
^
drivers/mfd/qcom-pm8xxx.c:218:4: note: did you mean 'generic_handle_domain_irq'?
include/linux/irqdesc.h:170:5: note: 'generic_handle_domain_irq' declared here
int generic_handle_domain_irq(struct irq_domain *domain, unsigned int hwirq);
^
12 warnings and 1 error generated.
vim +/generic_handle_generic_irq +218 drivers/mfd/qcom-pm8xxx.c
197
198 static void pm8821_irq_block_handler(struct pm_irq_chip *chip,
199 int master, int block)
200 {
201 int pmirq, i, ret;
202 unsigned int bits;
203
204 ret = regmap_read(chip->regmap,
205 PM8821_SSBI_ADDR_IRQ_ROOT(master, block), &bits);
206 if (ret) {
207 pr_err("Reading block %d failed ret=%d", block, ret);
208 return;
209 }
210
211 /* Convert block offset to global block number */
212 block += (master * PM8821_BLOCKS_PER_MASTER) - 1;
213
214 /* Check IRQ bits */
215 for (i = 0; i < 8; i++) {
216 if (bits & BIT(i)) {
217 pmirq = block * 8 + i;
> 218 generic_handle_generic_irq(chip->irqdomain, pmirq);
219 }
220 }
221 }
222
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[arm-platforms:irq/domain_cleanup 31/31] drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c:54:14: error: 'mapping' undeclared
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git irq/domain_cleanup
head: 98b44e2b2b00423e554aa8d9261f6f6749997a03
commit: 98b44e2b2b00423e554aa8d9261f6f6749997a03 [31/31] gpu: Bulk conversion to generic_handle_domain_irq()
config: arm-defconfig (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
# https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/com...
git remote add arm-platforms https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git
git fetch --no-tags arm-platforms irq/domain_cleanup
git checkout 98b44e2b2b00423e554aa8d9261f6f6749997a03
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 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 >>):
In file included from include/drm/drm_mm.h:49,
from include/drm/drm_vma_manager.h:26,
from include/drm/drm_gem.h:40,
from drivers/gpu/drm/msm/msm_drv.h:34,
from drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h:15,
from drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c:10:
drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c: In function 'dpu_mdss_irq':
>> drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c:54:14: error: 'mapping' undeclared (first use in this function)
54 | hwirq, mapping, rc);
| ^~~~~~~
include/drm/drm_print.h:498:19: note: in definition of macro 'DRM_ERROR'
498 | __drm_err(fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~
drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c:54:14: note: each undeclared identifier is reported only once for each function it appears in
54 | hwirq, mapping, rc);
| ^~~~~~~
include/drm/drm_print.h:498:19: note: in definition of macro 'DRM_ERROR'
498 | __drm_err(fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~
vim +/mapping +54 drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 35
070e64dc1bbc87 Stephen Boyd 2019-01-03 36 static void dpu_mdss_irq(struct irq_desc *desc)
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 37 {
070e64dc1bbc87 Stephen Boyd 2019-01-03 38 struct dpu_mdss *dpu_mdss = irq_desc_get_handler_data(desc);
070e64dc1bbc87 Stephen Boyd 2019-01-03 39 struct irq_chip *chip = irq_desc_get_chip(desc);
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 40 u32 interrupts;
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 41
070e64dc1bbc87 Stephen Boyd 2019-01-03 42 chained_irq_enter(chip, desc);
070e64dc1bbc87 Stephen Boyd 2019-01-03 43
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 44 interrupts = readl_relaxed(dpu_mdss->mmio + HW_INTR_STATUS);
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 45
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 46 while (interrupts) {
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 47 irq_hw_number_t hwirq = fls(interrupts) - 1;
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 48 int rc;
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 49
98b44e2b2b0042 Marc Zyngier 2021-05-04 50 rc = generic_handle_domain_irq(dpu_mdss->irq_controller.domain,
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 51 hwirq);
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 52 if (rc < 0) {
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 53 DRM_ERROR("handle irq fail: irq=%lu mapping=%u rc=%d\n",
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 @54 hwirq, mapping, rc);
070e64dc1bbc87 Stephen Boyd 2019-01-03 55 break;
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 56 }
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 57
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 58 interrupts &= ~(1 << hwirq);
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 59 }
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 60
070e64dc1bbc87 Stephen Boyd 2019-01-03 61 chained_irq_exit(chip, desc);
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 62 }
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 63
:::::: The code at line 54 was first introduced by commit
:::::: 25fdd5933e4c0f5fe2ea5cd59994f8ac5fbe90ef drm/msm: Add SDM845 DPU support
:::::: TO: Jeykumar Sankaran <jsanka(a)codeaurora.org>
:::::: CC: Sean Paul <seanpaul(a)chromium.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[rppt:memfd-secret/v19.2 4/7] mm/secretmem.c:63:9: error: too many arguments to function 'set_direct_map_invalid_noflush'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git memfd-secret/v19.2
head: 96dd5765c0ba20e58b377b1341358c2c35504098
commit: 9a074a1c16d0fce50b45f82ff886f04452d38904 [4/7] mm: introduce memfd_secret system call to create "secret" memory areas
config: x86_64-randconfig-c022-20210516 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git/commit/?id...
git remote add rppt https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git
git fetch --no-tags rppt memfd-secret/v19.2
git checkout 9a074a1c16d0fce50b45f82ff886f04452d38904
# save the attached .config to linux build tree
make W=1 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 >>):
mm/secretmem.c: In function 'secretmem_fault':
>> mm/secretmem.c:63:9: error: too many arguments to function 'set_direct_map_invalid_noflush'
63 | err = set_direct_map_invalid_noflush(page, 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/set_memory.h:9,
from mm/secretmem.c:19:
arch/x86/include/asm/set_memory.h:83:5: note: declared here
83 | int set_direct_map_invalid_noflush(struct page *page);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> mm/secretmem.c:78:4: error: too many arguments to function 'set_direct_map_default_noflush'
78 | set_direct_map_default_noflush(page, 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/set_memory.h:9,
from mm/secretmem.c:19:
arch/x86/include/asm/set_memory.h:84:5: note: declared here
84 | int set_direct_map_default_noflush(struct page *page);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/secretmem.c: In function 'secretmem_freepage':
mm/secretmem.c:136:2: error: too many arguments to function 'set_direct_map_default_noflush'
136 | set_direct_map_default_noflush(page, 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/set_memory.h:9,
from mm/secretmem.c:19:
arch/x86/include/asm/set_memory.h:84:5: note: declared here
84 | int set_direct_map_default_noflush(struct page *page);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/set_direct_map_invalid_noflush +63 mm/secretmem.c
37
38 static bool secretmem_enable __ro_after_init;
39 module_param_named(enable, secretmem_enable, bool, 0400);
40 MODULE_PARM_DESC(secretmem_enable,
41 "Enable secretmem and memfd_secret(2) system call");
42
43 static vm_fault_t secretmem_fault(struct vm_fault *vmf)
44 {
45 struct address_space *mapping = vmf->vma->vm_file->f_mapping;
46 struct inode *inode = file_inode(vmf->vma->vm_file);
47 pgoff_t offset = vmf->pgoff;
48 gfp_t gfp = vmf->gfp_mask;
49 unsigned long addr;
50 struct page *page;
51 int err;
52
53 if (((loff_t)vmf->pgoff << PAGE_SHIFT) >= i_size_read(inode))
54 return vmf_error(-EINVAL);
55
56 retry:
57 page = find_lock_page(mapping, offset);
58 if (!page) {
59 page = alloc_page(gfp | __GFP_ZERO);
60 if (!page)
61 return VM_FAULT_OOM;
62
> 63 err = set_direct_map_invalid_noflush(page, 1);
64 if (err) {
65 put_page(page);
66 return vmf_error(err);
67 }
68
69 __SetPageUptodate(page);
70 err = add_to_page_cache_lru(page, mapping, offset, gfp);
71 if (unlikely(err)) {
72 put_page(page);
73 /*
74 * If a split of large page was required, it
75 * already happened when we marked the page invalid
76 * which guarantees that this call won't fail
77 */
> 78 set_direct_map_default_noflush(page, 1);
79 if (err == -EEXIST)
80 goto retry;
81
82 return vmf_error(err);
83 }
84
85 addr = (unsigned long)page_address(page);
86 flush_tlb_kernel_range(addr, addr + PAGE_SIZE);
87 }
88
89 vmf->page = page;
90 return VM_FAULT_LOCKED;
91 }
92
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
Re: [RFC 1/4] drivers/nvdimm: Add perf interface to expose nvdimm performance stats
by kernel test robot
Hi Kajol,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on powerpc/next]
[also build test ERROR on linus/master linux-nvdimm/libnvdimm-for-next v5.13-rc1 next-20210514]
[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/Kajol-Jain/Add-perf-interface-to...
base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-randconfig-r011-20210516 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 23f7d651b682ea387eaae99f0888e6ca916039cb)
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
# install powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://github.com/0day-ci/linux/commit/ab3efdc432a19e9be03c6cb371dd4d1e5...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Kajol-Jain/Add-perf-interface-to-expose-nvdimm-performance-stats/20210513-004122
git checkout ab3efdc432a19e9be03c6cb371dd4d1e50cf9917
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=powerpc
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 >>):
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:174:1: note: expanded from here
__do_insw
^
arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw'
#define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/nvdimm/nd_perf.c:12:
In file included from include/linux/nd.h:12:
In file included from include/linux/perf_event.h:49:
In file included from include/linux/ftrace.h:10:
In file included from include/linux/trace_recursion.h:5:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:176:1: note: expanded from here
__do_insl
^
arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl'
#define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/nvdimm/nd_perf.c:12:
In file included from include/linux/nd.h:12:
In file included from include/linux/perf_event.h:49:
In file included from include/linux/ftrace.h:10:
In file included from include/linux/trace_recursion.h:5:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:178:1: note: expanded from here
__do_outsb
^
arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb'
#define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/nvdimm/nd_perf.c:12:
In file included from include/linux/nd.h:12:
In file included from include/linux/perf_event.h:49:
In file included from include/linux/ftrace.h:10:
In file included from include/linux/trace_recursion.h:5:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:180:1: note: expanded from here
__do_outsw
^
arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw'
#define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/nvdimm/nd_perf.c:12:
In file included from include/linux/nd.h:12:
In file included from include/linux/perf_event.h:49:
In file included from include/linux/ftrace.h:10:
In file included from include/linux/trace_recursion.h:5:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:182:1: note: expanded from here
__do_outsl
^
arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl'
#define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
>> drivers/nvdimm/nd_perf.c:18:51: error: no member named 'pmu' in 'struct perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:701:26: note: expanded from macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
>> drivers/nvdimm/nd_perf.c:18:51: error: no member named 'pmu' in 'struct perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:702:34: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
>> drivers/nvdimm/nd_perf.c:18:51: error: no member named 'pmu' in 'struct perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:703:20: note: expanded from macro 'container_of'
!__same_type(*(ptr), void), \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
>> drivers/nvdimm/nd_perf.c:21:13: error: no member named 'attr' in 'struct perf_event'
if (event->attr.type != event->pmu->type)
~~~~~ ^
drivers/nvdimm/nd_perf.c:21:33: error: no member named 'pmu' in 'struct perf_event'
if (event->attr.type != event->pmu->type)
~~~~~ ^
>> drivers/nvdimm/nd_perf.c:25:6: error: implicit declaration of function 'is_sampling_event' [-Werror,-Wimplicit-function-declaration]
if (is_sampling_event(event))
^
>> drivers/nvdimm/nd_perf.c:29:6: error: implicit declaration of function 'has_branch_stack' [-Werror,-Wimplicit-function-declaration]
if (has_branch_stack(event))
^
drivers/nvdimm/nd_perf.c:41:51: error: no member named 'pmu' in 'struct perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:701:26: note: expanded from macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
drivers/nvdimm/nd_perf.c:41:51: error: no member named 'pmu' in 'struct perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:702:34: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
drivers/nvdimm/nd_perf.c:41:51: error: no member named 'pmu' in 'struct perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:703:20: note: expanded from macro 'container_of'
!__same_type(*(ptr), void), \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
drivers/nvdimm/nd_perf.c:50:51: error: no member named 'pmu' in 'struct perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:701:26: note: expanded from macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
drivers/nvdimm/nd_perf.c:50:51: error: no member named 'pmu' in 'struct perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:702:34: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
drivers/nvdimm/nd_perf.c:50:51: error: no member named 'pmu' in 'struct perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:703:20: note: expanded from macro 'container_of'
!__same_type(*(ptr), void), \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
drivers/nvdimm/nd_perf.c:59:51: error: no member named 'pmu' in 'struct perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:701:26: note: expanded from macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
drivers/nvdimm/nd_perf.c:59:51: error: no member named 'pmu' in 'struct perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:702:34: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
drivers/nvdimm/nd_perf.c:59:51: error: no member named 'pmu' in 'struct perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:703:20: note: expanded from macro 'container_of'
!__same_type(*(ptr), void), \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
>> drivers/nvdimm/nd_perf.c:92:7: error: implicit declaration of function 'perf_pmu_register' [-Werror,-Wimplicit-function-declaration]
rc = perf_pmu_register(&nd_pmu->pmu, nd_pmu->name, -1);
^
>> drivers/nvdimm/nd_perf.c:109:2: error: implicit declaration of function 'perf_pmu_unregister' [-Werror,-Wimplicit-function-declaration]
perf_pmu_unregister(nd_pmu);
^
12 warnings and 18 errors generated.
vim +18 drivers/nvdimm/nd_perf.c
15
16 static int nvdimm_pmu_event_init(struct perf_event *event)
17 {
> 18 struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
19
20 /* test the event attr type for PMU enumeration */
> 21 if (event->attr.type != event->pmu->type)
22 return -ENOENT;
23
24 /* it does not support event sampling mode */
> 25 if (is_sampling_event(event))
26 return -EINVAL;
27
28 /* no branch sampling */
> 29 if (has_branch_stack(event))
30 return -EOPNOTSUPP;
31
32 /* jump to arch/platform specific callbacks if any */
33 if (nd_pmu && nd_pmu->event_init)
34 return nd_pmu->event_init(event, nd_pmu->dev);
35
36 return 0;
37 }
38
39 static void nvdimm_pmu_read(struct perf_event *event)
40 {
41 struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
42
43 /* jump to arch/platform specific callbacks if any */
44 if (nd_pmu && nd_pmu->read)
45 nd_pmu->read(event, nd_pmu->dev);
46 }
47
48 static void nvdimm_pmu_del(struct perf_event *event, int flags)
49 {
50 struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
51
52 /* jump to arch/platform specific callbacks if any */
53 if (nd_pmu && nd_pmu->del)
54 nd_pmu->del(event, flags, nd_pmu->dev);
55 }
56
57 static int nvdimm_pmu_add(struct perf_event *event, int flags)
58 {
59 struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
60
61 if (flags & PERF_EF_START)
62 /* jump to arch/platform specific callbacks if any */
63 if (nd_pmu && nd_pmu->add)
64 return nd_pmu->add(event, flags, nd_pmu->dev);
65 return 0;
66 }
67
68 int register_nvdimm_pmu(struct nvdimm_pmu *nd_pmu, struct platform_device *pdev)
69 {
70 int rc;
71
72 if (!nd_pmu || !pdev)
73 return -EINVAL;
74
75 nd_pmu->pmu.task_ctx_nr = perf_invalid_context;
76 nd_pmu->pmu.event_init = nvdimm_pmu_event_init;
77 nd_pmu->pmu.add = nvdimm_pmu_add;
78 nd_pmu->pmu.del = nvdimm_pmu_del;
79 nd_pmu->pmu.read = nvdimm_pmu_read;
80 nd_pmu->pmu.name = nd_pmu->name;
81 nd_pmu->pmu.attr_groups = nd_pmu->attr_groups;
82 nd_pmu->pmu.capabilities = PERF_PMU_CAP_NO_INTERRUPT |
83 PERF_PMU_CAP_NO_EXCLUDE;
84
85 /*
86 * Adding platform_device->dev pointer to nvdimm_pmu, so that we can
87 * access that device data in PMU callbacks and also pass it to
88 * arch/platform specific code.
89 */
90 nd_pmu->dev = &pdev->dev;
91
> 92 rc = perf_pmu_register(&nd_pmu->pmu, nd_pmu->name, -1);
93 if (rc)
94 return rc;
95
96 pr_info("%s NVDIMM performance monitor support registered\n",
97 nd_pmu->name);
98
99 return 0;
100 }
101 EXPORT_SYMBOL_GPL(register_nvdimm_pmu);
102
103 void unregister_nvdimm_pmu(struct pmu *nd_pmu)
104 {
105 /*
106 * nd_pmu will get free in arch/platform specific code once
107 * corresponding pmu get unregistered.
108 */
> 109 perf_pmu_unregister(nd_pmu);
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[arm-platforms:irq/domain_cleanup 30/31] drivers/mfd/qcom-pm8xxx.c:218:4: error: implicit declaration of function 'generic_handle_generic_irq'; did you mean 'generic_handle_domain_irq'?
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git irq/domain_cleanup
head: 98b44e2b2b00423e554aa8d9261f6f6749997a03
commit: 3dff5daadd0d219ea72a65cb7ed192fff14bb2a4 [30/31] MFD: Bulk conversion to generic_handle_domain_irq()
config: m68k-randconfig-r003-20210516 (attached as .config)
compiler: m68k-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
# https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/com...
git remote add arm-platforms https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git
git fetch --no-tags arm-platforms irq/domain_cleanup
git checkout 3dff5daadd0d219ea72a65cb7ed192fff14bb2a4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=m68k
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/mfd/qcom-pm8xxx.c: In function 'pm8821_irq_block_handler':
>> drivers/mfd/qcom-pm8xxx.c:218:4: error: implicit declaration of function 'generic_handle_generic_irq'; did you mean 'generic_handle_domain_irq'? [-Werror=implicit-function-declaration]
218 | generic_handle_generic_irq(chip->irqdomain, pmirq);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| generic_handle_domain_irq
cc1: some warnings being treated as errors
vim +218 drivers/mfd/qcom-pm8xxx.c
197
198 static void pm8821_irq_block_handler(struct pm_irq_chip *chip,
199 int master, int block)
200 {
201 int pmirq, i, ret;
202 unsigned int bits;
203
204 ret = regmap_read(chip->regmap,
205 PM8821_SSBI_ADDR_IRQ_ROOT(master, block), &bits);
206 if (ret) {
207 pr_err("Reading block %d failed ret=%d", block, ret);
208 return;
209 }
210
211 /* Convert block offset to global block number */
212 block += (master * PM8821_BLOCKS_PER_MASTER) - 1;
213
214 /* Check IRQ bits */
215 for (i = 0; i < 8; i++) {
216 if (bits & BIT(i)) {
217 pmirq = block * 8 + i;
> 218 generic_handle_generic_irq(chip->irqdomain, pmirq);
219 }
220 }
221 }
222
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[linux-next:master 3136/3150] init/main.c:925:2: error: implicit declaration of function 'init_vmlinux_build_id'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: cd557f1c605fc5a2c0eb0b540610f50dc67dd849
commit: 9bbb6ec7e7a5cbc59222379498d5a3b8ac21080a [3136/3150] buildid: stash away kernels build ID on init
config: x86_64-randconfig-a005-20210514 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 9bbb6ec7e7a5cbc59222379498d5a3b8ac21080a
# save the attached .config to linux build tree
make W=1 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>
Note: the linux-next/master HEAD cd557f1c605fc5a2c0eb0b540610f50dc67dd849 builds fine.
It may have been fixed somewhere.
All errors (new ones prefixed by >>):
init/main.c: In function 'start_kernel':
>> init/main.c:925:2: error: implicit declaration of function 'init_vmlinux_build_id' [-Werror=implicit-function-declaration]
925 | init_vmlinux_build_id();
| ^~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/init_vmlinux_build_id +925 init/main.c
916
917 asmlinkage __visible void __init __no_sanitize_address start_kernel(void)
918 {
919 char *command_line;
920 char *after_dashes;
921
922 set_task_stack_end_magic(&init_task);
923 smp_setup_processor_id();
924 debug_objects_early_init();
> 925 init_vmlinux_build_id();
926
927 cgroup_init_early();
928
929 local_irq_disable();
930 early_boot_irqs_disabled = true;
931
932 /*
933 * Interrupts are still disabled. Do necessary setups, then
934 * enable them.
935 */
936 boot_cpu_init();
937 page_address_init();
938 pr_notice("%s", linux_banner);
939 early_security_init();
940 setup_arch(&command_line);
941 setup_boot_config();
942 setup_command_line(command_line);
943 setup_nr_cpu_ids();
944 setup_per_cpu_areas();
945 smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
946 boot_cpu_hotplug_init();
947
948 build_all_zonelists(NULL);
949 page_alloc_init();
950
951 pr_notice("Kernel command line: %s\n", saved_command_line);
952 /* parameters may set static keys */
953 jump_label_init();
954 parse_early_param();
955 after_dashes = parse_args("Booting kernel",
956 static_command_line, __start___param,
957 __stop___param - __start___param,
958 -1, -1, NULL, &unknown_bootoption);
959 print_unknown_bootoptions();
960 if (!IS_ERR_OR_NULL(after_dashes))
961 parse_args("Setting init args", after_dashes, NULL, 0, -1, -1,
962 NULL, set_init_arg);
963 if (extra_init_args)
964 parse_args("Setting extra init args", extra_init_args,
965 NULL, 0, -1, -1, NULL, set_init_arg);
966
967 /*
968 * These use large bootmem allocations and must precede
969 * kmem_cache_init()
970 */
971 setup_log_buf(0);
972 vfs_caches_init_early();
973 sort_main_extable();
974 trap_init();
975 mm_init();
976
977 ftrace_init();
978
979 /* trace_printk can be enabled here */
980 early_trace_init();
981
982 /*
983 * Set up the scheduler prior starting any interrupts (such as the
984 * timer interrupt). Full topology setup happens at smp_init()
985 * time - but meanwhile we still have a functioning scheduler.
986 */
987 sched_init();
988
989 if (WARN(!irqs_disabled(),
990 "Interrupts were enabled *very* early, fixing it\n"))
991 local_irq_disable();
992 radix_tree_init();
993
994 /*
995 * Set up housekeeping before setting up workqueues to allow the unbound
996 * workqueue to take non-housekeeping into account.
997 */
998 housekeeping_init();
999
1000 /*
1001 * Allow workqueue creation and work item queueing/cancelling
1002 * early. Work item execution depends on kthreads and starts after
1003 * workqueue_init().
1004 */
1005 workqueue_init_early();
1006
1007 rcu_init();
1008
1009 /* Trace events are available after this */
1010 trace_init();
1011
1012 if (initcall_debug)
1013 initcall_debug_enable();
1014
1015 context_tracking_init();
1016 /* init some links before init_ISA_irqs() */
1017 early_irq_init();
1018 init_IRQ();
1019 tick_init();
1020 rcu_init_nohz();
1021 init_timers();
1022 srcu_init();
1023 hrtimers_init();
1024 softirq_init();
1025 timekeeping_init();
1026 kfence_init();
1027
1028 /*
1029 * For best initial stack canary entropy, prepare it after:
1030 * - setup_arch() for any UEFI RNG entropy and boot cmdline access
1031 * - timekeeping_init() for ktime entropy used in rand_initialize()
1032 * - rand_initialize() to get any arch-specific entropy like RDRAND
1033 * - add_latent_entropy() to get any latent entropy
1034 * - adding command line entropy
1035 */
1036 rand_initialize();
1037 add_latent_entropy();
1038 add_device_randomness(command_line, strlen(command_line));
1039 boot_init_stack_canary();
1040
1041 time_init();
1042 perf_event_init();
1043 profile_init();
1044 call_function_init();
1045 WARN(!irqs_disabled(), "Interrupts were enabled early\n");
1046
1047 early_boot_irqs_disabled = false;
1048 local_irq_enable();
1049
1050 kmem_cache_init_late();
1051
1052 /*
1053 * HACK ALERT! This is early. We're enabling the console before
1054 * we've done PCI setups etc, and console_init() must be aware of
1055 * this. But we do want output early, in case something goes wrong.
1056 */
1057 console_init();
1058 if (panic_later)
1059 panic("Too many boot %s vars at `%s'", panic_later,
1060 panic_param);
1061
1062 lockdep_init();
1063
1064 /*
1065 * Need to run this when irqs are enabled, because it wants
1066 * to self-test [hard/soft]-irqs on/off lock inversion bugs
1067 * too:
1068 */
1069 locking_selftest();
1070
1071 /*
1072 * This needs to be called before any devices perform DMA
1073 * operations that might use the SWIOTLB bounce buffers. It will
1074 * mark the bounce buffers as decrypted so that their usage will
1075 * not cause "plain-text" data to be decrypted when accessed.
1076 */
1077 mem_encrypt_init();
1078
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[arm-platforms:irq/domain_cleanup 5/25] drivers/staging/octeon-usb/octeon-hcd.c:3548:26: error: dereferencing pointer to incomplete type 'struct device_node'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git irq/domain_cleanup
head: dee94333f76d0bd7b6c8302e377654b6e103b71b
commit: 59463db82808e6588f589b75f7fef5f0c0c2012d [5/25] MIPS: Do not include linux/irqdomain.h from asm/irq.h
config: mips-cavium_octeon_defconfig (attached as .config)
compiler: mips64-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
# https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/com...
git remote add arm-platforms https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git
git fetch --no-tags arm-platforms irq/domain_cleanup
git checkout 59463db82808e6588f589b75f7fef5f0c0c2012d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=mips
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/staging/octeon-usb/octeon-hcd.c: In function 'octeon_usb_probe':
>> drivers/staging/octeon-usb/octeon-hcd.c:3548:26: error: dereferencing pointer to incomplete type 'struct device_node'
3548 | usbn_node = dev->of_node->parent;
| ^~
>> drivers/staging/octeon-usb/octeon-hcd.c:3550:6: error: implicit declaration of function 'of_property_read_u32' [-Werror=implicit-function-declaration]
3550 | i = of_property_read_u32(usbn_node,
| ^~~~~~~~~~~~~~~~~~~~
>> drivers/staging/octeon-usb/octeon-hcd.c:3575:6: error: implicit declaration of function 'of_property_read_string' [-Werror=implicit-function-declaration]
3575 | i = of_property_read_string(usbn_node,
| ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/octeon-usb/octeon-hcd.c:3600:9: error: implicit declaration of function 'irq_create_mapping' [-Werror=implicit-function-declaration]
3600 | irq = irq_create_mapping(NULL, hwirq);
| ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +3548 drivers/staging/octeon-usb/octeon-hcd.c
96b06c0a16f737 Chris Packham 2020-02-05 3527
96b06c0a16f737 Chris Packham 2020-02-05 3528 static int octeon_usb_probe(struct platform_device *pdev)
96b06c0a16f737 Chris Packham 2020-02-05 3529 {
96b06c0a16f737 Chris Packham 2020-02-05 3530 int status;
96b06c0a16f737 Chris Packham 2020-02-05 3531 int initialize_flags;
96b06c0a16f737 Chris Packham 2020-02-05 3532 int usb_num;
96b06c0a16f737 Chris Packham 2020-02-05 3533 struct resource *res_mem;
96b06c0a16f737 Chris Packham 2020-02-05 3534 struct device_node *usbn_node;
96b06c0a16f737 Chris Packham 2020-02-05 3535 int irq = platform_get_irq(pdev, 0);
96b06c0a16f737 Chris Packham 2020-02-05 3536 struct device *dev = &pdev->dev;
96b06c0a16f737 Chris Packham 2020-02-05 3537 struct octeon_hcd *usb;
96b06c0a16f737 Chris Packham 2020-02-05 3538 struct usb_hcd *hcd;
96b06c0a16f737 Chris Packham 2020-02-05 3539 u32 clock_rate = 48000000;
96b06c0a16f737 Chris Packham 2020-02-05 3540 bool is_crystal_clock = false;
96b06c0a16f737 Chris Packham 2020-02-05 3541 const char *clock_type;
96b06c0a16f737 Chris Packham 2020-02-05 3542 int i;
96b06c0a16f737 Chris Packham 2020-02-05 3543
96b06c0a16f737 Chris Packham 2020-02-05 3544 if (!dev->of_node) {
96b06c0a16f737 Chris Packham 2020-02-05 3545 dev_err(dev, "Error: empty of_node\n");
96b06c0a16f737 Chris Packham 2020-02-05 3546 return -ENXIO;
96b06c0a16f737 Chris Packham 2020-02-05 3547 }
96b06c0a16f737 Chris Packham 2020-02-05 @3548 usbn_node = dev->of_node->parent;
96b06c0a16f737 Chris Packham 2020-02-05 3549
96b06c0a16f737 Chris Packham 2020-02-05 @3550 i = of_property_read_u32(usbn_node,
96b06c0a16f737 Chris Packham 2020-02-05 3551 "clock-frequency", &clock_rate);
96b06c0a16f737 Chris Packham 2020-02-05 3552 if (i)
96b06c0a16f737 Chris Packham 2020-02-05 3553 i = of_property_read_u32(usbn_node,
96b06c0a16f737 Chris Packham 2020-02-05 3554 "refclk-frequency", &clock_rate);
96b06c0a16f737 Chris Packham 2020-02-05 3555 if (i) {
96b06c0a16f737 Chris Packham 2020-02-05 3556 dev_err(dev, "No USBN \"clock-frequency\"\n");
96b06c0a16f737 Chris Packham 2020-02-05 3557 return -ENXIO;
96b06c0a16f737 Chris Packham 2020-02-05 3558 }
96b06c0a16f737 Chris Packham 2020-02-05 3559 switch (clock_rate) {
96b06c0a16f737 Chris Packham 2020-02-05 3560 case 12000000:
96b06c0a16f737 Chris Packham 2020-02-05 3561 initialize_flags = CVMX_USB_INITIALIZE_FLAGS_CLOCK_12MHZ;
96b06c0a16f737 Chris Packham 2020-02-05 3562 break;
96b06c0a16f737 Chris Packham 2020-02-05 3563 case 24000000:
96b06c0a16f737 Chris Packham 2020-02-05 3564 initialize_flags = CVMX_USB_INITIALIZE_FLAGS_CLOCK_24MHZ;
96b06c0a16f737 Chris Packham 2020-02-05 3565 break;
96b06c0a16f737 Chris Packham 2020-02-05 3566 case 48000000:
96b06c0a16f737 Chris Packham 2020-02-05 3567 initialize_flags = CVMX_USB_INITIALIZE_FLAGS_CLOCK_48MHZ;
96b06c0a16f737 Chris Packham 2020-02-05 3568 break;
96b06c0a16f737 Chris Packham 2020-02-05 3569 default:
96b06c0a16f737 Chris Packham 2020-02-05 3570 dev_err(dev, "Illegal USBN \"clock-frequency\" %u\n",
96b06c0a16f737 Chris Packham 2020-02-05 3571 clock_rate);
96b06c0a16f737 Chris Packham 2020-02-05 3572 return -ENXIO;
96b06c0a16f737 Chris Packham 2020-02-05 3573 }
96b06c0a16f737 Chris Packham 2020-02-05 3574
96b06c0a16f737 Chris Packham 2020-02-05 @3575 i = of_property_read_string(usbn_node,
96b06c0a16f737 Chris Packham 2020-02-05 3576 "cavium,refclk-type", &clock_type);
96b06c0a16f737 Chris Packham 2020-02-05 3577 if (i)
96b06c0a16f737 Chris Packham 2020-02-05 3578 i = of_property_read_string(usbn_node,
96b06c0a16f737 Chris Packham 2020-02-05 3579 "refclk-type", &clock_type);
96b06c0a16f737 Chris Packham 2020-02-05 3580
96b06c0a16f737 Chris Packham 2020-02-05 3581 if (!i && strcmp("crystal", clock_type) == 0)
96b06c0a16f737 Chris Packham 2020-02-05 3582 is_crystal_clock = true;
96b06c0a16f737 Chris Packham 2020-02-05 3583
96b06c0a16f737 Chris Packham 2020-02-05 3584 if (is_crystal_clock)
96b06c0a16f737 Chris Packham 2020-02-05 3585 initialize_flags |= CVMX_USB_INITIALIZE_FLAGS_CLOCK_XO_XI;
96b06c0a16f737 Chris Packham 2020-02-05 3586 else
96b06c0a16f737 Chris Packham 2020-02-05 3587 initialize_flags |= CVMX_USB_INITIALIZE_FLAGS_CLOCK_XO_GND;
96b06c0a16f737 Chris Packham 2020-02-05 3588
96b06c0a16f737 Chris Packham 2020-02-05 3589 res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
96b06c0a16f737 Chris Packham 2020-02-05 3590 if (!res_mem) {
96b06c0a16f737 Chris Packham 2020-02-05 3591 dev_err(dev, "found no memory resource\n");
96b06c0a16f737 Chris Packham 2020-02-05 3592 return -ENXIO;
96b06c0a16f737 Chris Packham 2020-02-05 3593 }
96b06c0a16f737 Chris Packham 2020-02-05 3594 usb_num = (res_mem->start >> 44) & 1;
96b06c0a16f737 Chris Packham 2020-02-05 3595
96b06c0a16f737 Chris Packham 2020-02-05 3596 if (irq < 0) {
96b06c0a16f737 Chris Packham 2020-02-05 3597 /* Defective device tree, but we know how to fix it. */
96b06c0a16f737 Chris Packham 2020-02-05 3598 irq_hw_number_t hwirq = usb_num ? (1 << 6) + 17 : 56;
96b06c0a16f737 Chris Packham 2020-02-05 3599
96b06c0a16f737 Chris Packham 2020-02-05 @3600 irq = irq_create_mapping(NULL, hwirq);
96b06c0a16f737 Chris Packham 2020-02-05 3601 }
96b06c0a16f737 Chris Packham 2020-02-05 3602
96b06c0a16f737 Chris Packham 2020-02-05 3603 /*
96b06c0a16f737 Chris Packham 2020-02-05 3604 * Set the DMA mask to 64bits so we get buffers already translated for
96b06c0a16f737 Chris Packham 2020-02-05 3605 * DMA.
96b06c0a16f737 Chris Packham 2020-02-05 3606 */
96b06c0a16f737 Chris Packham 2020-02-05 3607 i = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(64));
96b06c0a16f737 Chris Packham 2020-02-05 3608 if (i)
96b06c0a16f737 Chris Packham 2020-02-05 3609 return i;
96b06c0a16f737 Chris Packham 2020-02-05 3610
96b06c0a16f737 Chris Packham 2020-02-05 3611 /*
96b06c0a16f737 Chris Packham 2020-02-05 3612 * Only cn52XX and cn56XX have DWC_OTG USB hardware and the
96b06c0a16f737 Chris Packham 2020-02-05 3613 * IOB priority registers. Under heavy network load USB
96b06c0a16f737 Chris Packham 2020-02-05 3614 * hardware can be starved by the IOB causing a crash. Give
96b06c0a16f737 Chris Packham 2020-02-05 3615 * it a priority boost if it has been waiting more than 400
96b06c0a16f737 Chris Packham 2020-02-05 3616 * cycles to avoid this situation.
96b06c0a16f737 Chris Packham 2020-02-05 3617 *
96b06c0a16f737 Chris Packham 2020-02-05 3618 * Testing indicates that a cnt_val of 8192 is not sufficient,
96b06c0a16f737 Chris Packham 2020-02-05 3619 * but no failures are seen with 4096. We choose a value of
96b06c0a16f737 Chris Packham 2020-02-05 3620 * 400 to give a safety factor of 10.
96b06c0a16f737 Chris Packham 2020-02-05 3621 */
96b06c0a16f737 Chris Packham 2020-02-05 3622 if (OCTEON_IS_MODEL(OCTEON_CN52XX) || OCTEON_IS_MODEL(OCTEON_CN56XX)) {
96b06c0a16f737 Chris Packham 2020-02-05 3623 union cvmx_iob_n2c_l2c_pri_cnt pri_cnt;
96b06c0a16f737 Chris Packham 2020-02-05 3624
96b06c0a16f737 Chris Packham 2020-02-05 3625 pri_cnt.u64 = 0;
96b06c0a16f737 Chris Packham 2020-02-05 3626 pri_cnt.s.cnt_enb = 1;
96b06c0a16f737 Chris Packham 2020-02-05 3627 pri_cnt.s.cnt_val = 400;
96b06c0a16f737 Chris Packham 2020-02-05 3628 cvmx_write_csr(CVMX_IOB_N2C_L2C_PRI_CNT, pri_cnt.u64);
96b06c0a16f737 Chris Packham 2020-02-05 3629 }
96b06c0a16f737 Chris Packham 2020-02-05 3630
96b06c0a16f737 Chris Packham 2020-02-05 3631 hcd = usb_create_hcd(&octeon_hc_driver, dev, dev_name(dev));
96b06c0a16f737 Chris Packham 2020-02-05 3632 if (!hcd) {
96b06c0a16f737 Chris Packham 2020-02-05 3633 dev_dbg(dev, "Failed to allocate memory for HCD\n");
96b06c0a16f737 Chris Packham 2020-02-05 3634 return -1;
96b06c0a16f737 Chris Packham 2020-02-05 3635 }
96b06c0a16f737 Chris Packham 2020-02-05 3636 hcd->uses_new_polling = 1;
96b06c0a16f737 Chris Packham 2020-02-05 3637 usb = (struct octeon_hcd *)hcd->hcd_priv;
96b06c0a16f737 Chris Packham 2020-02-05 3638
96b06c0a16f737 Chris Packham 2020-02-05 3639 spin_lock_init(&usb->lock);
96b06c0a16f737 Chris Packham 2020-02-05 3640
96b06c0a16f737 Chris Packham 2020-02-05 3641 usb->init_flags = initialize_flags;
96b06c0a16f737 Chris Packham 2020-02-05 3642
96b06c0a16f737 Chris Packham 2020-02-05 3643 /* Initialize the USB state structure */
96b06c0a16f737 Chris Packham 2020-02-05 3644 usb->index = usb_num;
96b06c0a16f737 Chris Packham 2020-02-05 3645 INIT_LIST_HEAD(&usb->idle_pipes);
96b06c0a16f737 Chris Packham 2020-02-05 3646 for (i = 0; i < ARRAY_SIZE(usb->active_pipes); i++)
96b06c0a16f737 Chris Packham 2020-02-05 3647 INIT_LIST_HEAD(&usb->active_pipes[i]);
96b06c0a16f737 Chris Packham 2020-02-05 3648
96b06c0a16f737 Chris Packham 2020-02-05 3649 /* Due to an errata, CN31XX doesn't support DMA */
96b06c0a16f737 Chris Packham 2020-02-05 3650 if (OCTEON_IS_MODEL(OCTEON_CN31XX)) {
96b06c0a16f737 Chris Packham 2020-02-05 3651 usb->init_flags |= CVMX_USB_INITIALIZE_FLAGS_NO_DMA;
96b06c0a16f737 Chris Packham 2020-02-05 3652 /* Only use one channel with non DMA */
96b06c0a16f737 Chris Packham 2020-02-05 3653 usb->idle_hardware_channels = 0x1;
96b06c0a16f737 Chris Packham 2020-02-05 3654 } else if (OCTEON_IS_MODEL(OCTEON_CN5XXX)) {
96b06c0a16f737 Chris Packham 2020-02-05 3655 /* CN5XXX have an errata with channel 3 */
96b06c0a16f737 Chris Packham 2020-02-05 3656 usb->idle_hardware_channels = 0xf7;
96b06c0a16f737 Chris Packham 2020-02-05 3657 } else {
96b06c0a16f737 Chris Packham 2020-02-05 3658 usb->idle_hardware_channels = 0xff;
96b06c0a16f737 Chris Packham 2020-02-05 3659 }
96b06c0a16f737 Chris Packham 2020-02-05 3660
96b06c0a16f737 Chris Packham 2020-02-05 3661 status = cvmx_usb_initialize(dev, usb);
96b06c0a16f737 Chris Packham 2020-02-05 3662 if (status) {
96b06c0a16f737 Chris Packham 2020-02-05 3663 dev_dbg(dev, "USB initialization failed with %d\n", status);
96b06c0a16f737 Chris Packham 2020-02-05 3664 usb_put_hcd(hcd);
96b06c0a16f737 Chris Packham 2020-02-05 3665 return -1;
96b06c0a16f737 Chris Packham 2020-02-05 3666 }
96b06c0a16f737 Chris Packham 2020-02-05 3667
96b06c0a16f737 Chris Packham 2020-02-05 3668 status = usb_add_hcd(hcd, irq, 0);
96b06c0a16f737 Chris Packham 2020-02-05 3669 if (status) {
96b06c0a16f737 Chris Packham 2020-02-05 3670 dev_dbg(dev, "USB add HCD failed with %d\n", status);
96b06c0a16f737 Chris Packham 2020-02-05 3671 usb_put_hcd(hcd);
96b06c0a16f737 Chris Packham 2020-02-05 3672 return -1;
96b06c0a16f737 Chris Packham 2020-02-05 3673 }
96b06c0a16f737 Chris Packham 2020-02-05 3674 device_wakeup_enable(hcd->self.controller);
96b06c0a16f737 Chris Packham 2020-02-05 3675
96b06c0a16f737 Chris Packham 2020-02-05 3676 dev_info(dev, "Registered HCD for port %d on irq %d\n", usb_num, irq);
96b06c0a16f737 Chris Packham 2020-02-05 3677
96b06c0a16f737 Chris Packham 2020-02-05 3678 return 0;
96b06c0a16f737 Chris Packham 2020-02-05 3679 }
96b06c0a16f737 Chris Packham 2020-02-05 3680
:::::: The code at line 3548 was first introduced by commit
:::::: 96b06c0a16f737e9ea7dff1e23dd5f6d847e6731 Revert "staging: octeon-usb: delete the octeon usb host controller driver"
:::::: TO: Chris Packham <chris.packham(a)alliedtelesis.co.nz>
:::::: CC: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months