linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "bhe@redhat.com" <bhe@redhat.com>
To: "Liu, Yujie" <yujie.liu@intel.com>
Cc: lkp <lkp@intel.com>, "hch@lst.de" <hch@lst.de>,
	"oe-kbuild-all@lists.linux.dev" <oe-kbuild-all@lists.linux.dev>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"llvm@lists.linux.dev" <llvm@lists.linux.dev>,
	"rppt@kernel.org" <rppt@kernel.org>,
	"schnelle@linux.ibm.com" <schnelle@linux.ibm.com>
Subject: Re: [akpm-mm:mm-unstable 93/173] drivers/clk/clk-fixed-mmio.c:33:2: error: call to undeclared function 'iounmap'; ISO C99 and later do not support implicit function declarations
Date: Tue, 18 Jul 2023 16:47:13 +0800	[thread overview]
Message-ID: <ZLZRkSu94nPrOyBa@MiWiFi-R3L-srv> (raw)
In-Reply-To: <36bdd39bfdcf7825d8dbfc7d3c7bb73849d238ca.camel@intel.com>

On 07/18/23 at 06:19am, Liu, Yujie wrote:
> On Tue, 2023-07-18 at 08:06 +0800, bhe@redhat.com wrote:
> > On 07/17/23 at 07:05am, Liu, Yujie wrote:
> > > Hi Baoquan,
> > > 
> > > On Fri, 2023-07-14 at 07:59 +0800, Baoquan He wrote:
> > > > > 
> > > > > In file included from ./include/linux/io.h:13,
> > > > >                  from drivers/clk/clk-fixed-mmio.c:13:
> > > > > drivers/clk/clk-fixed-mmio.c: In function 'fixed_mmio_clk_setup':
> > > > > ./arch/s390/include/asm/io.h:29:17: error: implicit declaration of function 'iounmap'; did you mean 'vunmap'? [-Werror=implicit-function-declaration]
> > > > >    29 | #define iounmap iounmap
> > > > >       |                 ^~~~~~~
> > > > > drivers/clk/clk-fixed-mmio.c:33:9: note: in expansion of macro 'iounmap'
> > > > >    33 |         iounmap(base);
> > > > >       |         ^~~~~~~
> > > > 
> > > > These iorempa/iounmap not defined or declared are not related to my
> > > > patches. S390 could set CONFIG_PCI=n, however its ioremap/iounmap code
> > > > are all defined in arch/s390/pci/pci.c. Means its ioremap/iounmap code
> > > > depends on CONFIG_PCI enabling. So those drivers invoking iomem
> > > > functions, (e.g ioremap(), devm_ioremap(), etc) all will be failed to
> > > > build if CONFIG_PCI=n on s390.
> > > > 
> > > > All these errors have been fixed in my another patchset.
> > > > 
> > > > https://lore.kernel.org/all/20230707135852.24292-1-bhe@redhat.com/T/#u
> > > 
> > > Sorry for the duplicate reports and late reply.
> > > 
> > > We searched the log of kernel test robot and got the following clues
> > > for this case:
> > > 
> > > This is a randconfig build test, so the kconfig happened to set
> > > CONFIG_PCI=n and CONFIG_COMMON_CLK_FIXED_MMIO=y, and it is good to
> > > build the clk-fixed-mmio driver in such case before, but it raises a
> > > build error after applying your patches, so the bot thought that a new
> > > build error was introduced and sent reports to you.
> > > 
> > > == without the patches (v6.5-rc1 as example) ==
> > > 
> > > $ git checkout v6.5-rc1
> > > HEAD is now at 06c2afb862f9 Linux 6.5-rc1
> > > 
> > > $ grep -e CONFIG_PCI -e CONFIG_COMMON_CLK_FIXED_MMIO .config
> > > # CONFIG_PCI is not set
> > > CONFIG_COMMON_CLK_FIXED_MMIO=y
> > > 
> > > $ COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross LLVM_IAS=1 W=1 ARCH=s390 drivers/clk/clk-fixed-mmio.o
> > > ...
> > > 
> > > $ file drivers/clk/clk-fixed-mmio.o
> > > drivers/clk/clk-fixed-mmio.o: ELF 64-bit MSB relocatable, IBM S/390, version 1 (SYSV), not stripped
> > > 
> > > == with the patches ==
> > > 
> > > $ git checkout b0f683e34a5b
> > > HEAD is now at b0f683e34a5b s390: mm: convert to GENERIC_IOREMAP
> > > 
> > > $ grep -e CONFIG_PCI -e CONFIG_COMMON_CLK_FIXED_MMIO .config
> > > # CONFIG_PCI is not set
> > > CONFIG_COMMON_CLK_FIXED_MMIO=y
> > > 
> > > $ COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ./make.cross LLVM_IAS=1 W=1 ARCH=s390 drivers/clk/clk-fixed-mmio.o
> > > ...
> > > drivers/clk/clk-fixed-mmio.c:33:2: error: call to undeclared function 'iounmap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> > >    33 |         iounmap(base);
> > >       |         ^
> > > ./arch/s390/include/asm/io.h:29:17: note: expanded from macro 'iounmap'
> > >    29 | #define iounmap iounmap
> > >       |                 ^
> > > drivers/clk/clk-fixed-mmio.c:33:2: note: did you mean 'vunmap'?
> > > ./arch/s390/include/asm/io.h:29:17: note: expanded from macro 'iounmap'
> > >    29 | #define iounmap iounmap
> > >       |                 ^
> > > ./include/linux/vmalloc.h:167:13: note: 'vunmap' declared here
> > >   167 | extern void vunmap(const void *addr);
> > >       |             ^
> > > 12 warnings and 1 error generated.
> > > make[4]: *** [scripts/Makefile.build:243: drivers/clk/clk-fixed-mmio.o] Error 1
> > > make[3]: *** [scripts/Makefile.build:477: drivers/clk] Error 2
> > > make[3]: Target 'drivers/clk/clk-fixed-mmio.o' not remade because of errors.
> > > make[2]: *** [scripts/Makefile.build:477: drivers] Error 2
> > > make[2]: Target 'drivers/clk/clk-fixed-mmio.o' not remade because of errors.
> > > make[1]: *** [/home/yujie/linux/Makefile:2020: .] Error 2
> > > make[1]: Target 'drivers/clk/clk-fixed-mmio.o' not remade because of errors.
> > > make: *** [Makefile:234: __sub-make] Error 2
> > > make: Target 'drivers/clk/clk-fixed-mmio.o' not remade because of errors.
> > > 
> > > 
> > > After applying the patchset at
> > > https://lore.kernel.org/all/20230707135852.24292-1-bhe@redhat.com,
> > > above situation cannot happen anymore because CONFIG_PCI and
> > > CONFIG_COMMON_CLK_FIXED_MMIO can only be both enabled or both disabled,
> > > so the issue has been resolved.
> > 
> > No, your process may need be improved.
> > 
> > On linus's master branch, you can pass compiling on
> > drivers/clk/clk-fixed-mmio.o, but you absolutely will fail during linking
> > stage. As I have explained, ioremap()/iounmap()/ioremap_xx() are all
> > defined in arch/s390/pci/pci.c. Setting CONFIG_PCI=n will make you not
> > be able to find the implementation of ioremap()/iounmap(). Don't you
> > finish the whole building process of kernel image and modules?
> 
> Sorry I didn't make it very clear in the last mail. We also got the
> failure in link stage when testing on mainline. After applying your
> patch, it became an error in compile stage and won't reach link stage
> anymore. In other words, your patch helped to expose an existing issue
> earlier from linking to compiling. Our bot cannot handle such case very
> well for now since the compiling error and linking error are very
> different. Of course this should be a false positive report and your
> patch should not be blamed for exposing an existing issue. Sorry for
> any misleading or disturbing. We will consider some optimizations for
> similar cases.

I see. Seems there's still room for LKP to differentiate the compiling
issue from the linking issue.

Thanks for these details and your great effort.

> 
> 
> > Please see below building log, the linking is failed. I got a new s390x
> > machine, and git clone linus's tree and build with randconfig from this
> > lkp report. 
> > 
> > When I made below patch and tested, I also only git clone linus's latest
> > kernel tree. I didn't apply any patch. The current lkp report and your
> > checking could be misleading.
> > 
> > [PATCH 0/8] Make several Kconfig options depend on HAS_IOMEM
> > https://lore.kernel.org/all/20230707135852.24292-1-bhe@redhat.com,
> > 
> > =====
> >   AR      drivers/iio/built-in.a
> >   AR      drivers/built-in.a
> >   AR      built-in.a
> >   AR      vmlinux.a
> >   LD      vmlinux.o
> >   OBJCOPY modules.builtin.modinfo
> >   GEN     modules.builtin
> >   MODPOST vmlinux.symvers
> >   UPD     include/generated/utsversion.h
> >   CC      init/version-timestamp.o
> >   LD      .tmp_vmlinux.kallsyms1
> > ld: drivers/clk/clk-fixed-mmio.o: in function `fixed_mmio_clk_setup':
> > clk-fixed-mmio.c:(.text+0x44): undefined reference to `of_iomap'
> > ld: clk-fixed-mmio.c:(.text+0x9c): undefined reference to `iounmap'
> > ld: drivers/pcmcia/cistpl.o: in function `set_cis_map':
> > cistpl.c:(.text+0x52a): undefined reference to `ioremap'
> > ld: cistpl.c:(.text+0x602): undefined reference to `iounmap'
> > ld: cistpl.c:(.text+0x650): undefined reference to `iounmap'
> > ld: cistpl.c:(.text+0x668): undefined reference to `ioremap'
> > ld: drivers/pcmcia/cistpl.o: in function `release_cis_mem':
> > cistpl.c:(.text+0x85c): undefined reference to `iounmap'
> > make[2]: *** [scripts/Makefile.vmlinux:36: vmlinux] Error 1
> > make[1]: *** [/root/linux/Makefile:1238: vmlinux] Error 2
> > make: *** [Makefile:234: __sub-make] Error 2
> > 
> > 
> 



      reply	other threads:[~2023-07-18  8:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13  2:57 [akpm-mm:mm-unstable 93/173] drivers/clk/clk-fixed-mmio.c:33:2: error: call to undeclared function 'iounmap'; ISO C99 and later do not support implicit function declarations kernel test robot
2023-07-13 16:26 ` Andrew Morton
2023-07-13 23:59   ` Baoquan He
2023-07-14 18:08     ` Andrew Morton
2023-07-17  7:05     ` Liu, Yujie
2023-07-18  0:06       ` bhe
2023-07-18  6:19         ` Liu, Yujie
2023-07-18  8:47           ` bhe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZLZRkSu94nPrOyBa@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rppt@kernel.org \
    --cc=schnelle@linux.ibm.com \
    --cc=yujie.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).