LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Bjorn Helgaas <helgaas@kernel.org>, Marc Zygnier <maz@kernel.org>,
Alex Williamson <alex.williamson@redhat.com>,
Kevin Tian <kevin.tian@intel.com>,
Jason Gunthorpe <jgg@nvidia.com>, Megha Dey <megha.dey@intel.com>,
Ashok Raj <ashok.raj@intel.com>,
linux-pci@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Santosh Shilimkar <ssantosh@kernel.org>,
iommu@lists.linux-foundation.org, dmaengine@vger.kernel.org,
Stuart Yoder <stuyoder@gmail.com>,
Laurentiu Tudor <laurentiu.tudor@nxp.com>,
Nishanth Menon <nm@ti.com>, Tero Kristo <kristo@kernel.org>,
linux-arm-kernel@lists.infradead.org, x86@kernel.org,
Vinod Koul <vkoul@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Will Deacon <will@kernel.org>, Sinan Kaya <okaya@kernel.org>
Subject: [patch 09/37] PCI/MSI: Let the irq code handle sysfs groups
Date: Sat, 27 Nov 2021 02:20:20 +0100 (CET) [thread overview]
Message-ID: <20211126230524.478418625@linutronix.de> (raw)
In-Reply-To: <20211126224100.303046749@linutronix.de>
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>
---
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(-)
--- a/drivers/pci/msi/irqdomain.c
+++ b/drivers/pci/msi/irqdomain.c
@@ -159,7 +159,7 @@ struct irq_domain *pci_msi_create_irq_do
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;
--- a/drivers/pci/msi/legacy.c
+++ b/drivers/pci/msi/legacy.c
@@ -71,10 +71,14 @@ int pci_msi_legacy_setup_msi_irqs(struct
{
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);
}
--- a/drivers/pci/msi/msi.c
+++ b/drivers/pci/msi/msi.c
@@ -233,11 +233,6 @@ static void free_msi_irqs(struct pci_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) {
@@ -415,7 +410,6 @@ static int msi_verify_entries(struct pci
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;
@@ -439,14 +433,6 @@ static int msi_capability_init(struct pc
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);
@@ -574,7 +560,6 @@ static void msix_mask_all(void __iomem *
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;
@@ -616,14 +601,6 @@ static int msix_capability_init(struct p
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;
-
/* Set MSI-X enabled bits and unmask the function */
pci_intx_for_msi(dev, 0);
dev->msix_enabled = 1;
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -474,7 +474,6 @@ struct pci_dev {
#endif
#ifdef CONFIG_PCI_MSI
void __iomem *msix_base;
- const struct attribute_group **msi_irq_groups;
#endif
struct pci_vpd vpd;
#ifdef CONFIG_PCIE_DPC
WARNING: multiple messages have this Message-ID
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Bjorn Helgaas <helgaas@kernel.org>, Marc Zygnier <maz@kernel.org>,
Alex Williamson <alex.williamson@redhat.com>,
Kevin Tian <kevin.tian@intel.com>,
Jason Gunthorpe <jgg@nvidia.com>, Megha Dey <megha.dey@intel.com>,
Ashok Raj <ashok.raj@intel.com>,
linux-pci@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Santosh Shilimkar <ssantosh@kernel.org>,
iommu@lists.linux-foundation.org, dmaengine@vger.kernel.org,
Stuart Yoder <stuyoder@gmail.com>,
Laurentiu Tudor <laurentiu.tudor@nxp.com>,
Nishanth Menon <nm@ti.com>, Tero Kristo <kristo@kernel.org>,
linux-arm-kernel@lists.infradead.org, x86@kernel.org,
Vinod Koul <vkoul@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Will Deacon <will@kernel.org>, Sinan Kaya <okaya@kernel.org>
Subject: [patch 09/37] PCI/MSI: Let the irq code handle sysfs groups
Date: Sat, 27 Nov 2021 02:21:31 +0100 (CET) [thread overview]
Message-ID: <20211126230524.478418625@linutronix.de> (raw)
Message-ID: <20211127012131.QmastTU5NJPl5UEDtTd8VMuPItr1e8nh6rTa4ADfwQM@z> (raw)
In-Reply-To: <20211126224100.303046749@linutronix.de>
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>
---
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(-)
--- a/drivers/pci/msi/irqdomain.c
+++ b/drivers/pci/msi/irqdomain.c
@@ -159,7 +159,7 @@ struct irq_domain *pci_msi_create_irq_do
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;
--- a/drivers/pci/msi/legacy.c
+++ b/drivers/pci/msi/legacy.c
@@ -71,10 +71,14 @@ int pci_msi_legacy_setup_msi_irqs(struct
{
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);
}
--- a/drivers/pci/msi/msi.c
+++ b/drivers/pci/msi/msi.c
@@ -233,11 +233,6 @@ static void free_msi_irqs(struct pci_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) {
@@ -415,7 +410,6 @@ static int msi_verify_entries(struct pci
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;
@@ -439,14 +433,6 @@ static int msi_capability_init(struct pc
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);
@@ -574,7 +560,6 @@ static void msix_mask_all(void __iomem *
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;
@@ -616,14 +601,6 @@ static int msix_capability_init(struct p
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;
-
/* Set MSI-X enabled bits and unmask the function */
pci_intx_for_msi(dev, 0);
dev->msix_enabled = 1;
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -474,7 +474,6 @@ struct pci_dev {
#endif
#ifdef CONFIG_PCI_MSI
void __iomem *msix_base;
- const struct attribute_group **msi_irq_groups;
#endif
struct pci_vpd vpd;
#ifdef CONFIG_PCIE_DPC
next prev parent reply other threads:[~2021-11-27 1:23 UTC|newest]
Thread overview: 97+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-27 1:20 [patch 00/37] genirq/msi, PCI/MSI: Spring cleaning - Part 2 Thomas Gleixner
2021-11-27 1:20 ` [patch 01/37] device: Move MSI related data into a struct Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 12:11 ` Greg Kroah-Hartman
2021-11-27 1:20 ` [patch 02/37] device: Add device::msi_data pointer and struct msi_device_data Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 12:12 ` Greg Kroah-Hartman
2021-11-28 0:14 ` Jason Gunthorpe
2021-11-28 19:09 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 03/37] PCI/MSI: Allocate MSI device data on first use Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 05/37] platform-msi: " Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 06/37] bus: fsl-mc-msi: " Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 07/37] soc: ti: ti_sci_inta_msi: " Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 08/37] genirq/msi: Provide msi_device_populate/destroy_sysfs() Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-30 11:53 ` Jonathan Cameron
2021-11-27 1:20 ` Thomas Gleixner [this message]
2021-11-27 1:21 ` [patch 09/37] PCI/MSI: Let the irq code handle sysfs groups Thomas Gleixner
2021-11-27 1:20 ` [patch 10/37] platform-msi: Let the core " Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 11/37] genirq/msi: Remove the original sysfs interfaces Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 12/37] platform-msi: Rename functions and clarify comments Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 13/37] platform-msi: Store platform private data pointer in msi_device_data Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 14/37] genirq/msi: Consolidate MSI descriptor data Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 15/37] platform-msi: Use msi_desc::msi_index Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 16/37] bus: fsl-mc-msi: " Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 17/37] soc: ti: ti_sci_inta_msi: " Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 18/37] PCI/MSI: " Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 19/37] genirq/msi: Add msi_device_data::properties Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 20/37] PCI/MSI: Store properties in device::msi::data Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 21/37] x86/pci/XEN: Use device MSI properties Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 22/37] x86/apic/msi: " Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 23/37] genirq/msi: " Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 24/37] powerpc/cell/axon_msi: Use MSI device properties Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 25/37] powerpc/pseries/msi: " Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 26/37] PCI/MSI: Provide MSI_FLAG_MSIX_CONTIGUOUS Thomas Gleixner
2021-11-27 1:21 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 27/37] powerpc/pseries/msi: Let core code check for contiguous entries Thomas Gleixner
2021-11-27 1:22 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 28/37] genirq/msi: Provide interface to retrieve Linux interrupt number Thomas Gleixner
2021-11-27 1:22 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 29/37] PCI/MSI: Use __msi_get_virq() in pci_get_vector() Thomas Gleixner
2021-11-27 1:22 ` Thomas Gleixner
2021-11-28 19:37 ` Marc Zyngier
2021-11-28 21:00 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 30/37] PCI/MSI: Simplify pci_irq_get_affinity() Thomas Gleixner
2021-11-27 1:22 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 31/37] dmaengine: mv_xor_v2: Get rid of msi_desc abuse Thomas Gleixner
2021-11-27 1:22 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 32/37] perf/smmuv3: Use msi_get_virq() Thomas Gleixner
2021-11-27 1:22 ` Thomas Gleixner
2021-11-27 1:20 ` [patch 33/37] iommu/arm-smmu-v3: " Thomas Gleixner
2021-11-27 1:22 ` Thomas Gleixner
2021-11-29 10:55 ` Will Deacon
2021-11-29 12:52 ` Thomas Gleixner
2021-11-29 12:58 ` Thomas Gleixner
2021-11-29 13:13 ` Robin Murphy
2021-11-29 14:42 ` Thomas Gleixner
2021-11-29 14:54 ` Robin Murphy
2021-11-30 9:36 ` Will Deacon
2021-11-30 12:30 ` Thomas Gleixner
2021-11-29 13:25 ` Robin Murphy
2021-11-27 1:21 ` [patch 34/37] mailbox: bcm-flexrm-mailbox: Rework MSI interrupt handling Thomas Gleixner
2021-11-27 1:22 ` Thomas Gleixner
2021-11-27 1:21 ` [patch 35/37] bus: fsl-mc: fsl-mc-allocator: Rework MSI handling Thomas Gleixner
2021-11-27 1:22 ` Thomas Gleixner
2021-11-27 1:21 ` [patch 36/37] soc: ti: ti_sci_inta_msi: Get rid of ti_sci_inta_msi_get_virq() Thomas Gleixner
2021-11-27 1:22 ` Thomas Gleixner
2021-11-27 1:21 ` [patch 37/37] dmaengine: qcom_hidma: Cleanup MSI handling Thomas Gleixner
2021-11-27 1:22 ` Thomas Gleixner
2021-11-29 19:56 ` Sinan Kaya
2021-11-27 1:21 ` [patch 00/37] genirq/msi, PCI/MSI: Spring cleaning - Part 2 Thomas Gleixner
2021-11-27 1:21 ` [patch 04/37] PCI/MSI: Use lock from msi_device_data Thomas Gleixner
2021-11-27 1:20 ` Thomas Gleixner
2021-11-27 12:13 ` Greg Kroah-Hartman
2021-11-27 12:17 ` [patch 00/37] genirq/msi, PCI/MSI: Spring cleaning - Part 2 Greg Kroah-Hartman
2021-11-28 0:39 ` Jason Gunthorpe
2021-11-28 20:27 ` Thomas Gleixner
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=20211126230524.478418625@linutronix.de \
--to=tglx@linutronix.de \
--cc=alex.williamson@redhat.com \
--cc=ashok.raj@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=helgaas@kernel.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jgg@nvidia.com \
--cc=kevin.tian@intel.com \
--cc=kristo@kernel.org \
--cc=laurentiu.tudor@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=megha.dey@intel.com \
--cc=nm@ti.com \
--cc=okaya@kernel.org \
--cc=ssantosh@kernel.org \
--cc=stuyoder@gmail.com \
--cc=vkoul@kernel.org \
--cc=will@kernel.org \
--cc=x86@kernel.org \
--subject='Re: [patch 09/37] PCI/MSI: Let the irq code handle sysfs groups' \
/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
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).