mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <llong@redhat.com>
To: Naresh Kamboju <naresh.kamboju@linaro.org>,
	Linux-Arch <linux-arch@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	lkft-triage@lists.linaro.org,
	Linux Regressions <regressions@lists.linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Anders Roxell <anders.roxell@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	Ben Copeland <benjamin.copeland@linaro.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Vineet Gupta <vgupta@kernel.org>, Ye Liu <liuye@kylinos.cn>,
	Zi Yan <ziy@nvidia.com>,
	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	Dev Jain <dev.jain@arm.com>, David Hildenbrand <david@redhat.com>,
	Chris Li <chrisl@kernel.org>
Subject: Re: next-20250825: arc: seqlock.h:876:2: error: implicit declaration of function 'spin_lock' [-Werror=implicit-function-declaration]
Date: Tue, 26 Aug 2025 09:56:54 -0400	[thread overview]
Message-ID: <396b8e64-86e5-4fda-8e5f-008f7118a3ef@redhat.com> (raw)
In-Reply-To: <CA+G9fYuLx27WRsS185pDnCVOtsLhn_WQRY4EoDBU8dT-hm88Rw@mail.gmail.com>

On 8/26/25 8:42 AM, Naresh Kamboju wrote:
> On Tue, 26 Aug 2025 at 12:05, Naresh Kamboju <naresh.kamboju@linaro.org> wrote:
>> The following build warnings / errors noticed with arc defconfig with
>> gcc-9 toolchain.
>>
>> Regression Analysis:
>> - New regression? yes
>> - Reproducibility? yes
>>
>> Build regression: next-20250825 arc seqlock.h:876:2: error: implicit
>> declaration of function 'spin_lock'
>> [-Werror=implicit-function-declaration]
>>
>> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
>>
>> arc:
>>    build:
>>      * gcc-9-allnoconfig
>>      * gcc-9-tinyconfig
>>      * gcc-9-vdk_hs38_smp_defconfig
>>      * gcc-9-defconfig
>>      * gcc-9-axs103_defconfig
>>
>> ## Build log
>> In file included from include/linux/mmzone.h:17,
>>                   from include/linux/gfp.h:7,
>>                   from include/linux/mm.h:7,
>>                   from arch/arc/include/asm/arcregs.h:149,
>>                   from arch/arc/include/asm/irqflags-arcv2.h:9,
>>                   from arch/arc/include/asm/irqflags.h:13,
>>                   from include/linux/irqflags.h:18,
>>                   from include/linux/spinlock.h:59,
>>                   from include/linux/sched.h:37,
>>                   from arch/arc/kernel/asm-offsets.c:6:
>> include/linux/seqlock.h: In function 'write_seqlock':
>> include/linux/seqlock.h:876:2: error: implicit declaration of function
>> 'spin_lock' [-Werror=implicit-function-declaration]
>>    876 |  spin_lock(&sl->lock);
>>        |  ^~~~~~~~~
>> include/linux/seqlock.h: In function 'write_sequnlock':
>> include/linux/seqlock.h:890:2: error: implicit declaration of function
>> 'spin_unlock' [-Werror=implicit-function-declaration]
>>    890 |  spin_unlock(&sl->lock);
>>        |  ^~~~~~~~~~~
>> include/linux/seqlock.h: In function 'write_seqlock_bh':
>> include/linux/seqlock.h:902:2: error: implicit declaration of function
>> 'spin_lock_bh' [-Werror=implicit-function-declaration]
>>    902 |  spin_lock_bh(&sl->lock);
>>        |  ^~~~~~~~~~~~
>> include/linux/seqlock.h: In function 'write_sequnlock_bh':
>> include/linux/seqlock.h:917:2: error: implicit declaration of function
>> 'spin_unlock_bh' [-Werror=implicit-function-declaration]
>>    917 |  spin_unlock_bh(&sl->lock);
>>        |  ^~~~~~~~~~~~~~
>> include/linux/seqlock.h: In function 'write_seqlock_irq':
>> include/linux/seqlock.h:929:2: error: implicit declaration of function
>> 'spin_lock_irq' [-Werror=implicit-function-declaration]
>>    929 |  spin_lock_irq(&sl->lock);
>>        |  ^~~~~~~~~~~~~
>> include/linux/seqlock.h: In function 'write_sequnlock_irq':
>> include/linux/seqlock.h:943:2: error: implicit declaration of function
>> 'spin_unlock_irq'; did you mean 'write_sequnlock_irq'?
>> [-Werror=implicit-function-declaration]
>>    943 |  spin_unlock_irq(&sl->lock);
>>        |  ^~~~~~~~~~~~~~~
>>        |  write_sequnlock_irq
>> include/linux/seqlock.h: In function '__write_seqlock_irqsave':
>> include/linux/seqlock.h:950:2: error: implicit declaration of function
>> 'spin_lock_irqsave' [-Werror=implicit-function-declaration]
>>    950 |  spin_lock_irqsave(&sl->lock, flags);
>>        |  ^~~~~~~~~~~~~~~~~
>> include/linux/seqlock.h: In function 'write_sequnlock_irqrestore':
>> include/linux/seqlock.h:981:2: error: implicit declaration of function
>> 'spin_unlock_irqrestore'; did you mean 'write_sequnlock_irqrestore'?
>> [-Werror=implicit-function-declaration]
>>    981 |  spin_unlock_irqrestore(&sl->lock, flags);
>>        |  ^~~~~~~~~~~~~~~~~~~~~~
>>        |  write_sequnlock_irqrestore
>> In file included from include/linux/sched.h:15,
>>                   from arch/arc/kernel/asm-offsets.c:6:
>> include/linux/rcupdate.h: In function 'rcu_read_lock_sched_held':
>> include/linux/preempt.h:227:49: error: implicit declaration of
>> function 'irqs_disabled' [-Werror=implicit-function-declaration]
>>    227 | #define preemptible() (preempt_count() == 0 && !irqs_disabled())
>>        |                                                 ^~~~~~~~~~~~~
>>                            ^
>> cc1: some warnings being treated as errors
> Anders bisected this and found,
>   # first bad commit:
>     [7cf258e5720ffdd5505faa04ab5afa9732ef0f6e]
>     mm-replace-20-page_shift-with-common-macros-for-pages-mb-conversion-fix

The compilation problem is a result of bad include file ordering. Since 
the only users of PAGES_TO_MB() macro are kernel/rcu/rcuscale.c and 
mm/swap.c and they both include <linux/mm.h>. So this can be fixed by 
just removing the <linux/mm.h> include from arcregs.h.

Cheers,
Longman


>> ## Source
>> * Kernel version: 6.17.0-rc3-next-20250825
>> * Git tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next.git
>> * Git describe: next-20250825
>> * Git commit: 6c68f4c0a147c025ae0b25fab688c7c47964a02f
>> * Architectures: arc
>> * Toolchains: gcc-9
>> * Kconfigs: defconfig
>>
>> ## Build
>> * Build log: https://qa-reports.linaro.org/api/testruns/29652436/log_file/
>> * Build details:
>> https://regressions.linaro.org/lkft/linux-next-master/next-20250825/build/gcc-9-defconfig/
>> * Build error details:
>> https://regressions.linaro.org/lkft/linux-next-master/next-20250825/log-parser-build-gcc/gcc-compiler-include_asm-generic_getorder_h-error-implicit-declaration-of-function-ilog/
>> * Build plan: https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/builds/31lrYki7MzYyqtJKnutAe2oawoq
>> * Build link: https://storage.tuxsuite.com/public/linaro/lkft/builds/31lrYki7MzYyqtJKnutAe2oawoq/
>> * Kernel config:
>> https://storage.tuxsuite.com/public/linaro/lkft/builds/31lrYki7MzYyqtJKnutAe2oawoq/config
>>
>> --
>> Linaro LKFT
>> https://lkft.linaro.org


      reply	other threads:[~2025-08-26 13:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-26  6:35 Naresh Kamboju
2025-08-26 12:42 ` Naresh Kamboju
2025-08-26 13:56   ` Waiman Long [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=396b8e64-86e5-4fda-8e5f-008f7118a3ef@redhat.com \
    --to=llong@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=anders.roxell@linaro.org \
    --cc=arnd@arndb.de \
    --cc=benjamin.copeland@linaro.org \
    --cc=boqun.feng@gmail.com \
    --cc=chrisl@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=david@redhat.com \
    --cc=dev.jain@arm.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuye@kylinos.cn \
    --cc=lkft-triage@lists.linaro.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mingo@redhat.com \
    --cc=naresh.kamboju@linaro.org \
    --cc=peterz@infradead.org \
    --cc=regressions@lists.linux.dev \
    --cc=vgupta@kernel.org \
    --cc=will@kernel.org \
    --cc=ziy@nvidia.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

all inboxes | Powered by JetHome®