Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138439
b: refs/heads/master
c: 3a51c0c
h: refs/heads/master
i:
  138437: 8c99b8d
  138435: e802887
  138431: c3df475
v: v3
  • Loading branch information
Michael Ellerman authored and Benjamin Herrenschmidt committed Feb 11, 2009
1 parent 57e065e commit 45003cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 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: e27ed698b88b3387d326e84c0bbe9f83e19c747b
refs/heads/master: 3a51c0cbea947dc9194e18f11661eaa4dbfc5c13
20 changes: 15 additions & 5 deletions trunk/arch/powerpc/platforms/pseries/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static void rtas_teardown_msi_irqs(struct pci_dev *pdev)
rtas_disable_msi(pdev);
}

static int check_req_msi(struct pci_dev *pdev, int nvec)
static int check_req(struct pci_dev *pdev, int nvec, char *prop_name)
{
struct device_node *dn;
struct pci_dn *pdn;
Expand All @@ -144,24 +144,34 @@ static int check_req_msi(struct pci_dev *pdev, int nvec)

dn = pdn->node;

req_msi = of_get_property(dn, "ibm,req#msi", NULL);
req_msi = of_get_property(dn, prop_name, NULL);
if (!req_msi) {
pr_debug("rtas_msi: No ibm,req#msi on %s\n", dn->full_name);
pr_debug("rtas_msi: No %s on %s\n", prop_name, dn->full_name);
return -ENOENT;
}

if (*req_msi < nvec) {
pr_debug("rtas_msi: ibm,req#msi requests < %d MSIs\n", nvec);
pr_debug("rtas_msi: %s requests < %d MSIs\n", prop_name, nvec);
return -ENOSPC;
}

return 0;
}

static int check_req_msi(struct pci_dev *pdev, int nvec)
{
return check_req(pdev, nvec, "ibm,req#msi");
}

static int check_req_msix(struct pci_dev *pdev, int nvec)
{
return check_req(pdev, nvec, "ibm,req#msi-x");
}

static int rtas_msi_check_device(struct pci_dev *pdev, int nvec, int type)
{
if (type == PCI_CAP_ID_MSIX)
pr_debug("rtas_msi: MSI-X untested, trying anyway.\n");
return check_req_msix(pdev, nvec);

return check_req_msi(pdev, nvec);
}
Expand Down

0 comments on commit 45003cd

Please sign in to comment.