some bugfix patches for kdump.
Hanjun Guo (1): [Huawei] arm64: smp: wait 50 seconds for other CPUs to stop for kexec
Yingliang Yang (1): [Huawei] arm64: kdump: fix timer interrupts panic, could not boot capture_kernel
arch/arm64/kernel/machine_kexec.c | 16 ++++++++++++++++ arch/arm64/kernel/smp.c | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-)
From: Hanjun Guo guohanjun@huawei.com
Offering: HULK hulk inclusion category: bugfix bugzilla: 46864 CVE: NA
-------------------------------------------------
With 64 cpus in the system, we need to wait longer to stop cpus for kexec, so just set it to 50 seconds as it is long enough to stop no-boot cpus.
It has no side effects for system with small number cpus because it will break out when other cpus offlined, no need to wait 50 seconds.
Signed-off-by: Hanjun Guo guohanjun@huawei.com Signed-off-by: Chen Zhou chenzhou10@huawei.com --- arch/arm64/kernel/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 18e9727d3f64..25f3eb1e927a 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -1041,8 +1041,8 @@ void smp_send_stop(void) smp_cross_call(&mask, IPI_CPU_STOP); }
- /* Wait up to one second for other CPUs to stop */ - timeout = USEC_PER_SEC; + /* Wait up to 50 seconds for other CPUs to stop */ + timeout = USEC_PER_SEC * 50; while (num_other_online_cpus() && timeout--) udelay(1);
From: Yingliang Yang yangyingliang@huawei.com
Offering: HULK hulk inclusion category: bugfix bugzilla: 46864 CVE: NA
-------------------------------------------------
The kexec will boot a captured kernel while the kernel panic. But it boots failed if the kernel panic in handler function of PPI. The reason is that the PPI has not been 'eoi', other interrupts can not be handled when booting the captured kernel. This patch fix this bug.
signed-off-by: Yingliang Yang yangyingliang@huawei.com Signed-off-by: Yufen Wang wangyufen@huawei.com Signed-off-by: Hanjun Guo hanjun.guo@linaro.org Signed-off-by: Chen Zhou chenzhou10@huawei.com --- arch/arm64/kernel/machine_kexec.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index a0b144cfaea7..b4a9d3697f3c 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -226,6 +226,22 @@ static void machine_kexec_mask_interrupts(void) if (!chip) continue;
+ /* + * Hisilicon Chips special handle for PPI interruts, should be no + * side effect for other chips + */ + if (desc->irq_data.hwirq > 15 && desc->irq_data.hwirq < 32) { + bool active = false; + + ret = irq_get_irqchip_state(i, IRQCHIP_STATE_ACTIVE, &active); + if (ret) { + pr_debug("Get irq active state failed.\n"); + } else { + if (active) + chip->irq_eoi(&desc->irq_data); + } + } + /* * First try to remove the active state. If this * fails, try to EOI the interrupt.