aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2009-02-16 19:18:49 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-02-22 23:53:03 -0500
commitd523cc379da57f1c39f5db9c47bdaa94f74727ff (patch)
tree633a0fdaed64cea289706aa00063de9705cb29f2 /arch
parent620165f971753c2c451c880796bac7cd66f3534a (diff)
powerpc/pseries: Return req#msi(-x) if request is larger
If a driver asks for more MSIs than the devices "req#msi(-x)" property, we currently return -ENOSPC. This doesn't give the driver any chance to make a new request with a number that might work. So if "req#msi(-x)" is less than the request, return its value. To be 100% safe, make sure we return an error if req_msi == 0. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/pseries/msi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
index 073b518338a..081af6d7fa0 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -154,7 +154,11 @@ static int check_req(struct pci_dev *pdev, int nvec, char *prop_name)
154 154
155 if (*req_msi < nvec) { 155 if (*req_msi < nvec) {
156 pr_debug("rtas_msi: %s requests < %d MSIs\n", prop_name, nvec); 156 pr_debug("rtas_msi: %s requests < %d MSIs\n", prop_name, nvec);
157 return -ENOSPC; 157
158 if (*req_msi == 0) /* Be paranoid */
159 return -ENOSPC;
160
161 return *req_msi;
158 } 162 }
159 163
160 return 0; 164 return 0;