linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: SMP-CPS: Add support for irq migration when CPU offline
@ 2020-12-03  6:54 Wei Li
  2020-12-04 12:08 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Li @ 2020-12-03  6:54 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Paul Burton
  Cc: linux-mips, linux-kernel, yangyingliang, guohanjun

Currently we won't migrate irqs when offline CPUs, which has been
implemented on most architectures. That will lead to some devices work
incorrectly if the bound cores are offline.

While that can be easily supported by enabling GENERIC_IRQ_MIGRATION.
But i don't pretty known the reason it was not supported on all MIPS
platforms.

This patch add the support for irq migration on MIPS CPS platform, and
it's tested on the interAptiv processor.

Signed-off-by: Wei Li <liwei391@huawei.com>
---
 arch/mips/Kconfig          | 1 +
 arch/mips/kernel/smp-cps.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index a48cb9a71471..8ece19ffe255 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2510,6 +2510,7 @@ config MIPS_CPS
 	select SYS_SUPPORTS_SCHED_SMT if CPU_MIPSR6
 	select SYS_SUPPORTS_SMP
 	select WEAK_ORDERING
+	select GENERIC_IRQ_MIGRATION if HOTPLUG_CPU
 	help
 	  Select this if you wish to run an SMP kernel across multiple cores
 	  within a MIPS Coherent Processing System. When this option is
diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index 3ab433a8e871..26f74f7d7604 100644
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -12,6 +12,7 @@
 #include <linux/slab.h>
 #include <linux/smp.h>
 #include <linux/types.h>
+#include <linux/irq.h>
 
 #include <asm/bcache.h>
 #include <asm/mips-cps.h>
@@ -465,6 +466,7 @@ static int cps_cpu_disable(void)
 	smp_mb__after_atomic();
 	set_cpu_online(cpu, false);
 	calculate_cpu_foreign_map();
+	irq_migrate_all_off_this_cpu();
 
 	return 0;
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] MIPS: SMP-CPS: Add support for irq migration when CPU offline
  2020-12-03  6:54 [PATCH] MIPS: SMP-CPS: Add support for irq migration when CPU offline Wei Li
@ 2020-12-04 12:08 ` Thomas Bogendoerfer
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2020-12-04 12:08 UTC (permalink / raw)
  To: Wei Li; +Cc: Paul Burton, linux-mips, linux-kernel, yangyingliang, guohanjun

On Thu, Dec 03, 2020 at 02:54:43PM +0800, Wei Li wrote:
> Currently we won't migrate irqs when offline CPUs, which has been
> implemented on most architectures. That will lead to some devices work
> incorrectly if the bound cores are offline.
> 
> While that can be easily supported by enabling GENERIC_IRQ_MIGRATION.
> But i don't pretty known the reason it was not supported on all MIPS
> platforms.
> 
> This patch add the support for irq migration on MIPS CPS platform, and
> it's tested on the interAptiv processor.
> 
> Signed-off-by: Wei Li <liwei391@huawei.com>
> ---
>  arch/mips/Kconfig          | 1 +
>  arch/mips/kernel/smp-cps.c | 2 ++
>  2 files changed, 3 insertions(+)

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-04 12:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03  6:54 [PATCH] MIPS: SMP-CPS: Add support for irq migration when CPU offline Wei Li
2020-12-04 12:08 ` Thomas Bogendoerfer

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).