Skip to content

Commit 651b39c

Browse files
committed
powerpc/pseries/msi: Let core code check for contiguous entries
Set the domain info flag and remove the check. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7a82344 commit 651b39c

File tree

1 file changed

+8
-25
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+8
-25
lines changed

arch/powerpc/platforms/pseries/msi.c

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -321,27 +321,6 @@ static int msi_quota_for_device(struct pci_dev *dev, int request)
321321
return request;
322322
}
323323

324-
static int check_msix_entries(struct pci_dev *pdev)
325-
{
326-
struct msi_desc *entry;
327-
int expected;
328-
329-
/* There's no way for us to express to firmware that we want
330-
* a discontiguous, or non-zero based, range of MSI-X entries.
331-
* So we must reject such requests. */
332-
333-
expected = 0;
334-
for_each_pci_msi_entry(entry, pdev) {
335-
if (entry->msi_index != expected) {
336-
pr_debug("rtas_msi: bad MSI-X entries.\n");
337-
return -EINVAL;
338-
}
339-
expected++;
340-
}
341-
342-
return 0;
343-
}
344-
345324
static void rtas_hack_32bit_msi_gen2(struct pci_dev *pdev)
346325
{
347326
u32 addr_hi, addr_lo;
@@ -380,9 +359,6 @@ static int rtas_prepare_msi_irqs(struct pci_dev *pdev, int nvec_in, int type,
380359
if (quota && quota < nvec)
381360
return quota;
382361

383-
if (type == PCI_CAP_ID_MSIX && check_msix_entries(pdev))
384-
return -EINVAL;
385-
386362
/*
387363
* Firmware currently refuse any non power of two allocation
388364
* so we round up if the quota will allow it.
@@ -529,9 +505,16 @@ static struct irq_chip pseries_pci_msi_irq_chip = {
529505
.irq_write_msi_msg = pseries_msi_write_msg,
530506
};
531507

508+
509+
/*
510+
* Set MSI_FLAG_MSIX_CONTIGUOUS as there is no way to express to
511+
* firmware to request a discontiguous or non-zero based range of
512+
* MSI-X entries. Core code will reject such setup attempts.
513+
*/
532514
static struct msi_domain_info pseries_msi_domain_info = {
533515
.flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
534-
MSI_FLAG_MULTI_PCI_MSI | MSI_FLAG_PCI_MSIX),
516+
MSI_FLAG_MULTI_PCI_MSI | MSI_FLAG_PCI_MSIX |
517+
MSI_FLAG_MSIX_CONTIGUOUS),
535518
.ops = &pseries_pci_msi_domain_ops,
536519
.chip = &pseries_pci_msi_irq_chip,
537520
};

0 commit comments

Comments
 (0)