Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138441
b: refs/heads/master
c: 6071ed0
h: refs/heads/master
i:
  138439: 45003cd
v: v3
  • Loading branch information
Michael Ellerman authored and Benjamin Herrenschmidt committed Feb 11, 2009
1 parent 438b421 commit 9e4a478
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 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: 649781f82782d142443d895b98edbd8be4e75c56
refs/heads/master: 6071ed0487c6ea8dcfadd9844b9b90944cd9de1e
16 changes: 9 additions & 7 deletions trunk/arch/powerpc/platforms/pseries/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ static int rtas_change_msi(struct pci_dn *pdn, u32 func, u32 num_irqs)
} while (rtas_busy_delay(rc));

/*
* If the RTAS call succeeded, check the number of irqs is actually
* what we asked for. If not, return an error.
* If the RTAS call succeeded, return the number of irqs allocated.
* If not, make sure we return a negative error code.
*/
if (rc == 0 && rtas_ret[0] != num_irqs)
rc = -ENOSPC;
if (rc == 0)
rc = rtas_ret[0];
else if (rc > 0)
rc = -rc;

pr_debug("rtas_msi: ibm,change_msi(func=%d,num=%d), got %d rc = %d\n",
func, num_irqs, rtas_ret[0], rc);
Expand All @@ -91,7 +93,7 @@ static void rtas_disable_msi(struct pci_dev *pdev)
if (!pdn)
return;

if (rtas_change_msi(pdn, RTAS_CHANGE_FN, 0))
if (rtas_change_msi(pdn, RTAS_CHANGE_FN, 0) != 0)
pr_debug("rtas_msi: Setting MSIs to 0 failed!\n");
}

Expand Down Expand Up @@ -195,14 +197,14 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
if (type == PCI_CAP_ID_MSI) {
rc = rtas_change_msi(pdn, RTAS_CHANGE_MSI_FN, nvec);

if (rc) {
if (rc < 0) {
pr_debug("rtas_msi: trying the old firmware call.\n");
rc = rtas_change_msi(pdn, RTAS_CHANGE_FN, nvec);
}
} else
rc = rtas_change_msi(pdn, RTAS_CHANGE_MSIX_FN, nvec);

if (rc) {
if (rc != nvec) {
pr_debug("rtas_msi: rtas_change_msi() failed\n");
return rc;
}
Expand Down

0 comments on commit 9e4a478

Please sign in to comment.