From 34cf382c8bce3b0e9799c9f881cd6df35075854e Mon Sep 17 00:00:00 2001 From: GuEe-GUI <2991707448@qq.com> Date: Mon, 18 Nov 2024 17:46:18 +0800 Subject: [PATCH] [DM/FIXUP] Fixup PCI MSI global irq map Don't use `irq` as a var when clear MSI global irq map, the irq which alloc before will rewrite. Signed-off-by: GuEe-GUI <2991707448@qq.com> --- components/drivers/pci/msi/irq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/drivers/pci/msi/irq.c b/components/drivers/pci/msi/irq.c index 273f5c9bf9..ff49b28188 100644 --- a/components/drivers/pci/msi/irq.c +++ b/components/drivers/pci/msi/irq.c @@ -34,7 +34,7 @@ rt_err_t rt_pci_msi_setup_irqs(struct rt_pci_device *pdev, int nvec, int type) if (type == PCIY_MSI) { - int last_irq = -1; + int last_irq = -1, irq_idx; rt_size_t irq_nr; desc = rt_pci_msi_first_desc(pdev); @@ -74,12 +74,12 @@ rt_err_t rt_pci_msi_setup_irqs(struct rt_pci_device *pdev, int nvec, int type) desc->irq = irq - irq_nr; } - rt_bitmap_for_each_set_bit(msi_irq_map, irq, MAX_HANDLERS) + rt_bitmap_for_each_set_bit(msi_irq_map, irq_idx, MAX_HANDLERS) { - msi_pic->ops->irq_free_msi(msi_pic, irq); + msi_pic->ops->irq_free_msi(msi_pic, irq_idx); /* Free bit so the next user doesn't need to bzero */ - rt_bitmap_clear_bit(msi_irq_map, irq); + rt_bitmap_clear_bit(msi_irq_map, irq_idx); } rt_hw_spin_unlock(&msi_irq_map_lock.lock);