linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "tip-bot2 for Thomas Gleixner" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Michael Kelley <mikelley@microsoft.com>,
	Nishanth Menon <nm@ti.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	Jason Gunthorpe <jgg@nvidia.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: irq/msi] PCI/MSI: Let the irq code handle sysfs groups
Date: Thu, 16 Dec 2021 21:41:03 -0000	[thread overview]
Message-ID: <163969086316.23020.5798765956546581612.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20211210221814.048612053@linutronix.de>

The following commit has been merged into the irq/msi branch of tip:

Commit-ID:     ffd84485e6beb9cad3e5a133d88201b995298c33
Gitweb:        https://git.kernel.org/tip/ffd84485e6beb9cad3e5a133d88201b995298c33
Author:        Thomas Gleixner <tglx@linutronix.de>
AuthorDate:    Fri, 10 Dec 2021 23:19:05 +01:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Thu, 16 Dec 2021 22:16:39 +01:00

PCI/MSI: Let the irq code handle sysfs groups

Set the domain info flag which makes the core code handle sysfs groups and
put an explicit invocation into the legacy code.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Tested-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20211210221814.048612053@linutronix.de

---
 drivers/pci/msi/irqdomain.c |  2 +-
 drivers/pci/msi/legacy.c    |  6 +++++-
 drivers/pci/msi/msi.c       | 23 -----------------------
 include/linux/pci.h         |  1 -
 4 files changed, 6 insertions(+), 26 deletions(-)

diff --git a/drivers/pci/msi/irqdomain.c b/drivers/pci/msi/irqdomain.c
index a554690..26b23a1 100644
--- a/drivers/pci/msi/irqdomain.c
+++ b/drivers/pci/msi/irqdomain.c
@@ -159,7 +159,7 @@ struct irq_domain *pci_msi_create_irq_domain(struct fwnode_handle *fwnode,
 	if (info->flags & MSI_FLAG_USE_DEF_CHIP_OPS)
 		pci_msi_domain_update_chip_ops(info);
 
-	info->flags |= MSI_FLAG_ACTIVATE_EARLY;
+	info->flags |= MSI_FLAG_ACTIVATE_EARLY | MSI_FLAG_DEV_SYSFS;
 	if (IS_ENABLED(CONFIG_GENERIC_IRQ_RESERVATION_MODE))
 		info->flags |= MSI_FLAG_MUST_REACTIVATE;
 
diff --git a/drivers/pci/msi/legacy.c b/drivers/pci/msi/legacy.c
index d52cff1..773f351 100644
--- a/drivers/pci/msi/legacy.c
+++ b/drivers/pci/msi/legacy.c
@@ -70,10 +70,14 @@ int pci_msi_legacy_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 {
 	int ret = arch_setup_msi_irqs(dev, nvec, type);
 
-	return pci_msi_setup_check_result(dev, type, ret);
+	ret = pci_msi_setup_check_result(dev, type, ret);
+	if (!ret)
+		ret = msi_device_populate_sysfs(&dev->dev);
+	return ret;
 }
 
 void pci_msi_legacy_teardown_msi_irqs(struct pci_dev *dev)
 {
+	msi_device_destroy_sysfs(&dev->dev);
 	arch_teardown_msi_irqs(dev);
 }
diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c
index 369e3c5..76c15be 100644
--- a/drivers/pci/msi/msi.c
+++ b/drivers/pci/msi/msi.c
@@ -233,11 +233,6 @@ static void free_msi_irqs(struct pci_dev *dev)
 			for (i = 0; i < entry->nvec_used; i++)
 				BUG_ON(irq_has_action(entry->irq + i));
 
-	if (dev->msi_irq_groups) {
-		msi_destroy_sysfs(&dev->dev, dev->msi_irq_groups);
-		dev->msi_irq_groups = NULL;
-	}
-
 	pci_msi_teardown_msi_irqs(dev);
 
 	list_for_each_entry_safe(entry, tmp, msi_list, list) {
@@ -455,7 +450,6 @@ static int msi_verify_entries(struct pci_dev *dev)
 static int msi_capability_init(struct pci_dev *dev, int nvec,
 			       struct irq_affinity *affd)
 {
-	const struct attribute_group **groups;
 	struct msi_desc *entry;
 	int ret;
 
@@ -486,14 +480,6 @@ static int msi_capability_init(struct pci_dev *dev, int nvec,
 	if (ret)
 		goto err;
 
-	groups = msi_populate_sysfs(&dev->dev);
-	if (IS_ERR(groups)) {
-		ret = PTR_ERR(groups);
-		goto err;
-	}
-
-	dev->msi_irq_groups = groups;
-
 	/* Set MSI enabled bits	*/
 	pci_intx_for_msi(dev, 0);
 	pci_msi_set_enable(dev, 1);
@@ -622,7 +608,6 @@ static void msix_mask_all(void __iomem *base, int tsize)
 static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries,
 				int nvec, struct irq_affinity *affd)
 {
-	const struct attribute_group **groups;
 	void __iomem *base;
 	int ret, tsize;
 	u16 control;
@@ -664,14 +649,6 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries,
 
 	msix_update_entries(dev, entries);
 
-	groups = msi_populate_sysfs(&dev->dev);
-	if (IS_ERR(groups)) {
-		ret = PTR_ERR(groups);
-		goto out_free;
-	}
-
-	dev->msi_irq_groups = groups;
-
 	/* Disable INTX */
 	pci_intx_for_msi(dev, 0);
 
diff --git a/include/linux/pci.h b/include/linux/pci.h
index a09736d..0a7b6b2 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -476,7 +476,6 @@ struct pci_dev {
 #ifdef CONFIG_PCI_MSI
 	void __iomem	*msix_base;
 	raw_spinlock_t	msi_lock;
-	const struct attribute_group **msi_irq_groups;
 #endif
 	struct pci_vpd	vpd;
 #ifdef CONFIG_PCIE_DPC

  reply	other threads:[~2021-12-16 21:42 UTC|newest]

Thread overview: 122+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 22:18 [patch V3 00/35] genirq/msi, PCI/MSI: Spring cleaning - Part 2 Thomas Gleixner
2021-12-10 22:18 ` [patch V3 01/35] PCI/MSI: Set pci_dev::msi[x]_enabled early Thomas Gleixner
2021-12-13 13:37   ` Jason Gunthorpe
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:18 ` [patch V3 02/35] x86/pci/XEN: Use PCI device property Thomas Gleixner
2021-12-13 13:56   ` Jason Gunthorpe
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:18 ` [patch V3 03/35] x86/apic/msi: Use PCI device MSI property Thomas Gleixner
2021-12-11 10:52   ` Greg Kroah-Hartman
2021-12-13 13:59   ` Jason Gunthorpe
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:18 ` [patch V3 04/35] genirq/msi: Use PCI device property Thomas Gleixner
2021-12-13 13:59   ` Jason Gunthorpe
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:18 ` [patch V3 05/35] powerpc/cell/axon_msi: " Thomas Gleixner
2021-12-11 15:21   ` Arnd Bergmann
2021-12-13 14:01   ` Jason Gunthorpe
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:18 ` [patch V3 06/35] powerpc/pseries/msi: Use PCI device properties Thomas Gleixner
2021-12-13 14:04   ` Jason Gunthorpe
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:18 ` [patch V3 07/35] device: Move MSI related data into a struct Thomas Gleixner
2021-12-11 15:22   ` Arnd Bergmann
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:18 ` [patch V3 08/35] device: Add device:: Msi_data pointer and struct msi_device_data Thomas Gleixner
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:18 ` [patch V3 09/35] PCI/MSI: Allocate MSI device data on first use Thomas Gleixner
2021-12-15 17:16   ` [patch V4 09-01/35] PCI/MSI: Decouple MSI[-X] disable from pcim_release() Thomas Gleixner
2021-12-15 17:19     ` [patch V4 09-02/35] PCI/MSI: Allocate MSI device data on first use Thomas Gleixner
2021-12-15 17:46       ` Greg Kroah-Hartman
2021-12-16 21:41       ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-15 17:46     ` [patch V4 09-01/35] PCI/MSI: Decouple MSI[-X] disable from pcim_release() Greg Kroah-Hartman
2021-12-16 21:41     ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:18 ` [patch V3 10/35] platform-msi: Allocate MSI device data on first use Thomas Gleixner
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 11/35] bus: fsl-mc-msi: " Thomas Gleixner
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 12/35] soc: ti: ti_sci_inta_msi: " Thomas Gleixner
2021-12-11 15:22   ` Arnd Bergmann
2021-12-13 17:56   ` Nishanth Menon
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 13/35] genirq/msi: Provide msi_device_populate/destroy_sysfs() Thomas Gleixner
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 14/35] PCI/MSI: Let the irq code handle sysfs groups Thomas Gleixner
2021-12-16 21:41   ` tip-bot2 for Thomas Gleixner [this message]
2021-12-10 22:19 ` [patch V3 15/35] platform-msi: Let the core " Thomas Gleixner
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 16/35] genirq/msi: Remove the original sysfs interfaces Thomas Gleixner
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 17/35] platform-msi: Rename functions and clarify comments Thomas Gleixner
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 18/35] platform-msi: Store platform private data pointer in msi_device_data Thomas Gleixner
2021-12-16 21:41   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 19/35] genirq/msi: Consolidate MSI descriptor data Thomas Gleixner
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 20/35] platform-msi: Use msi_desc::msi_index Thomas Gleixner
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 21/35] bus: fsl-mc-msi: " Thomas Gleixner
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 22/35] soc: ti: ti_sci_inta_msi: " Thomas Gleixner
2021-12-13 17:57   ` Nishanth Menon
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 23/35] PCI/MSI: " Thomas Gleixner
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 24/35] PCI/MSI: Provide MSI_FLAG_MSIX_CONTIGUOUS Thomas Gleixner
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 25/35] powerpc/pseries/msi: Let core code check for contiguous entries Thomas Gleixner
2021-12-13 14:05   ` Jason Gunthorpe
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 26/35] genirq/msi: Provide interface to retrieve Linux interrupt number Thomas Gleixner
2021-12-13 14:22   ` Jason Gunthorpe
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 27/35] PCI/MSI: Use __msi_get_virq() in pci_get_vector() Thomas Gleixner
2021-12-13 14:23   ` Jason Gunthorpe
2021-12-16 21:40   ` [tip: irq/msi] PCI/MSI: Use msi_get_virq() " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 28/35] PCI/MSI: Simplify pci_irq_get_affinity() Thomas Gleixner
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-17 22:30   ` [patch V3 28/35] " Nathan Chancellor
2021-12-18 10:25     ` Thomas Gleixner
2021-12-18 19:04       ` Nathan Chancellor
2021-12-18 19:39       ` [tip: irq/msi] PCI/MSI: Unbreak pci_irq_get_affinity() tip-bot2 for Thomas Gleixner
2021-12-18 20:25       ` [patch V3 28/35] PCI/MSI: Simplify pci_irq_get_affinity() Cédric Le Goater
2021-12-20 11:55         ` Thomas Gleixner
2022-01-30 17:12   ` Guenter Roeck
2022-01-31 11:27     ` Thomas Gleixner
2022-01-31 15:21       ` Guenter Roeck
2022-01-31 21:16         ` Thomas Gleixner
2022-02-04  8:57           ` [tip: irq/urgent] PCI/MSI: Remove bogus warning in pci_irq_get_affinity() tip-bot2 for Thomas Gleixner
2022-02-04 11:29             ` Thorsten Leemhuis
2021-12-10 22:19 ` [patch V3 29/35] dmaengine: mv_xor_v2: Get rid of msi_desc abuse Thomas Gleixner
2021-12-13  5:14   ` Vinod Koul
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 30/35] perf/smmuv3: Use msi_get_virq() Thomas Gleixner
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 31/35] iommu/arm-smmu-v3: " Thomas Gleixner
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 32/35] mailbox: bcm-flexrm-mailbox: Rework MSI interrupt handling Thomas Gleixner
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 33/35] bus: fsl-mc: fsl-mc-allocator: Rework MSI handling Thomas Gleixner
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 34/35] soc: ti: ti_sci_inta_msi: Get rid of ti_sci_inta_msi_get_virq() Thomas Gleixner
2021-12-11 15:24   ` Arnd Bergmann
2021-12-13  5:15   ` Vinod Koul
2021-12-13 17:57   ` Nishanth Menon
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-10 22:19 ` [patch V3 35/35] dmaengine: qcom_hidma: Cleanup MSI handling Thomas Gleixner
2021-12-13  5:14   ` Vinod Koul
2021-12-16 21:40   ` [tip: irq/msi] " tip-bot2 for Thomas Gleixner
2021-12-13 18:29 ` [patch V3 00/35] genirq/msi, PCI/MSI: Spring cleaning - Part 2 Nishanth Menon
2021-12-14  9:41   ` Thomas Gleixner
2021-12-14 16:22     ` Nishanth Menon
2021-12-14 16:36       ` Thomas Gleixner
2021-12-14 17:03         ` Thomas Gleixner
2021-12-14 20:15           ` Thomas Gleixner
2021-12-14 20:56             ` Nishanth Menon
2021-12-14 21:19               ` Thomas Gleixner
2021-12-15 16:18                 ` Thomas Gleixner
2021-12-15 16:35                   ` Thomas Gleixner
2021-12-15 18:08                     ` Nishanth Menon
2021-12-16  1:45                     ` Nishanth Menon
2021-12-16 17:23                       ` Thomas Gleixner
2021-12-16  6:14                     ` Michael Kelley (LINUX)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=163969086316.23020.5798765956546581612.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=bhelgaas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgg@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mikelley@microsoft.com \
    --cc=nm@ti.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).