提交 72156ebc 编写于 作者: J Jianmin Lv 提交者: openeuler-sync-bot

LoongArch: Remove generic irq migration

LoongArch inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7362E

--------------------------------

Change-Id: I68a4dfac179ea2575925c3cd256e1179a5934c33
Signed-off-by: NJianmin Lv <lvjianmin@loongson.cn>
Signed-off-by: NJuxin Gao <gaojuxin@loongson.cn>
(cherry picked from commit f24b8441)
上级 5b8766bb
......@@ -395,13 +395,12 @@ config SMP
config HOTPLUG_CPU
bool "Support for hot-pluggable CPUs"
depends on SMP
select GENERIC_IRQ_MIGRATION
help
Say Y here to allow turning CPUs off and on. CPUs can be
controlled through /sys/devices/system/cpu.
(Note: power management support will enable this option
automatically on SMP systems. )
Say N if you want to disable CPU hotplug.
Say Y here to allow turning CPUs off and on. CPUs can be
controlled through /sys/devices/system/cpu.
(Note: power management support will enable this option
automatically on SMP systems. )
Say N if you want to disable CPU hotplug.
config NR_CPUS
int "Maximum number of CPUs (2-256)"
......
......@@ -119,6 +119,7 @@ extern struct fwnode_handle *pch_lpc_handle;
extern struct fwnode_handle *pch_pic_handle[MAX_IO_PICS];
extern irqreturn_t loongson3_ipi_interrupt(int irq, void *dev);
extern void fixup_irqs(void);
#include <asm-generic/irq.h>
......
......@@ -96,6 +96,42 @@ static int __init get_ipi_irq(void)
return -EINVAL;
}
#ifdef CONFIG_HOTPLUG_CPU
static void handle_irq_affinity(void)
{
struct irq_desc *desc;
struct irq_chip *chip;
unsigned int irq;
unsigned long flags;
struct cpumask *affinity;
for_each_active_irq(irq) {
desc = irq_to_desc(irq);
if (!desc)
continue;
raw_spin_lock_irqsave(&desc->lock, flags);
affinity = desc->irq_data.common->affinity;
if (!cpumask_intersects(affinity, cpu_online_mask))
cpumask_copy(affinity, cpu_online_mask);
chip = irq_data_get_irq_chip(&desc->irq_data);
if (chip && chip->irq_set_affinity)
chip->irq_set_affinity(&desc->irq_data,
desc->irq_data.common->affinity, true);
raw_spin_unlock_irqrestore(&desc->lock, flags);
}
}
void fixup_irqs(void)
{
handle_irq_affinity();
irq_cpu_offline();
clear_csr_ecfg(ECFG0_IM);
}
#endif
void __init init_IRQ(void)
{
int i, ret;
......
......@@ -272,8 +272,7 @@ int loongson3_cpu_disable(void)
set_cpu_online(cpu, false);
calculate_cpu_foreign_map();
local_irq_save(flags);
irq_migrate_all_off_this_cpu();
clear_csr_ecfg(ECFG0_IM);
fixup_irqs();
local_irq_restore(flags);
local_flush_tlb_all();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册