Content-Type: multipart/mixed; boundary="===============2621051805511202625==" MIME-Version: 1.0 From: Baoquan He To: kbuild-all@lists.01.org Subject: Re: [PATCH v2 10/11] sh: mm: Convert to GENERIC_IOREMAP Date: Fri, 02 Sep 2022 17:48:37 +0800 Message-ID: In-Reply-To: <202208201146.8VeY9pez-lkp@intel.com> List-Id: --===============2621051805511202625== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 08/20/22 at 11:41am, kernel test robot wrote: > Hi Baoquan, > = > I love your patch! Yet something to improve: > = > [auto build test ERROR on akpm-mm/mm-everything] > = > url: https://github.com/intel-lab-lkp/linux/commits/Baoquan-He/mm-iore= map-Convert-architectures-to-take-GENERIC_IOREMAP-way/20220820-083435 > base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-ev= erything > config: sh-allmodconfig > compiler: sh4-linux-gcc (GCC) 12.1.0 > reproduce (this is a W=3D1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbi= n/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://github.com/intel-lab-lkp/linux/commit/503a31451202f89e5= 8bc5f0a49261398fafbd90e > git remote add linux-review https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review Baoquan-He/mm-ioremap-Convert-ar= chitectures-to-take-GENERIC_IOREMAP-way/20220820-083435 > git checkout 503a31451202f89e58bc5f0a49261398fafbd90e > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-12.1.0 make.cro= ss W=3D1 O=3Dbuild_dir ARCH=3Dsh prepare I finally find gcc-sh-linux-gnu and its dependency on rpmfind.net, and succeeded to reproduce the building failure. isl-0.16.1-13 cross-gcc-common gcc-sh-linux-gnu Based on previous fixing patch for parisc, below draft patch can fix all reported building issues on sh. diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index 3c5ff82a511a..eb550c72922d 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h @@ -225,6 +225,9 @@ __BUILD_IOPORT_STRING(q, u64) #define IO_SPACE_LIMIT 0xffffffff = /* We really want to try and get these to memcpy etc */ +#define memset_io memset_io +#define memcpy_fromio memcpy_fromio +#define memcpy_toio memcpy_toio void memcpy_fromio(void *, const volatile void __iomem *, unsigned long); void memcpy_toio(volatile void __iomem *, const void *, unsigned long); void memset_io(volatile void __iomem *, int, unsigned long); @@ -256,18 +259,17 @@ int arch_iounmap(void __iomem *addr); = #define ioremap_cache(addr, size) \ ioremap_prot((addr), (size), pgprot_val(PAGE_KERNEL)) -#define ioremap_cache ioremap_cache = #define ioremap_uc ioremap = -#include - /* * Convert a physical pointer to a virtual kernel pointer for /dev/mem * access */ #define xlate_dev_mem_ptr(p) __va(p) = +#include + #define ARCH_HAS_VALID_PHYS_ADDR_RANGE int valid_phys_addr_range(phys_addr_t addr, size_t size); int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); diff --git a/arch/sh/include/asm/io_noioport.h b/arch/sh/include/asm/io_noi= oport.h index f7938fe0f911..5ba4116b4265 100644 --- a/arch/sh/include/asm/io_noioport.h +++ b/arch/sh/include/asm/io_noioport.h @@ -53,6 +53,13 @@ static inline void ioport_unmap(void __iomem *addr) #define outw_p(x, addr) outw((x), (addr)) #define outl_p(x, addr) outl((x), (addr)) = +#define insb insb +#define insw insw +#define insl insl +#define outsb outsb +#define outsw outsw +#define outsl outsl + static inline void insb(unsigned long port, void *dst, unsigned long count) { BUG(); diff --git a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap.c index 720a9186b06b..725a1623675a 100644 --- a/arch/sh/mm/ioremap.c +++ b/arch/sh/mm/ioremap.c @@ -72,7 +72,7 @@ __ioremap_29bit(phys_addr_t offset, unsigned long size, p= gprot_t prot) #define __ioremap_29bit(offset, size, prot) NULL #endif /* CONFIG_29BIT */ = -void __iomem * +void __iomem * __ref arch_ioremap(phys_addr_t *paddr, size_t size, unsigned long *prot_val) { unsigned long last_addr, phys_addr =3D *paddr; @@ -102,7 +102,8 @@ arch_ioremap(phys_addr_t *paddr, size_t size, unsigned = long *prot_val) * First try to remap through the PMB. * PMB entries are all pre-faulted. */ - mapped =3D pmb_remap_caller(phys_addr, size, pgprot, caller); + mapped =3D pmb_remap_caller(phys_addr, size, pgprot, + __builtin_return_address(0)); if (mapped && !IS_ERR(mapped)) return mapped; = @@ -129,7 +130,6 @@ static inline int iomapping_nontranslatable(unsigned lo= ng offset) int arch_iounmap(void __iomem *addr) { unsigned long vaddr =3D (unsigned long __force)addr; - struct vm_struct *p; = /* * Nothing to do if there is no translatable mapping. --===============2621051805511202625==--