aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/pci
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2014-10-29 14:12:04 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2014-11-03 07:30:12 -0500
commitb19148f6e2d90738ecf0c2eeeb9bdbae25c59e9b (patch)
treeed783c217e3f45029b243f615ce4e3ca239efcc7 /arch/s390/pci
parentf318a1229bd8d377282ddb37158812073701a22b (diff)
s390/pci: improve irq number check for msix
s390s arch_setup_msi_irqs function ensures that we don't return with more irqs than the PCI architecture allows and that a single PCI function doesn't consume more irqs than the kernel is configured for. At least the last check doesn't help much and should take the sum of all irqs into account. Since that's already done by irq_alloc_desc we can remove this check. As for the first check we should use the value provided by the firmware which can be less than what the PCI architecture allows. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/pci')
-rw-r--r--arch/s390/pci/pci.c3
-rw-r--r--arch/s390/pci/pci_clp.c1
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index 2fa7b14b9c08..47a4568e141d 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -369,8 +369,7 @@ int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
369 369
370 if (type == PCI_CAP_ID_MSI && nvec > 1) 370 if (type == PCI_CAP_ID_MSI && nvec > 1)
371 return 1; 371 return 1;
372 msi_vecs = min(nvec, ZPCI_MSI_VEC_MAX); 372 msi_vecs = min_t(unsigned int, nvec, zdev->max_msi);
373 msi_vecs = min_t(unsigned int, msi_vecs, CONFIG_PCI_NR_MSI);
374 373
375 /* Allocate adapter summary indicator bit */ 374 /* Allocate adapter summary indicator bit */
376 rc = -EIO; 375 rc = -EIO;
diff --git a/arch/s390/pci/pci_clp.c b/arch/s390/pci/pci_clp.c
index 6e22a247de9b..d6e411ed8b1f 100644
--- a/arch/s390/pci/pci_clp.c
+++ b/arch/s390/pci/pci_clp.c
@@ -62,6 +62,7 @@ static void clp_store_query_pci_fngrp(struct zpci_dev *zdev,
62 zdev->tlb_refresh = response->refresh; 62 zdev->tlb_refresh = response->refresh;
63 zdev->dma_mask = response->dasm; 63 zdev->dma_mask = response->dasm;
64 zdev->msi_addr = response->msia; 64 zdev->msi_addr = response->msia;
65 zdev->max_msi = response->noi;
65 zdev->fmb_update = response->mui; 66 zdev->fmb_update = response->mui;
66 67
67 switch (response->version) { 68 switch (response->version) {