Skip to contentSkip to conversation

MIPS: Reserve nosave data for hibernation

PATCH Superseded Huacai Chen 1 participant 3 messages Mar 7, 2016

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 MIPS: Reserve nosave data for hibernation

After commit 92923ca3aacef63c92d ("mm: meminit: only set page reserved in the memblock region"), the MIPS hibernation is broken. Because pages in nosave data section should be "reserved", but currently they aren't set to "reserved" at initialization. This patch makes hibernation work again.

---
 arch/mips/kernel/setup.c | 3 +++
 1 file changed, 3 insertions(+)
arch/mips/kernel/setup.c +3 -0
index 5fdaf8b..6f68cdd 100644
@@ -706,6 +706,9 @@ static void __init arch_mem_init(char **cmdline_p)
 	for_each_memblock(reserved, reg)
 		if (reg->size != 0)
 			reserve_bootmem(reg->base, reg->size, BOOTMEM_DEFAULT);
+
+	reserve_bootmem_region(__pa_symbol(&__nosave_begin),
+			__pa_symbol(&__nosave_end)); /* Reserve for hibernation */
 }
 
 static void __init resource_init(void)
Signature · 1 line
2.7.0
#1 lore raw

PATCH v2 2/3 MIPS: Loongson-3: Fix build error after ld-version.sh modification

Commit d5ece1cb074b2c ("Fix ld-version.sh to handle large 3rd version part") modifies the ld version description. This causes a build error on Loongson-3, so fix it.

---
 arch/mips/loongson64/Platform | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/loongson64/Platform +1 -1
index 85d8089..0fce460 100644
@@ -31,7 +31,7 @@ cflags-$(CONFIG_CPU_LOONGSON3)	+= -Wa,--trap
 # can't easily be used safely within the kbuild framework.
 #
 ifeq ($(call cc-ifversion, -ge, 0409, y), y)
-  ifeq ($(call ld-ifversion, -ge, 22500000, y), y)
+  ifeq ($(call ld-ifversion, -ge, 225000000, y), y)
     cflags-$(CONFIG_CPU_LOONGSON3)  += \
       $(call cc-option,-march=loongson3a -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64)
   else
Signature · 1 line
2.7.0
#2 lore raw

PATCH v2 3/3 MIPS: Loongson-3: Adjust irq dispatch to speedup processing

In reply to Huacai Chen

This patch adjust the logic in mach_irq_dispatch(), allow multiple IPs handled in the same dispatching. This can speedup interrupt processing.

---
 arch/mips/loongson64/loongson-3/irq.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
arch/mips/loongson64/loongson-3/irq.c +6 -4
index 0f75b6b..8e76490 100644
@@ -24,19 +24,21 @@ static void ht_irqdispatch(void)
 	}
 }
 
+#define UNUSED_IPS (CAUSEF_IP5 | CAUSEF_IP4 | CAUSEF_IP1 | CAUSEF_IP0)
+
 void mach_irq_dispatch(unsigned int pending)
 {
 	if (pending & CAUSEF_IP7)
 		do_IRQ(LOONGSON_TIMER_IRQ);
 #if defined(CONFIG_SMP)
-	else if (pending & CAUSEF_IP6)
+	if (pending & CAUSEF_IP6)
 		loongson3_ipi_interrupt(NULL);
 #endif
-	else if (pending & CAUSEF_IP3)
+	if (pending & CAUSEF_IP3)
 		ht_irqdispatch();
-	else if (pending & CAUSEF_IP2)
+	if (pending & CAUSEF_IP2)
 		do_IRQ(LOONGSON_UART_IRQ);
-	else {
+	if (pending & UNUSED_IPS) {
 		pr_err("%s : spurious interrupt\n", __func__);
 		spurious_interrupt();
 	}
Signature · 1 line
2.7.0