Skip to content

Commit 1402f2f

Browse files
author
CKI KWF Bot
committed
Merge: PCI/MSI: Handle lack of irqdomain gracefully
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1300 JIRA: https://issues.redhat.com/browse/RHEL-107953 Upstream Status: upstream Fix the call traces found in special aws instances. Signed-off-by: Frank Liang <xiliang@redhat.com> Approved-by: Vitaly Kuznetsov <vkuznets@redhat.com> Approved-by: Myron Stowe <mstowe@redhat.com> Approved-by: John W. Linville <linville@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 2c0edf7 + f00ed55 commit 1402f2f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

drivers/pci/msi/irqdomain.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,11 @@ bool pci_msi_domain_supports(struct pci_dev *pdev, unsigned int feature_mask,
350350

351351
domain = dev_get_msi_domain(&pdev->dev);
352352

353-
if (!domain || !irq_domain_is_hierarchy(domain))
354-
return mode == ALLOW_LEGACY;
353+
if (!domain || !irq_domain_is_hierarchy(domain)) {
354+
if (IS_ENABLED(CONFIG_PCI_MSI_ARCH_FALLBACKS))
355+
return mode == ALLOW_LEGACY;
356+
return false;
357+
}
355358

356359
if (!irq_domain_is_msi_parent(domain)) {
357360
/*

drivers/pci/msi/msi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,10 @@ int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec,
433433
if (WARN_ON_ONCE(dev->msi_enabled))
434434
return -EINVAL;
435435

436+
/* Test for the availability of MSI support */
437+
if (!pci_msi_domain_supports(dev, 0, ALLOW_LEGACY))
438+
return -ENOTSUPP;
439+
436440
nvec = pci_msi_vec_count(dev);
437441
if (nvec < 0)
438442
return nvec;

0 commit comments

Comments
 (0)