From: Mao HongBo maohongbo@phytium.com.cn
Phytium inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I41AUQ CVE: NA
-------------------------------------------------
Fix the issue that interrupts are concentrated in one cpu for Phytium S2500 server.
Signed-off-by: Mao HongBo maohongbo@phytium.com.cn Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com Reviewed-by: Hanjun Guo guohanjun@huawei.com Signed-off-by: Laibin Qiu qiulaibin@huawei.com --- drivers/irqchip/irq-gic-phytium-2500-its.c | 3 +-- drivers/irqchip/irq-gic-phytium-2500.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/irqchip/irq-gic-phytium-2500-its.c b/drivers/irqchip/irq-gic-phytium-2500-its.c index fff1c8546d23..dd24af3793ca 100644 --- a/drivers/irqchip/irq-gic-phytium-2500-its.c +++ b/drivers/irqchip/irq-gic-phytium-2500-its.c @@ -1181,8 +1181,7 @@ static int its_cpumask_select(struct its_device *its_dev, }
cpu = cpumask_any_and(mask_val, cpu_mask); - if ((cpu > cpus) && (cpu < (cpus + skt_cpu_cnt[skt_id]))) - cpus = cpu; + cpus = cpus + cpu % skt_cpu_cnt[skt_id];
if (is_kdump_kernel()) { skt = (cpu_logical_map(cpu) >> 16) & 0xff; diff --git a/drivers/irqchip/irq-gic-phytium-2500.c b/drivers/irqchip/irq-gic-phytium-2500.c index 8674463a08c6..103e97f5855e 100644 --- a/drivers/irqchip/irq-gic-phytium-2500.c +++ b/drivers/irqchip/irq-gic-phytium-2500.c @@ -1123,8 +1123,7 @@ static int gic_cpumask_select(struct irq_data *d, const struct cpumask *mask_val }
cpu = cpumask_any_and(mask_val, cpu_online_mask); - if ((cpu > cpus) && (cpu < (cpus + skt_cpu_cnt[irq_skt]))) - cpus = cpu; + cpus = cpus + cpu % skt_cpu_cnt[irq_skt];
if (is_kdump_kernel()) { skt = (cpu_logical_map(cpu) >> 16) & 0xff;