Skip to contentSkip to conversation

MIPS: Remove deprecated CONFIG_MIPS_CMP

PATCH Applied Thomas Bogendoerfer 4 participants 5 messages Apr 5, 2023 – Apr 12, 2023

Subsystems (5)
lore
Share & tools
lore

Thomas Bogendoerfer

author maintainer
#0 lore raw

PATCH 1/1 MIPS: Remove deprecated CONFIG_MIPS_CMP

Commit 5cac93b35c14 ("MIPS: Deprecate CONFIG_MIPS_CMP") deprecated CONFIG_MIPS_CMP and after 9 years it's time to remove it.

---
Marc, if you prefer an extra patch for the irqchip change, I'll split this. Otherwise I would take it through the MIPS tree.

 arch/mips/Kconfig                    |  34 +----
 arch/mips/include/asm/rtlx.h         |   1 -
 arch/mips/include/asm/smp-ops.h      |  16 ---
 arch/mips/include/asm/vpe.h          |   4 -
 arch/mips/kernel/Makefile            |   3 -
 arch/mips/kernel/rtlx-cmp.c          | 122 ------------------
 arch/mips/kernel/smp-cmp.c           | 148 ----------------------
 arch/mips/kernel/vpe-cmp.c           | 180 ---------------------------
 arch/mips/kernel/vpe.c               |   2 +-
 arch/mips/mti-malta/Makefile         |   2 -
 arch/mips/mti-malta/malta-amon.c     |  88 -------------
 arch/mips/mti-malta/malta-init.c     |   2 -
 arch/mips/mti-malta/malta-platform.c |   2 -
 arch/mips/ralink/mt7621.c            |   2 -
 drivers/irqchip/irq-mips-gic.c       |  26 ----
 15 files changed, 3 insertions(+), 629 deletions(-)
 delete mode 100644 arch/mips/kernel/rtlx-cmp.c
 delete mode 100644 arch/mips/kernel/smp-cmp.c
 delete mode 100644 arch/mips/kernel/vpe-cmp.c
 delete mode 100644 arch/mips/mti-malta/malta-amon.c
arch/mips/Kconfig +2 -32
index a975f140ae82..61fca312a2c5 100644
@@ -568,7 +568,6 @@ config MIPS_MALTA
 	select SYS_SUPPORTS_LITTLE_ENDIAN
 	select SYS_SUPPORTS_MICROMIPS
 	select SYS_SUPPORTS_MIPS16
-	select SYS_SUPPORTS_MIPS_CMP
 	select SYS_SUPPORTS_MIPS_CPS
 	select SYS_SUPPORTS_MULTITHREADING
 	select SYS_SUPPORTS_RELOCATABLE
@@ -2270,15 +2269,10 @@ config MIPS_VPE_LOADER
 	  Includes a loader for loading an elf relocatable object
 	  onto another VPE and running it.
 
-config MIPS_VPE_LOADER_CMP
-	bool
-	default "y"
-	depends on MIPS_VPE_LOADER && MIPS_CMP
-
 config MIPS_VPE_LOADER_MT
 	bool
 	default "y"
-	depends on MIPS_VPE_LOADER && !MIPS_CMP
+	depends on MIPS_VPE_LOADER
 
 config MIPS_VPE_LOADER_TOM
 	bool "Load VPE program into memory hidden from linux"
@@ -2294,31 +2288,10 @@ config MIPS_VPE_APSP_API
 	bool "Enable support for AP/SP API (RTLX)"
 	depends on MIPS_VPE_LOADER
 
-config MIPS_VPE_APSP_API_CMP
-	bool
-	default "y"
-	depends on MIPS_VPE_APSP_API && MIPS_CMP
-
 config MIPS_VPE_APSP_API_MT
 	bool
 	default "y"
-	depends on MIPS_VPE_APSP_API && !MIPS_CMP
-
-config MIPS_CMP
-	bool "MIPS CMP framework support (DEPRECATED)"
-	depends on SYS_SUPPORTS_MIPS_CMP && !CPU_MIPSR6
-	select SMP
-	select SYNC_R4K
-	select SYS_SUPPORTS_SMP
-	select WEAK_ORDERING
-	default n
-	help
-	  Select this if you are using a bootloader which implements the "CMP
-	  framework" protocol (ie. YAMON) and want your kernel to make use of
-	  its ability to start secondary CPUs.
-
-	  Unless you have a specific need, you should use CONFIG_MIPS_CPS
-	  instead of this.
+	depends on MIPS_VPE_APSP_API
 
 config MIPS_CPS
 	bool "MIPS Coherent Processing System support"
@@ -2774,9 +2747,6 @@ config HOTPLUG_CPU
 config SMP_UP
 	bool
 
-config SYS_SUPPORTS_MIPS_CMP
-	bool
-
 config SYS_SUPPORTS_MIPS_CPS
 	bool
 
arch/mips/include/asm/rtlx.h +0 -1
index c1020654876e..a72785b4bbf4 100644
@@ -81,7 +81,6 @@ struct rtlx_channel {
 extern struct rtlx_info {
 	unsigned long id;
 	enum rtlx_state state;
-	int ap_int_pending;	/* Status of 0 or 1 for CONFIG_MIPS_CMP only */
 
 	struct rtlx_channel channel[RTLX_CHANNELS];
 } *rtlx;
arch/mips/include/asm/smp-ops.h +0 -16
index 864aea803984..0145bbfb5efb 100644
@@ -80,22 +80,6 @@ static inline int register_up_smp_ops(void)
 #endif
 }
 
-static inline int register_cmp_smp_ops(void)
-{
-#ifdef CONFIG_MIPS_CMP
-	extern const struct plat_smp_ops cmp_smp_ops;
-
-	if (!mips_cm_present())
-		return -ENODEV;
-
-	register_smp_ops(&cmp_smp_ops);
-
-	return 0;
-#else
-	return -ENODEV;
-#endif
-}
-
 static inline int register_vsmp_smp_ops(void)
 {
 #ifdef CONFIG_MIPS_MT_SMP
arch/mips/include/asm/vpe.h +0 -4
index ef7e07829607..61fd4d0aeda4 100644
@@ -29,12 +29,8 @@
 
 static inline int aprp_cpu_index(void)
 {
-#ifdef CONFIG_MIPS_CMP
-	return setup_max_cpus;
-#else
 	extern int tclimit;
 	return tclimit;
-#endif
 }
 
 enum vpe_state {
arch/mips/kernel/Makefile +0 -3
index 5d1addac5e28..853a43ee4b44 100644
@@ -58,16 +58,13 @@ obj-$(CONFIG_CPU_BMIPS)		+= smp-bmips.o bmips_vec.o bmips_5xxx_init.o
 obj-$(CONFIG_MIPS_MT)		+= mips-mt.o
 obj-$(CONFIG_MIPS_MT_FPAFF)	+= mips-mt-fpaff.o
 obj-$(CONFIG_MIPS_MT_SMP)	+= smp-mt.o
-obj-$(CONFIG_MIPS_CMP)		+= smp-cmp.o
 obj-$(CONFIG_MIPS_CPS)		+= smp-cps.o cps-vec.o
 obj-$(CONFIG_MIPS_CPS_NS16550)	+= cps-vec-ns16550.o
 obj-$(CONFIG_MIPS_SPRAM)	+= spram.o
 
 obj-$(CONFIG_MIPS_VPE_LOADER)	+= vpe.o
-obj-$(CONFIG_MIPS_VPE_LOADER_CMP) += vpe-cmp.o
 obj-$(CONFIG_MIPS_VPE_LOADER_MT) += vpe-mt.o
 obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx.o
-obj-$(CONFIG_MIPS_VPE_APSP_API_CMP) += rtlx-cmp.o
 obj-$(CONFIG_MIPS_VPE_APSP_API_MT) += rtlx-mt.o
 
 obj-$(CONFIG_MIPS_MSC)		+= irq-msc01.o
arch/mips/kernel/rtlx-cmp.c deleted +0 -122

122 lines not on this page · raw message

arch/mips/kernel/smp-cmp.c deleted +0 -148

148 lines not on this page · raw message

arch/mips/kernel/vpe-cmp.c deleted +0 -180

180 lines not on this page · raw message

arch/mips/kernel/vpe.c +1 -1
index 13294972707b..343d2597ed76 100644
@@ -795,7 +795,7 @@ static int vpe_open(struct inode *inode, struct file *filp)
 
 static int vpe_release(struct inode *inode, struct file *filp)
 {
-#if defined(CONFIG_MIPS_VPE_LOADER_MT) || defined(CONFIG_MIPS_VPE_LOADER_CMP)
+#ifdef CONFIG_MIPS_VPE_LOADER_MT
 	struct vpe *v;
 	Elf_Ehdr *hdr;
 	int ret = 0;
arch/mips/mti-malta/Makefile +0 -2
index 13bbd12bfa65..bb2c706e11b0 100644
@@ -14,6 +14,4 @@ obj-y				+= malta-platform.o
 obj-y				+= malta-setup.o
 obj-y				+= malta-time.o
 
-obj-$(CONFIG_MIPS_CMP)		+= malta-amon.o
-
 CFLAGS_malta-dtshim.o = -I$(src)/../../../scripts/dtc/libfdt
arch/mips/mti-malta/malta-amon.c deleted +0 -88

88 lines not on this page · raw message

arch/mips/mti-malta/malta-init.c +0 -2
index b03cac5fdc02..000d6d50520a 100644
@@ -289,8 +289,6 @@ void __init prom_init(void)
 
 	if (!register_cps_smp_ops())
 		return;
-	if (!register_cmp_smp_ops())
-		return;
 	if (!register_vsmp_smp_ops())
 		return;
 	register_up_smp_ops();
arch/mips/mti-malta/malta-platform.c +0 -2
index 4ffbcc58c6f6..6961a23aefe9 100644
@@ -43,7 +43,6 @@
 static struct plat_serial8250_port uart8250_data[] = {
 	SMC_PORT(0x3F8, 4),
 	SMC_PORT(0x2F8, 3),
-#ifndef CONFIG_MIPS_CMP
 	{
 		.mapbase	= 0x1f000900,	/* The CBUS UART */
 		.irq		= MIPS_CPU_IRQ_BASE + MIPSCPU_INT_MB2,
@@ -53,7 +52,6 @@ static struct plat_serial8250_port uart8250_data[] = {
 		.flags		= CBUS_UART_FLAGS,
 		.regshift	= 3,
 	},
-#endif
 	{ },
 };
 
arch/mips/ralink/mt7621.c +0 -2
index bbf5811afbf2..c3fbab50b95c 100644
@@ -217,8 +217,6 @@ void __init prom_soc_init(struct ralink_soc_info *soc_info)
 
 	if (!register_cps_smp_ops())
 		return;
-	if (!register_cmp_smp_ops())
-		return;
 	if (!register_vsmp_smp_ops())
 		return;
 }
drivers/irqchip/irq-mips-gic.c +0 -26
index 1a6a7a672ad7..046c355e120b 100644
@@ -54,7 +54,6 @@ static DEFINE_SPINLOCK(gic_lock);
 static struct irq_domain *gic_irq_domain;
 static int gic_shared_intrs;
 static unsigned int gic_cpu_pin;
-static unsigned int timer_cpu_pin;
 static struct irq_chip gic_level_irq_controller, gic_edge_irq_controller;
 
 #ifdef CONFIG_GENERIC_IRQ_IPI
@@ -499,9 +498,6 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int virq,
 	 */
 	switch (intr) {
 	case GIC_LOCAL_INT_TIMER:
-		/* CONFIG_MIPS_CMP workaround (see __gic_init) */
-		map = GIC_MAP_PIN_MAP_TO_PIN | timer_cpu_pin;
-		fallthrough;
 	case GIC_LOCAL_INT_PERFCTR:
 	case GIC_LOCAL_INT_FDC:
 		/*
@@ -795,34 +791,12 @@ static int __init gic_of_init(struct device_node *node,
 	if (cpu_has_veic) {
 		/* Always use vector 1 in EIC mode */
 		gic_cpu_pin = 0;
-		timer_cpu_pin = gic_cpu_pin;
 		set_vi_handler(gic_cpu_pin + GIC_PIN_TO_VEC_OFFSET,
 			       __gic_irq_dispatch);
 	} else {
 		gic_cpu_pin = cpu_vec - GIC_CPU_PIN_OFFSET;
 		irq_set_chained_handler(MIPS_CPU_IRQ_BASE + cpu_vec,
 					gic_irq_dispatch);
-		/*
-		 * With the CMP implementation of SMP (deprecated), other CPUs
-		 * are started by the bootloader and put into a timer based
-		 * waiting poll loop. We must not re-route those CPU's local
-		 * timer interrupts as the wait instruction will never finish,
-		 * so just handle whatever CPU interrupt it is routed to by
-		 * default.
-		 *
-		 * This workaround should be removed when CMP support is
-		 * dropped.
-		 */
-		if (IS_ENABLED(CONFIG_MIPS_CMP) &&
-		    gic_local_irq_is_routable(GIC_LOCAL_INT_TIMER)) {
-			timer_cpu_pin = read_gic_vl_timer_map() & GIC_MAP_PIN_MAP;
-			irq_set_chained_handler(MIPS_CPU_IRQ_BASE +
-						GIC_CPU_PIN_OFFSET +
-						timer_cpu_pin,
-						gic_irq_dispatch);
-		} else {
-			timer_cpu_pin = gic_cpu_pin;
-		}
 	}
 
 	gic_irq_domain = irq_domain_add_simple(node, GIC_NUM_LOCAL_INTRS +
Signature · 1 line
2.35.3
Acked-by on v1 1/1
#2 lore raw
In reply to Thomas Bogendoerfer
Quoted 8 lines · Thomas Bogendoerfer

Commit 5cac93b35c14 ("MIPS: Deprecate CONFIG_MIPS_CMP") deprecated CONFIG_MIPS_CMP and after 9 years it's time to remove it.

---
Marc, if you prefer an extra patch for the irqchip change, I'll split this. Otherwise I would take it through the MIPS tree.

Please do take it as a whole.

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
Reviewed-by on v1 1/1
#3 lore raw
In reply to Thomas Bogendoerfer
Quoted 24 lines · Thomas Bogendoerfer

Commit 5cac93b35c14 ("MIPS: Deprecate CONFIG_MIPS_CMP") deprecated CONFIG_MIPS_CMP and after 9 years it's time to remove it.

---
Marc, if you prefer an extra patch for the irqchip change, I'll split this. Otherwise I would take it through the MIPS tree.

  arch/mips/Kconfig                    |  34 +----
  arch/mips/include/asm/rtlx.h         |   1 -
  arch/mips/include/asm/smp-ops.h      |  16 ---
  arch/mips/include/asm/vpe.h          |   4 -
  arch/mips/kernel/Makefile            |   3 -
  arch/mips/kernel/rtlx-cmp.c          | 122 ------------------
  arch/mips/kernel/smp-cmp.c           | 148 ----------------------
  arch/mips/kernel/vpe-cmp.c           | 180 ---------------------------
  arch/mips/kernel/vpe.c               |   2 +-
  arch/mips/mti-malta/Makefile         |   2 -
  arch/mips/mti-malta/malta-amon.c     |  88 -------------
  arch/mips/mti-malta/malta-init.c     |   2 -
  arch/mips/mti-malta/malta-platform.c |   2 -
  arch/mips/ralink/mt7621.c            |   2 -
  drivers/irqchip/irq-mips-gic.c       |  26 ----
  15 files changed, 3 insertions(+), 629 deletions(-)
Quoted 4 lines

delete mode 100644 arch/mips/kernel/rtlx-cmp.c delete mode 100644 arch/mips/kernel/smp-cmp.c delete mode 100644 arch/mips/kernel/vpe-cmp.c delete mode 100644 arch/mips/mti-malta/malta-amon.c

author maintainer Applied
#4 lore raw
In reply to Thomas Bogendoerfer
Quoted 20 lines · Thomas Bogendoerfer

Commit 5cac93b35c14 ("MIPS: Deprecate CONFIG_MIPS_CMP") deprecated CONFIG_MIPS_CMP and after 9 years it's time to remove it.

---
Marc, if you prefer an extra patch for the irqchip change, I'll split this. Otherwise I would take it through the MIPS tree.

 arch/mips/Kconfig                    |  34 +----
 arch/mips/include/asm/rtlx.h         |   1 -
 arch/mips/include/asm/smp-ops.h      |  16 ---
 arch/mips/include/asm/vpe.h          |   4 -
 arch/mips/kernel/Makefile            |   3 -
 arch/mips/kernel/rtlx-cmp.c          | 122 ------------------
 arch/mips/kernel/smp-cmp.c           | 148 ----------------------
 arch/mips/kernel/vpe-cmp.c           | 180 ---------------------------
 arch/mips/kernel/vpe.c               |   2 +-
 arch/mips/mti-malta/Makefile         |   2 -
 arch/mips/mti-malta/malta-amon.c     |  88 -------------
 arch/mips/mti-malta/malta-init.c     |   2 -
Quoted 8 lines
 arch/mips/mti-malta/malta-platform.c |   2 -
 arch/mips/ralink/mt7621.c            |   2 -
 drivers/irqchip/irq-mips-gic.c       |  26 ----
 15 files changed, 3 insertions(+), 629 deletions(-)
 delete mode 100644 arch/mips/kernel/rtlx-cmp.c
 delete mode 100644 arch/mips/kernel/smp-cmp.c
 delete mode 100644 arch/mips/kernel/vpe-cmp.c
 delete mode 100644 arch/mips/mti-malta/malta-amon.c

applied to mips-next.

Thomas.

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