Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53341
b: refs/heads/master
c: fc4afc7
h: refs/heads/master
i:
  53339: 4f10009
v: v3
  • Loading branch information
Michael Ellerman authored and Greg Kroah-Hartman committed May 3, 2007
1 parent fd15f5f commit ea13965
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 00ba16ab2658afe11d4fdcaf16a331292c44bee6
refs/heads/master: fc4afc7b2bdd81e2dbded5a8222676d3161758d3
49 changes: 20 additions & 29 deletions trunk/drivers/pci/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,10 +674,26 @@ int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec)
return status;
}

void pci_disable_msix(struct pci_dev* dev)
static void msix_free_all_irqs(struct pci_dev *dev)
{
int irq, head, tail = 0;

irq = head = dev->first_msi_irq;
while (head != tail) {
tail = get_irq_msi(irq)->link.tail;

BUG_ON(irq_has_action(irq));

if (irq != head)
msi_free_irq(dev, irq);
irq = tail;
}
msi_free_irq(dev, irq);
dev->first_msi_irq = 0;
}

void pci_disable_msix(struct pci_dev* dev)
{
if (!pci_msi_enable)
return;
if (!dev)
Expand All @@ -690,18 +706,7 @@ void pci_disable_msix(struct pci_dev* dev)
pci_intx(dev, 1); /* enable intx */
dev->msix_enabled = 0;

irq = head = dev->first_msi_irq;
while (head != tail) {
tail = get_irq_msi(irq)->link.tail;

BUG_ON(irq_has_action(irq));

if (irq != head) /* Release MSI-X irq */
msi_free_irq(dev, irq);
irq = tail;
}
msi_free_irq(dev, irq);
dev->first_msi_irq = 0;
msix_free_all_irqs(dev);
}

/**
Expand All @@ -722,23 +727,9 @@ void msi_remove_pci_irq_vectors(struct pci_dev* dev)
BUG_ON(irq_has_action(dev->first_msi_irq));
msi_free_irq(dev, dev->first_msi_irq);
}
if (dev->msix_enabled) {
int irq, head, tail = 0;
void __iomem *base = NULL;

irq = head = dev->first_msi_irq;
while (head != tail) {
tail = get_irq_msi(irq)->link.tail;
base = get_irq_msi(irq)->mask_base;

BUG_ON(irq_has_action(irq));

if (irq != head) /* Release MSI-X irq */
msi_free_irq(dev, irq);
irq = tail;
}
msi_free_irq(dev, irq);
}
if (dev->msix_enabled)
msix_free_all_irqs(dev);
}

void pci_no_msi(void)
Expand Down

0 comments on commit ea13965

Please sign in to comment.