From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAC98EB64DA for ; Tue, 18 Jul 2023 08:47:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6736D8D0002; Tue, 18 Jul 2023 04:47:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5D5778D0001; Tue, 18 Jul 2023 04:47:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44F608D0002; Tue, 18 Jul 2023 04:47:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2C12C8D0001 for ; Tue, 18 Jul 2023 04:47:27 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id F3530801FF for ; Tue, 18 Jul 2023 08:47:26 +0000 (UTC) X-FDA: 81024103692.03.9349A86 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf18.hostedemail.com (Postfix) with ESMTP id E0D651C0011 for ; Tue, 18 Jul 2023 08:47:24 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=AriOs5di; spf=pass (imf18.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689670045; a=rsa-sha256; cv=none; b=ehhmq8JN3atcSposRelkqk7TNXSolaVv5/R1OAK8SXTFYtye54C6Jl2TCFkPXwaZwoyaVl eISqFVmO3CpLnE88rGSYikatjZX5j2Ofstr14ErDe/cfjv2NXX4xm3jTOLmsGCeMG4HRD3 fM3TETwd09cUVJ3TXd/SY7qp43o7VY0= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=AriOs5di; spf=pass (imf18.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689670045; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=QWJEDqz/K47DCY7+PsL5ETw0UGeTlE8XcxsSbLhdR7Y=; b=cT/tosxFShMrVf0wZe0BAQvz1tbed9F6IgVdn+zZohw/DjfC8KJSNlCB2fSYJT2sySG0fo xXpZerjMQgt/iKlXOiFtZhOr0E56OUDijWmnK0QOzhZk+B4BTpvOfnHxxDD3GD/SX1OX7i /dQ2m9BiWmEY2QuOv7A3ac9rF3To3BM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689670044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QWJEDqz/K47DCY7+PsL5ETw0UGeTlE8XcxsSbLhdR7Y=; b=AriOs5dibTxx7mKCJjbzYnjsIxfYVSj4ZxiUpazpI2G+zSdX9mBisUkvxiQQZQ4sJpuYCu ph4Bs0p55MM3+sqb0tLZWYxTs2bTpv/0Af6G0n8gUJcnBpG4JOChe8UavGHhQfosCZYVtR PPaFJXkOFZhJwsQV9epwA9jy4RRMd9o= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-363-i7g2D4vKNsKx1HOtfg0Kpg-1; Tue, 18 Jul 2023 04:47:18 -0400 X-MC-Unique: i7g2D4vKNsKx1HOtfg0Kpg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 25693185A795; Tue, 18 Jul 2023 08:47:18 +0000 (UTC) Received: from localhost (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D793E4CD0F8; Tue, 18 Jul 2023 08:47:16 +0000 (UTC) Date: Tue, 18 Jul 2023 16:47:13 +0800 From: "bhe@redhat.com" To: "Liu, Yujie" Cc: lkp , "hch@lst.de" , "oe-kbuild-all@lists.linux.dev" , "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "llvm@lists.linux.dev" , "rppt@kernel.org" , "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 Message-ID: References: <202307131033.JgvCSVz4-lkp@intel.com> <20230713092618.9a25417dc886b4f61660fe17@linux-foundation.org> <1a8bdfb49897cd9808f5a1180df0b629d3b9d12c.camel@intel.com> <36bdd39bfdcf7825d8dbfc7d3c7bb73849d238ca.camel@intel.com> MIME-Version: 1.0 In-Reply-To: <36bdd39bfdcf7825d8dbfc7d3c7bb73849d238ca.camel@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: E0D651C0011 X-Stat-Signature: n4szpem51jxd6q5faj193nbt73rikhuy X-Rspam-User: X-HE-Tag: 1689670044-389282 X-HE-Meta: U2FsdGVkX18VPCaMadFh//hq3pt70n5lhsRFVlUzFrTJtFwTg98zJ16e1wQbKVod229nNK2rxf2FJdBBg4TlQEXxVxFkIoFrIrzCNgzTAF+3SFJP3jqs8mvc7TnbWaaW0aDVcyHW+K9Hr/pf6wouNlFEJ292OWdPb/99UH0TavuKfMv7EueHo5voNrlMjIekHnRQKPDXUVS21LCHDX+GwAI0ZQ9BeYMrnqzUTWXmmszZy7lh+3UmnN/Tpt8QBvP89Mvq5eD0s+3ZH/NdiGuYnTvM60XBH+VU1nXWjoakiGOFykngT9REFKaWsndTTcBvxM1Ha8MKuTXtgNZsey0TKy6U2pUnMy97N+eoboqqxgA06oa1tn5iUcKRovQNespPEaYjSd5uoY8s9otlz4BAbgr61jq3EjNmilHl5Z+dn58sNw47hkZLO3a6PNeKb2pyRbN+X0KNvCGFy0bsLdGoO10lEve5qikX3pUnUcwQR8ABkWKHnHy9/yOsXVhhcL6hgMJEnmXnEZSPcJAGKeANxIabi6/Fzuw8JJnhkU+NaKRLZD76vR6ElepRuxuo+Sq6rdEE516+YMSa+MfEACbCbEFoeYByDsg8Rqu6Go0w5sRM8DKoTfHX2r6Kz0Op14tBCiXUieXEHAaB+ygdJ1nqnecsZl0fsLJb4nD2YGHw2AW8Wq/u/x4G5sshxrZeeM5yxnUySot5frxinMz4lmmdspDNf/qarn1iPlaav1NR3U19YS1UKOy9WFvZGOZZhNXQrGJ5NZ9Yk17Cat60wbvUxHTUAiciugffaZRfeOqtd70hspGjK22cKoMeROrRY3n6NtHvjZb7xD0Byp7qk3NDWtXAILETrni5ifWzkieKS0bYyGxtehf7BdTJrT4MDkVUsj1ZDHDZVkYQ4grx3yh7l4YwtakMMQefzbTmNOhWotAOY3yXehaPVaN5kc8bbPxA3xD1i9bVKckA4Z+R82g N3+bTUPL QXYhXX1RTGS6xDJcx6FqhcwPoOV6zXU/LtPRmfvjvJwjPUzVDnLILFN7uagfrDD7eLP2NVkRrkPBnymcNGA7YFIrInOQz6czrWmBamFbVJAJz2hfKSbxp9xacgZAkdUjZhX/ugPMGLQKeHpY4OAtGdN+Sf/IFnyUFlqw27dPcCQ1qTtLnom0+OndRU1ilTrJMVnGJOsqehbmZ19+EvXT50cNAjgLqekxUU+ntmLmK44VmLNsUxmvlEGJn2MQY+poDG0TsDYSMSRW2T9GsCZt6IJln6ZswzxktzMxYvbKD2QA57uFYK+umgH3OSlX6RQcvljl6shy5bM5XQ9HVDA3mWVrjiBo3TPnt4ZlK2qmMnMu53FqSE4sXMh9Nv6G+Hr8dUnc2yoWN3Bnsims= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 > > > > >