Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67394
b: refs/heads/master
c: d385366
h: refs/heads/master
v: v3
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Oct 2, 2007
1 parent 749704b commit 57a383d
Show file tree
Hide file tree
Showing 2 changed files with 12 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: fcbe8090a001522f98ad6f3146f0a1d9fa473821
refs/heads/master: d385366a9b96fc3f4705f8513adccceaa0515f97
18 changes: 11 additions & 7 deletions trunk/arch/powerpc/platforms/pseries/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,15 @@ static int rtas_change_msi(struct pci_dn *pdn, u32 func, u32 num_irqs)
seq_num = rtas_ret[1];
} while (rtas_busy_delay(rc));

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

pr_debug("rtas_msi: ibm,change_msi(func=%d,num=%d) = (%d)\n",
func, num_irqs, rc);
pr_debug("rtas_msi: ibm,change_msi(func=%d,num=%d), got %d rc = %d\n",
func, num_irqs, rtas_ret[0], rc);

return rc;
}
Expand All @@ -87,7 +91,7 @@ static void rtas_disable_msi(struct pci_dev *pdev)
if (!pdn)
return;

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

Expand Down Expand Up @@ -180,14 +184,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 != nvec) {
if (rc) {
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 != nvec) {
if (rc) {
pr_debug("rtas_msi: rtas_change_msi() failed\n");
return rc;
}
Expand Down

0 comments on commit 57a383d

Please sign in to comment.