Hi Christophe, [FYI, it's a private test report for your RFC patch.] [auto build test ERROR on akpm-mm/mm-everything] url: https://github.com/intel-lab-lkp/linux/commits/Christophe-Leroy/mm-ioremap-Convert-architectures-to-take-GENERIC_IOREMAP-way-Alternative/20221012-181225 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/981a7ee95c2556ca24557414adffb5e90605617b.1665568707.git.christophe.leroy%40csgroup.eu patch subject: [RFC PATCH 1/8] hexagon: mm: Convert to GENERIC_IOREMAP config: hexagon-randconfig-r041-20221012 compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920) 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://github.com/intel-lab-lkp/linux/commit/87f17eee261053f3458af0eee2c33be07b6053cd git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Christophe-Leroy/mm-ioremap-Convert-architectures-to-take-GENERIC_IOREMAP-way-Alternative/20221012-181225 git checkout 87f17eee261053f3458af0eee2c33be07b6053cd # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash arch/hexagon/kernel/ drivers/char/tpm/ drivers/clocksource/ drivers/dma/ drivers/gpio/ drivers/i2c/busses/ drivers/iio/adc/ drivers/input/serio/ drivers/mfd/ drivers/mtd/devices/ drivers/mtd/maps/ drivers/mtd/nand/onenand/ drivers/mtd/nand/raw/ drivers/of/ drivers/parport/ drivers/reset/ drivers/rtc/ drivers/soc/fsl/ drivers/soc/renesas/ drivers/ssb/ drivers/uio/ drivers/usb/c67x00/ drivers/usb/gadget/udc/ drivers/usb/host/ drivers/vfio/platform/ drivers/video/fbdev/ drivers/watchdog/ kernel/ lib/ mm/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All error/warnings (new ones prefixed by >>): >> arch/hexagon/kernel/time.c:175:15: error: call to undeclared function 'ioremap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] rtos_timer = ioremap(resource->start, resource_size(resource)); ^ arch/hexagon/kernel/time.c:175:15: note: did you mean 'iounmap'? arch/hexagon/include/asm/io.h:30:13: note: 'iounmap' declared here extern void iounmap(const volatile void __iomem *addr); ^ >> arch/hexagon/kernel/time.c:175:13: error: incompatible integer to pointer conversion assigning to 'struct adsp_hw_timer_struct *' from 'int' [-Wint-conversion] rtos_timer = ioremap(resource->start, resource_size(resource)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/hexagon/kernel/time.c:163:13: warning: no previous prototype for function 'time_init_deferred' [-Wmissing-prototypes] void __init time_init_deferred(void) ^ arch/hexagon/kernel/time.c:163:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void __init time_init_deferred(void) ^ static arch/hexagon/kernel/time.c:204:13: warning: no previous prototype for function 'time_init' [-Wmissing-prototypes] void __init time_init(void) ^ arch/hexagon/kernel/time.c:204:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void __init time_init(void) ^ static arch/hexagon/kernel/time.c:209:6: warning: no previous prototype for function '__delay' [-Wmissing-prototypes] void __delay(unsigned long cycles) ^ arch/hexagon/kernel/time.c:209:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void __delay(unsigned long cycles) ^ static arch/hexagon/kernel/time.c:224:6: warning: no previous prototype for function '__udelay' [-Wmissing-prototypes] void __udelay(unsigned long usecs) ^ arch/hexagon/kernel/time.c:224:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void __udelay(unsigned long usecs) ^ static 4 warnings and 2 errors generated. -- >> kernel/iomem.c:11:9: error: call to undeclared function 'ioremap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] return ioremap(offset, size); ^ kernel/iomem.c:11:9: note: did you mean 'iounmap'? arch/hexagon/include/asm/io.h:30:13: note: 'iounmap' declared here extern void iounmap(const volatile void __iomem *addr); ^ >> kernel/iomem.c:11:9: error: incompatible integer to pointer conversion returning 'int' from a function with result type 'void *' [-Wint-conversion] return ioremap(offset, size); ^~~~~~~~~~~~~~~~~~~~~ kernel/iomem.c:9:22: warning: no previous prototype for function 'ioremap_cache' [-Wmissing-prototypes] __weak void __iomem *ioremap_cache(resource_size_t offset, unsigned long size) ^ kernel/iomem.c:9:8: note: declare 'static' if the function is not intended to be used outside of this translation unit __weak void __iomem *ioremap_cache(resource_size_t offset, unsigned long size) ^ static kernel/iomem.c:113:10: error: call to undeclared function 'ioremap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] addr = ioremap_wt(offset, size); ^ include/asm-generic/iomap.h:101:20: note: expanded from macro 'ioremap_wt' #define ioremap_wt ioremap ^ >> kernel/iomem.c:113:8: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion] addr = ioremap_wt(offset, size); ^ ~~~~~~~~~~~~~~~~~~~~~~~~ kernel/iomem.c:116:8: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion] addr = ioremap_wc(offset, size); ^ ~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning and 5 errors generated. -- >> mm/ioremap.c:31:7: error: call to undeclared function 'ioremap_allowed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] if (!ioremap_allowed(phys_addr, size, prot)) ^ >> mm/ioremap.c:14:15: warning: no previous prototype for function 'ioremap_prot' [-Wmissing-prototypes] void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size, ^ mm/ioremap.c:14:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size, ^ static >> mm/ioremap.c:51:6: error: conflicting types for 'iounmap' void iounmap(volatile void __iomem *addr) ^ arch/hexagon/include/asm/io.h:30:13: note: previous declaration is here extern void iounmap(const volatile void __iomem *addr); ^ >> mm/ioremap.c:55:7: error: call to undeclared function 'iounmap_allowed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] if (!iounmap_allowed(vaddr)) ^ 1 warning and 3 errors generated. -- >> drivers/clocksource/timer-davinci.c:263:9: error: call to undeclared function 'ioremap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] base = ioremap(timer_cfg->reg.start, resource_size(&timer_cfg->reg)); ^ drivers/clocksource/timer-davinci.c:263:9: note: did you mean 'iounmap'? arch/hexagon/include/asm/io.h:30:13: note: 'iounmap' declared here extern void iounmap(const volatile void __iomem *addr); ^ >> drivers/clocksource/timer-davinci.c:263:7: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion] base = ioremap(timer_cfg->reg.start, resource_size(&timer_cfg->reg)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. -- >> drivers/dma/sa11x0-dma.c:925:12: error: call to undeclared function 'ioremap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] d->base = ioremap(res->start, resource_size(res)); ^ drivers/dma/sa11x0-dma.c:925:12: note: did you mean 'iounmap'? arch/hexagon/include/asm/io.h:30:13: note: 'iounmap' declared here extern void iounmap(const volatile void __iomem *addr); ^ >> drivers/dma/sa11x0-dma.c:925:10: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion] d->base = ioremap(res->start, resource_size(res)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. -- >> drivers/dma/timb_dma.c:647:16: error: call to undeclared function 'ioremap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] td->membase = ioremap(iomem->start, resource_size(iomem)); ^ drivers/dma/timb_dma.c:647:16: note: did you mean 'iounmap'? arch/hexagon/include/asm/io.h:30:13: note: 'iounmap' declared here extern void iounmap(const volatile void __iomem *addr); ^ >> drivers/dma/timb_dma.c:647:14: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion] td->membase = ioremap(iomem->start, resource_size(iomem)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. -- >> drivers/gpio/gpio-menz127.c:148:28: error: call to undeclared function 'ioremap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] men_z127_gpio->reg_base = ioremap(men_z127_gpio->mem->start, ^ drivers/gpio/gpio-menz127.c:148:28: note: did you mean 'iounmap'? arch/hexagon/include/asm/io.h:30:13: note: 'iounmap' declared here extern void iounmap(const volatile void __iomem *addr); ^ >> drivers/gpio/gpio-menz127.c:148:26: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion] men_z127_gpio->reg_base = ioremap(men_z127_gpio->mem->start, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. -- >> drivers/input/serio/sun4i-ps2.c:233:22: error: call to undeclared function 'ioremap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] drvdata->reg_base = ioremap(res->start, resource_size(res)); ^ drivers/input/serio/sun4i-ps2.c:233:22: note: did you mean 'iounmap'? arch/hexagon/include/asm/io.h:30:13: note: 'iounmap' declared here extern void iounmap(const volatile void __iomem *addr); ^ >> drivers/input/serio/sun4i-ps2.c:233:20: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion] drvdata->reg_base = ioremap(res->start, resource_size(res)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. -- >> drivers/mfd/sm501.c:1411:13: error: call to undeclared function 'ioremap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] sm->regs = ioremap(sm->io_res->start, resource_size(sm->io_res)); ^ drivers/mfd/sm501.c:1411:13: note: did you mean 'iounmap'? arch/hexagon/include/asm/io.h:30:13: note: 'iounmap' declared here extern void iounmap(const volatile void __iomem *addr); ^ >> drivers/mfd/sm501.c:1411:11: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion] sm->regs = ioremap(sm->io_res->start, resource_size(sm->io_res)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. -- >> drivers/mfd/asic3.c:891:20: error: call to undeclared function 'ioremap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] asic->tmio_cnf = ioremap((ASIC3_SD_CONFIG_BASE >> ^ drivers/mfd/asic3.c:891:20: note: did you mean 'iounmap'? arch/hexagon/include/asm/io.h:30:13: note: 'iounmap' declared here extern void iounmap(const volatile void __iomem *addr); ^ >> drivers/mfd/asic3.c:891:18: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion] asic->tmio_cnf = ioremap((ASIC3_SD_CONFIG_BASE >> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mfd/asic3.c:970:18: error: call to undeclared function 'ioremap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] asic->mapping = ioremap(mem->start, resource_size(mem)); ^ drivers/mfd/asic3.c:970:16: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion] asic->mapping = ioremap(mem->start, resource_size(mem)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 errors generated. -- >> drivers/mfd/htc-pasic3.c:153:18: error: call to undeclared function 'ioremap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] asic->mapping = ioremap(r->start, resource_size(r)); ^ drivers/mfd/htc-pasic3.c:153:18: note: did you mean 'iounmap'? arch/hexagon/include/asm/io.h:30:13: note: 'iounmap' declared here extern void iounmap(const volatile void __iomem *addr); ^ >> drivers/mfd/htc-pasic3.c:153:16: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion] asic->mapping = ioremap(r->start, resource_size(r)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. .. vim +/ioremap_allowed +31 mm/ioremap.c 74588d8ba34ff1 lib/ioremap.c Haavard Skinnemoen 2006-09-30 13 abc5992b9dd0ba mm/ioremap.c Kefeng Wang 2022-06-07 @14 void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size, abc5992b9dd0ba mm/ioremap.c Kefeng Wang 2022-06-07 15 unsigned long prot) 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 16 { 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 17 unsigned long offset, vaddr; 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 18 phys_addr_t last_addr; 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 19 struct vm_struct *area; 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 20 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 21 /* Disallow wrap-around or zero size */ abc5992b9dd0ba mm/ioremap.c Kefeng Wang 2022-06-07 22 last_addr = phys_addr + size - 1; abc5992b9dd0ba mm/ioremap.c Kefeng Wang 2022-06-07 23 if (!size || last_addr < phys_addr) 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 24 return NULL; 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 25 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 26 /* Page-align mappings */ abc5992b9dd0ba mm/ioremap.c Kefeng Wang 2022-06-07 27 offset = phys_addr & (~PAGE_MASK); abc5992b9dd0ba mm/ioremap.c Kefeng Wang 2022-06-07 28 phys_addr -= offset; 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 29 size = PAGE_ALIGN(size + offset); 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 30 18e780b4e6ab89 mm/ioremap.c Kefeng Wang 2022-06-07 @31 if (!ioremap_allowed(phys_addr, size, prot)) 18e780b4e6ab89 mm/ioremap.c Kefeng Wang 2022-06-07 32 return NULL; 18e780b4e6ab89 mm/ioremap.c Kefeng Wang 2022-06-07 33 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 34 area = get_vm_area_caller(size, VM_IOREMAP, 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 35 __builtin_return_address(0)); 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 36 if (!area) 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 37 return NULL; 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 38 vaddr = (unsigned long)area->addr; a14fff1c0379d0 mm/ioremap.c Kefeng Wang 2022-06-07 39 area->phys_addr = phys_addr; 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 40 abc5992b9dd0ba mm/ioremap.c Kefeng Wang 2022-06-07 41 if (ioremap_page_range(vaddr, vaddr + size, phys_addr, abc5992b9dd0ba mm/ioremap.c Kefeng Wang 2022-06-07 42 __pgprot(prot))) { 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 43 free_vm_area(area); 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 44 return NULL; 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 45 } 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 46 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 47 return (void __iomem *)(vaddr + offset); 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 48 } 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 49 EXPORT_SYMBOL(ioremap_prot); 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 50 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 @51 void iounmap(volatile void __iomem *addr) 80b0ca98f91ddb lib/ioremap.c Christoph Hellwig 2019-08-13 52 { 18e780b4e6ab89 mm/ioremap.c Kefeng Wang 2022-06-07 53 void *vaddr = (void *)((unsigned long)addr & PAGE_MASK); 18e780b4e6ab89 mm/ioremap.c Kefeng Wang 2022-06-07 54 18e780b4e6ab89 mm/ioremap.c Kefeng Wang 2022-06-07 @55 if (!iounmap_allowed(vaddr)) -- 0-DAY CI Kernel Test Service https://01.org/lkp