[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>
This commit is contained in:
parent
5dda65c21b
commit
34cf382c8b
|
@ -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)
|
if (type == PCIY_MSI)
|
||||||
{
|
{
|
||||||
int last_irq = -1;
|
int last_irq = -1, irq_idx;
|
||||||
rt_size_t irq_nr;
|
rt_size_t irq_nr;
|
||||||
|
|
||||||
desc = rt_pci_msi_first_desc(pdev);
|
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;
|
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 */
|
/* 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);
|
rt_hw_spin_unlock(&msi_irq_map_lock.lock);
|
||||||
|
|
Loading…
Reference in New Issue