public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Douglas Anderson <dianders@chromium.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Petr Mladek <pmladek@suse.com>,
	Douglas Anderson <dianders@chromium.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Laurent Dufour <ldufour@linux.ibm.com>,
	Nicholas Piggin <npiggin@gmail.com>, Tom Rix <trix@redhat.com>,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2] powerpc: Move arch_trigger_cpumask_backtrace from nmi.h to irq.h
Date: Fri, 23 Jun 2023 22:06:28 +1000	[thread overview]
Message-ID: <875y7ez8l7.fsf@mail.lhotse> (raw)
In-Reply-To: <20230622202816.v2.1.Ice67126857506712559078e7de26d32d26e64631@changeid>

Douglas Anderson <dianders@chromium.org> writes:
> The powerpc architecture was the only one that defined
> arch_trigger_cpumask_backtrace() in asm/nmi.h instead of
> asm/irq.h. Move it to be consistent.
>
> This fixes compile time errors introduced by commit 7ca8fe94aa92
> ("watchdog/hardlockup: define HARDLOCKUP_DETECTOR_ARCH"). That commit
> caused <asm/nmi.h> to stop being included if the hardlockup detector
> wasn't enabled. The specific errors were:
>   error: implicit declaration of function ‘nmi_cpu_backtrace’
>   error: implicit declaration of function ‘nmi_trigger_cpumask_backtrace’
>
> NOTE: when moving this into irq.h, we also change the guards from just
> checking if "CONFIG_NMI_IPI" is defined to also checking if
> "CONFIG_PPC_BOOK3S_64" is defined. This matches the code in
> arch/powerpc/kernel/stacktrace.c. Previously this worked because
> <asm.nmi.h> was included if "CONFIG_HAVE_HARDLOCKUP_DETECTOR_ARCH" was
> defined. For powerpc that's only selected if "CONFIG_PPC_BOOK3S_64" is
> defined.
>
> Fixes: 7ca8fe94aa92 ("watchdog/hardlockup: define HARDLOCKUP_DETECTOR_ARCH")
> Reported-by: Michael Ellerman <mpe@ellerman.id.au>
> Closes: https://lore.kernel.org/r/871qi5otdh.fsf@mail.lhotse
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> I'd expect that this would land in Andrew Morton's tree along with the
> other lockup detector stuff.
>
> Changes in v2:
> - Change the guards to include CONFIG_PPC_BOOK3S_64.

Thanks, this fixes all the build errors AFAICS.

Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)

cheers

>  arch/powerpc/include/asm/irq.h | 6 ++++++
>  arch/powerpc/include/asm/nmi.h | 6 ------
>  2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h
> index 94dffa1dd223..f257cacb49a9 100644
> --- a/arch/powerpc/include/asm/irq.h
> +++ b/arch/powerpc/include/asm/irq.h
> @@ -53,5 +53,11 @@ void __do_IRQ(struct pt_regs *regs);
>  
>  int irq_choose_cpu(const struct cpumask *mask);
>  
> +#if defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_NMI_IPI)
> +extern void arch_trigger_cpumask_backtrace(const cpumask_t *mask,
> +					   bool exclude_self);
> +#define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
> +#endif
> +
>  #endif /* _ASM_IRQ_H */
>  #endif /* __KERNEL__ */
> diff --git a/arch/powerpc/include/asm/nmi.h b/arch/powerpc/include/asm/nmi.h
> index ce25318c3902..49a75340c3e0 100644
> --- a/arch/powerpc/include/asm/nmi.h
> +++ b/arch/powerpc/include/asm/nmi.h
> @@ -9,12 +9,6 @@ void watchdog_hardlockup_set_timeout_pct(u64 pct);
>  static inline void watchdog_hardlockup_set_timeout_pct(u64 pct) {}
>  #endif
>  
> -#ifdef CONFIG_NMI_IPI
> -extern void arch_trigger_cpumask_backtrace(const cpumask_t *mask,
> -					   bool exclude_self);
> -#define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
> -#endif
> -
>  extern void hv_nmi_check_nonrecoverable(struct pt_regs *regs);
>  
>  #endif /* _ASM_NMI_H */
> -- 
> 2.41.0.162.gfafddb0af9-goog

      reply	other threads:[~2023-06-23 12:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-23  3:28 [PATCH v2] powerpc: Move arch_trigger_cpumask_backtrace from nmi.h to irq.h Douglas Anderson
2023-06-23 12:06 ` Michael Ellerman [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=875y7ez8l7.fsf@mail.lhotse \
    --to=mpe@ellerman.id.au \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=christophe.leroy@csgroup.eu \
    --cc=dianders@chromium.org \
    --cc=ldufour@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    --cc=pmladek@suse.com \
    --cc=trix@redhat.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