Commit feffd35a authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'irq-urgent-2024-12-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq fix from Ingo Molnar:
 "Fix bogus MSI IRQ setup warning on RISC-V"

* tag 'irq-urgent-2024-12-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  PCI/MSI: Handle lack of irqdomain gracefully
parents c0593616 a60b9907
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -350,8 +350,11 @@ bool pci_msi_domain_supports(struct pci_dev *pdev, unsigned int feature_mask,

	domain = dev_get_msi_domain(&pdev->dev);

	if (!domain || !irq_domain_is_hierarchy(domain))
	if (!domain || !irq_domain_is_hierarchy(domain)) {
		if (IS_ENABLED(CONFIG_PCI_MSI_ARCH_FALLBACKS))
			return mode == ALLOW_LEGACY;
		return false;
	}

	if (!irq_domain_is_msi_parent(domain)) {
		/*
+4 −0
Original line number Diff line number Diff line
@@ -433,6 +433,10 @@ int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec,
	if (WARN_ON_ONCE(dev->msi_enabled))
		return -EINVAL;

	/* Test for the availability of MSI support */
	if (!pci_msi_domain_supports(dev, 0, ALLOW_LEGACY))
		return -ENOTSUPP;

	nvec = pci_msi_vec_count(dev);
	if (nvec < 0)
		return nvec;