tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: ccc252d2e818f6a479441119ad453c3ce7c7c461 commit: 64ff646f76f5f1f9777dc5be87942980f44755e0 [7367/7430] Merge remote-tracking branch 'scsi-mkp/for-next' config: riscv-randconfig-r036-20210605 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8ec9aa236e325fd4629cfeefac2919302e14d61a) 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 riscv cross compiling tool for clang build # apt-get install binutils-riscv64-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=64ff646f76f5f1f9777dc5be87942980f44755e0 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 64ff646f76f5f1f9777dc5be87942980f44755e0 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): In file included from drivers/scsi/mpi3mr/mpi3mr_fw.c:10: In file included from drivers/scsi/mpi3mr/mpi3mr.h:13: In file included from include/linux/blkdev.h:8: In file included from include/linux/genhd.h:19: In file included from include/linux/blk_types.h:10: In file included from include/linux/bvec.h:14: In file included from include/linux/mm.h:33: In file included from include/linux/pgtable.h:6: arch/riscv/include/asm/pgtable.h:519:9: error: implicit declaration of function 'pfn_pmd' [-Werror,-Wimplicit-function-declaration] return pfn_pmd(page_to_pfn(page), prot); ^ arch/riscv/include/asm/pgtable.h:519:9: note: did you mean 'pfn_pgd'? arch/riscv/include/asm/pgtable.h:220:21: note: 'pfn_pgd' declared here static inline pgd_t pfn_pgd(unsigned long pfn, pgprot_t prot) ^ arch/riscv/include/asm/pgtable.h:519:17: error: implicit declaration of function 'page_to_section' [-Werror,-Wimplicit-function-declaration] return pfn_pmd(page_to_pfn(page), prot); ^ include/asm-generic/memory_model.h:81:21: note: expanded from macro 'page_to_pfn' #define page_to_pfn __page_to_pfn ^ include/asm-generic/memory_model.h:64:14: note: expanded from macro '__page_to_pfn' int __sec = page_to_section(__pg); \ ^ arch/riscv/include/asm/pgtable.h:519:17: note: did you mean '__nr_to_section'? include/asm-generic/memory_model.h:81:21: note: expanded from macro 'page_to_pfn' #define page_to_pfn __page_to_pfn ^ include/asm-generic/memory_model.h:64:14: note: expanded from macro '__page_to_pfn' int __sec = page_to_section(__pg); \ ^ include/linux/mmzone.h:1314:35: note: '__nr_to_section' declared here static inline struct mem_section *__nr_to_section(unsigned long nr) ^ In file included from drivers/scsi/mpi3mr/mpi3mr_fw.c:10: In file included from drivers/scsi/mpi3mr/mpi3mr.h:13: In file included from include/linux/blkdev.h:8: In file included from include/linux/genhd.h:19: In file included from include/linux/blk_types.h:10: In file included from include/linux/bvec.h:14: In file included from include/linux/mm.h:33: In file included from include/linux/pgtable.h:6: arch/riscv/include/asm/pgtable.h:519:9: error: returning 'int' from a function with incompatible result type 'pmd_t' return pfn_pmd(page_to_pfn(page), prot); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/scsi/mpi3mr/mpi3mr_fw.c:10: In file included from drivers/scsi/mpi3mr/mpi3mr.h:13: In file included from include/linux/blkdev.h:8: In file included from include/linux/genhd.h:19: In file included from include/linux/blk_types.h:10: In file included from include/linux/bvec.h:14: include/linux/mm.h:1552:29: error: static declaration of 'page_to_section' follows non-static declaration static inline unsigned long page_to_section(const struct page *page) ^ arch/riscv/include/asm/pgtable.h:519:17: note: previous implicit declaration is here return pfn_pmd(page_to_pfn(page), prot); ^ include/asm-generic/memory_model.h:81:21: note: expanded from macro 'page_to_pfn' #define page_to_pfn __page_to_pfn ^ include/asm-generic/memory_model.h:64:14: note: expanded from macro '__page_to_pfn' int __sec = page_to_section(__pg); \ ^ >> drivers/scsi/mpi3mr/mpi3mr_fw.c:3126:34: warning: shift count >= width of type [-Wshift-count-overflow] (sizeof(dma_addr_t) > 4)) ? DMA_BIT_MASK(64) : DMA_BIT_MASK(32)); ^~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ ~~~ 1 warning and 4 errors generated. vim +3126 drivers/scsi/mpi3mr/mpi3mr_fw.c 824a156633dfdb Kashyap Desai 2021-05-20 3109 824a156633dfdb Kashyap Desai 2021-05-20 3110 /** 824a156633dfdb Kashyap Desai 2021-05-20 3111 * mpi3mr_setup_resources - Enable PCI resources 824a156633dfdb Kashyap Desai 2021-05-20 3112 * @mrioc: Adapter instance reference 824a156633dfdb Kashyap Desai 2021-05-20 3113 * 824a156633dfdb Kashyap Desai 2021-05-20 3114 * Enable PCI device memory, MSI-x registers and set DMA mask. 824a156633dfdb Kashyap Desai 2021-05-20 3115 * 824a156633dfdb Kashyap Desai 2021-05-20 3116 * Return: 0 on success and non-zero on failure. 824a156633dfdb Kashyap Desai 2021-05-20 3117 */ 824a156633dfdb Kashyap Desai 2021-05-20 3118 int mpi3mr_setup_resources(struct mpi3mr_ioc *mrioc) 824a156633dfdb Kashyap Desai 2021-05-20 3119 { 824a156633dfdb Kashyap Desai 2021-05-20 3120 struct pci_dev *pdev = mrioc->pdev; 824a156633dfdb Kashyap Desai 2021-05-20 3121 u32 memap_sz = 0; 824a156633dfdb Kashyap Desai 2021-05-20 3122 int i, retval = 0, capb = 0; 824a156633dfdb Kashyap Desai 2021-05-20 3123 u16 message_control; 824a156633dfdb Kashyap Desai 2021-05-20 3124 u64 dma_mask = mrioc->dma_mask ? mrioc->dma_mask : 824a156633dfdb Kashyap Desai 2021-05-20 3125 (((dma_get_required_mask(&pdev->dev) > DMA_BIT_MASK(32)) && 824a156633dfdb Kashyap Desai 2021-05-20 @3126 (sizeof(dma_addr_t) > 4)) ? DMA_BIT_MASK(64) : DMA_BIT_MASK(32)); 824a156633dfdb Kashyap Desai 2021-05-20 3127 824a156633dfdb Kashyap Desai 2021-05-20 3128 if (pci_enable_device_mem(pdev)) { 824a156633dfdb Kashyap Desai 2021-05-20 3129 ioc_err(mrioc, "pci_enable_device_mem: failed\n"); 824a156633dfdb Kashyap Desai 2021-05-20 3130 retval = -ENODEV; 824a156633dfdb Kashyap Desai 2021-05-20 3131 goto out_failed; 824a156633dfdb Kashyap Desai 2021-05-20 3132 } 824a156633dfdb Kashyap Desai 2021-05-20 3133 824a156633dfdb Kashyap Desai 2021-05-20 3134 capb = pci_find_capability(pdev, PCI_CAP_ID_MSIX); 824a156633dfdb Kashyap Desai 2021-05-20 3135 if (!capb) { 824a156633dfdb Kashyap Desai 2021-05-20 3136 ioc_err(mrioc, "Unable to find MSI-X Capabilities\n"); 824a156633dfdb Kashyap Desai 2021-05-20 3137 retval = -ENODEV; 824a156633dfdb Kashyap Desai 2021-05-20 3138 goto out_failed; 824a156633dfdb Kashyap Desai 2021-05-20 3139 } 824a156633dfdb Kashyap Desai 2021-05-20 3140 mrioc->bars = pci_select_bars(pdev, IORESOURCE_MEM); 824a156633dfdb Kashyap Desai 2021-05-20 3141 824a156633dfdb Kashyap Desai 2021-05-20 3142 if (pci_request_selected_regions(pdev, mrioc->bars, 824a156633dfdb Kashyap Desai 2021-05-20 3143 mrioc->driver_name)) { 824a156633dfdb Kashyap Desai 2021-05-20 3144 ioc_err(mrioc, "pci_request_selected_regions: failed\n"); 824a156633dfdb Kashyap Desai 2021-05-20 3145 retval = -ENODEV; 824a156633dfdb Kashyap Desai 2021-05-20 3146 goto out_failed; 824a156633dfdb Kashyap Desai 2021-05-20 3147 } 824a156633dfdb Kashyap Desai 2021-05-20 3148 824a156633dfdb Kashyap Desai 2021-05-20 3149 for (i = 0; (i < DEVICE_COUNT_RESOURCE); i++) { 824a156633dfdb Kashyap Desai 2021-05-20 3150 if (pci_resource_flags(pdev, i) & IORESOURCE_MEM) { 824a156633dfdb Kashyap Desai 2021-05-20 3151 mrioc->sysif_regs_phys = pci_resource_start(pdev, i); 824a156633dfdb Kashyap Desai 2021-05-20 3152 memap_sz = pci_resource_len(pdev, i); 824a156633dfdb Kashyap Desai 2021-05-20 3153 mrioc->sysif_regs = 824a156633dfdb Kashyap Desai 2021-05-20 3154 ioremap(mrioc->sysif_regs_phys, memap_sz); 824a156633dfdb Kashyap Desai 2021-05-20 3155 break; 824a156633dfdb Kashyap Desai 2021-05-20 3156 } 824a156633dfdb Kashyap Desai 2021-05-20 3157 } 824a156633dfdb Kashyap Desai 2021-05-20 3158 824a156633dfdb Kashyap Desai 2021-05-20 3159 pci_set_master(pdev); 824a156633dfdb Kashyap Desai 2021-05-20 3160 824a156633dfdb Kashyap Desai 2021-05-20 3161 retval = dma_set_mask_and_coherent(&pdev->dev, dma_mask); 824a156633dfdb Kashyap Desai 2021-05-20 3162 if (retval) { 824a156633dfdb Kashyap Desai 2021-05-20 3163 if (dma_mask != DMA_BIT_MASK(32)) { 824a156633dfdb Kashyap Desai 2021-05-20 3164 ioc_warn(mrioc, "Setting 64 bit DMA mask failed\n"); 824a156633dfdb Kashyap Desai 2021-05-20 3165 dma_mask = DMA_BIT_MASK(32); 824a156633dfdb Kashyap Desai 2021-05-20 3166 retval = dma_set_mask_and_coherent(&pdev->dev, 824a156633dfdb Kashyap Desai 2021-05-20 3167 dma_mask); 824a156633dfdb Kashyap Desai 2021-05-20 3168 } 824a156633dfdb Kashyap Desai 2021-05-20 3169 if (retval) { 824a156633dfdb Kashyap Desai 2021-05-20 3170 mrioc->dma_mask = 0; 824a156633dfdb Kashyap Desai 2021-05-20 3171 ioc_err(mrioc, "Setting 32 bit DMA mask also failed\n"); 824a156633dfdb Kashyap Desai 2021-05-20 3172 goto out_failed; 824a156633dfdb Kashyap Desai 2021-05-20 3173 } 824a156633dfdb Kashyap Desai 2021-05-20 3174 } 824a156633dfdb Kashyap Desai 2021-05-20 3175 mrioc->dma_mask = dma_mask; 824a156633dfdb Kashyap Desai 2021-05-20 3176 824a156633dfdb Kashyap Desai 2021-05-20 3177 if (!mrioc->sysif_regs) { 824a156633dfdb Kashyap Desai 2021-05-20 3178 ioc_err(mrioc, 824a156633dfdb Kashyap Desai 2021-05-20 3179 "Unable to map adapter memory or resource not found\n"); 824a156633dfdb Kashyap Desai 2021-05-20 3180 retval = -EINVAL; 824a156633dfdb Kashyap Desai 2021-05-20 3181 goto out_failed; 824a156633dfdb Kashyap Desai 2021-05-20 3182 } 824a156633dfdb Kashyap Desai 2021-05-20 3183 824a156633dfdb Kashyap Desai 2021-05-20 3184 pci_read_config_word(pdev, capb + 2, &message_control); 824a156633dfdb Kashyap Desai 2021-05-20 3185 mrioc->msix_count = (message_control & 0x3FF) + 1; 824a156633dfdb Kashyap Desai 2021-05-20 3186 824a156633dfdb Kashyap Desai 2021-05-20 3187 pci_save_state(pdev); 824a156633dfdb Kashyap Desai 2021-05-20 3188 824a156633dfdb Kashyap Desai 2021-05-20 3189 pci_set_drvdata(pdev, mrioc->shost); 824a156633dfdb Kashyap Desai 2021-05-20 3190 824a156633dfdb Kashyap Desai 2021-05-20 3191 mpi3mr_ioc_disable_intr(mrioc); 824a156633dfdb Kashyap Desai 2021-05-20 3192 824a156633dfdb Kashyap Desai 2021-05-20 3193 ioc_info(mrioc, "iomem(0x%016llx), mapped(0x%p), size(%d)\n", 824a156633dfdb Kashyap Desai 2021-05-20 3194 (unsigned long long)mrioc->sysif_regs_phys, 824a156633dfdb Kashyap Desai 2021-05-20 3195 mrioc->sysif_regs, memap_sz); 824a156633dfdb Kashyap Desai 2021-05-20 3196 ioc_info(mrioc, "Number of MSI-X vectors found in capabilities: (%d)\n", 824a156633dfdb Kashyap Desai 2021-05-20 3197 mrioc->msix_count); 824a156633dfdb Kashyap Desai 2021-05-20 3198 return retval; 824a156633dfdb Kashyap Desai 2021-05-20 3199 824a156633dfdb Kashyap Desai 2021-05-20 3200 out_failed: 824a156633dfdb Kashyap Desai 2021-05-20 3201 mpi3mr_cleanup_resources(mrioc); 824a156633dfdb Kashyap Desai 2021-05-20 3202 return retval; 824a156633dfdb Kashyap Desai 2021-05-20 3203 } 824a156633dfdb Kashyap Desai 2021-05-20 3204 :::::: The code at line 3126 was first introduced by commit :::::: 824a156633dfdb0e17979a0d0bb2c757d1bb949c scsi: mpi3mr: Base driver code :::::: TO: Kashyap Desai :::::: CC: Martin K. Petersen --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org