mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: Florian Fainelli <f.fainelli@gmail.com>, linux-mips@vger.kernel.org
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"Paul Burton" <paulburton@kernel.org>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Brian Masney" <bmasney+clk@redhat.com>,
	"Jerome Brunet" <jbrunet+clk@baylibre.com>,
	"周琰杰 (Zhou Yanjie)" <zhouyanjie@wanyeetech.com>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"open list" <linux-kernel@vger.kernel.org>,
	"open list:COMMON CLK FRAMEWORK" <linux-clk@vger.kernel.org>,
	hns@goldelico.com, paul@boddie.org.uk
Subject: Re: [PATCH v5 2/4] MIPS: Skip generic IPI setup for platform-specific callbacks
Date: Mon, 16 Nov 2026 17:02:10 +0100	[thread overview]
Message-ID: <c281bf2225030a243c2ff89e19a2103c9c19a4a9.camel@crapouillou.net> (raw)
In-Reply-To: <20261113184210.470320-3-f.fainelli@gmail.com>

Hi Florian,

Le vendredi 13 novembre 2026 à 10:42 -0800, Florian Fainelli a écrit :
> A generic MIPS kernel can select a platform SMP backend with direct IPI
> callbacks instead of an IPI IRQ domain. The XBurst backend uses CP0
> mailboxes, so generic IPI allocation would find no domain and BUG when
> more than one CPU is present.
> 
> Skip generic IPI initialization when neither selected send callback uses
> the generic implementation. Keep initialization when either callback
> uses generic IRQ IPIs, and retain the existing single-CPU shortcut.
> 
> Sashiko AI reported the XBurst integration issue; Codex assisted with
> the change and extracted-function/build checks.

Signed-off-by?

-Paul

> ---
> Changes since previous posting:
> - Split the generic IPI initialization guard out of the XBurst SMP patch
>   as a prerequisite, as requested by Paul Cercueil.
> - Add braces around the multi-line condition.
> 
>  arch/mips/kernel/smp.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
> index 0f28b4a62e72..086298146dd8 100644
> --- a/arch/mips/kernel/smp.c
> +++ b/arch/mips/kernel/smp.c
> @@ -338,8 +338,12 @@ int mips_smp_ipi_free(const struct cpumask *mask)
>  
>  static int __init mips_smp_ipi_init(void)
>  {
> -	if (num_possible_cpus() == 1)
> +	/* Platforms with their own IPI callbacks do not need an IRQ domain.
> */
> +	if ((mp_ops->send_ipi_single != mips_smp_send_ipi_single &&
> +	     mp_ops->send_ipi_mask != mips_smp_send_ipi_mask) ||
> +	    num_possible_cpus() == 1) {
>  		return 0;
> +	}
>  
>  	mips_smp_ipi_allocate(cpu_possible_mask);
>  

  parent reply	other threads:[~2026-11-16 16:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 18:42 [PATCH v5 0/4] MIPS: CI20: Enable SMP with two CPUs Florian Fainelli
2026-11-13 18:42 ` [PATCH v5 1/4] clk: ingenic: Poll JZ4780 CPU1 power status atomically Florian Fainelli
2026-11-13 18:42 ` [PATCH v5 2/4] MIPS: Skip generic IPI setup for platform-specific callbacks Florian Fainelli
2026-11-13 18:43   ` Florian Fainelli
2026-11-16 16:02   ` Paul Cercueil [this message]
2026-11-13 18:42 ` [PATCH v5 3/4] MIPS: Ingenic: Add XBurst SMP support Florian Fainelli
2026-11-16 16:05   ` Paul Cercueil
2026-11-13 18:42 ` [PATCH v5 4/4] MIPS: CI20: Enable SMP with two CPUs Florian Fainelli

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=c281bf2225030a243c2ff89e19a2103c9c19a4a9.camel@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=bmasney+clk@redhat.com \
    --cc=f.fainelli@gmail.com \
    --cc=hns@goldelico.com \
    --cc=jbrunet+clk@baylibre.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=paul@boddie.org.uk \
    --cc=paulburton@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=zhouyanjie@wanyeetech.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®