LoongArch: Remove generic irq migration

Upstream: no

Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
Signed-off-by: Juxin Gao <gaojuxin@loongson.cn>
Signed-off-by: Ming Wang <wangming01@loongson.cn>
This commit is contained in:
Jianmin Lv 2024-03-02 11:48:23 +08:00 committed by aurelianliu
parent 7015dd0470
commit fa4d9c004b
5 changed files with 40 additions and 5 deletions

View File

@ -424,7 +424,6 @@ 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.

View File

@ -119,6 +119,7 @@ extern struct fwnode_handle *pch_lpc_handle;
extern struct fwnode_handle *pch_pic_handle[MAX_IO_PICS];
extern irqreturn_t loongson_ipi_interrupt(int irq, void *dev);
extern void fixup_irqs(void);
#include <asm-generic/irq.h>

View File

@ -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;

View File

@ -372,8 +372,7 @@ int loongson_cpu_disable(void)
clear_cpu_sibling_map(cpu);
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();

View File

@ -148,5 +148,5 @@ config GENERIC_IRQ_MULTI_HANDLER
# Do not even think of enabling this on any new platform
config DEPRECATED_IRQ_CPU_ONOFFLINE
bool
depends on CAVIUM_OCTEON_SOC
default CAVIUM_OCTEON_SOC
depends on CAVIUM_OCTEON_SOC || LOONGARCH
default CAVIUM_OCTEON_SOC || LOONGARCH