Skip to content

Commit b88b6f0

Browse files
Zheng Chongzhenopsiff
authored andcommitted
sw64: msi: clear residual vector irq mapping when free irqs
This path complements commit 7b9e38345558 ("sw64: msi: clear the residual vector_irq information of cpu") by addressing the same problem on host OS. Signed-off-by: Zheng Chongzhen <zhengchongzhen@wxiat.com> Reviewed-by: He Sheng <hesheng@wxiat.com> Signed-off-by: Gu Zitao <guzitao@wxiat.com> (cherry picked from commit f391100)
1 parent d15d4a1 commit b88b6f0

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/irqchip/irq-sunway-msi-v2.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,13 @@ static void sw64_vector_free_irqs(struct irq_domain *domain,
333333
irq_domain_reset_irq_data(irq_data);
334334
cdata->multi_msi--;
335335
per_cpu(vector_irq, cdata->dst_cpu)[cdata->vector] = 0;
336+
if (cdata->move_in_progress)
337+
per_cpu(vector_irq, cdata->prev_cpu)[cdata->prev_vector] = 0;
336338

337-
if (cdata->multi_msi)
339+
if (cdata->multi_msi) {
338340
cdata->vector++;
341+
cdata->prev_vector++;
342+
}
339343

340344
if (cdata->multi_msi == 0)
341345
kfree(cdata);

drivers/irqchip/irq-sunway-msi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ static void sw64_vector_free_irqs(struct irq_domain *domain,
293293
}
294294
irq_domain_reset_irq_data(irq_data);
295295
per_cpu(vector_irq, cdata->dst_cpu)[cdata->vector] = 0;
296+
if (cdata->move_in_progress)
297+
per_cpu(vector_irq, cdata->prev_cpu)[cdata->prev_vector] = 0;
296298
kfree(cdata);
297299
raw_spin_unlock_irqrestore(&vector_lock, flags);
298300
}

0 commit comments

Comments
 (0)