Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138531
b: refs/heads/master
c: 94afa5a
h: refs/heads/master
i:
  138529: efa5785
  138527: 1b28391
v: v3
  • Loading branch information
Michael Ellerman authored and Benjamin Herrenschmidt committed Mar 11, 2009
1 parent 6c4bf95 commit ef8b54a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e7943fbbfdb6eef03c003b374de1f802cc14f02a
refs/heads/master: 94afa5a5f54235c4612198768b6a2fa2e2366f44
24 changes: 24 additions & 0 deletions trunk/arch/powerpc/platforms/pseries/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,27 @@ static int rtas_msi_check_device(struct pci_dev *pdev, int nvec, int type)
return 0;
}

static int check_msix_entries(struct pci_dev *pdev)
{
struct msi_desc *entry;
int expected;

/* There's no way for us to express to firmware that we want
* a discontiguous, or non-zero based, range of MSI-X entries.
* So we must reject such requests. */

expected = 0;
list_for_each_entry(entry, &pdev->msi_list, list) {
if (entry->msi_attrib.entry_nr != expected) {
pr_debug("rtas_msi: bad MSI-X entries.\n");
return -EINVAL;
}
expected++;
}

return 0;
}

static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
{
struct pci_dn *pdn;
Expand All @@ -367,6 +388,9 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
if (!pdn)
return -ENODEV;

if (type == PCI_CAP_ID_MSIX && check_msix_entries(pdev))
return -EINVAL;

/*
* Try the new more explicit firmware interface, if that fails fall
* back to the old interface. The old interface is known to never
Expand Down

0 comments on commit ef8b54a

Please sign in to comment.