linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 08/15] IB/qib: Use PCI_IRQ_MSI_TYPES where appropriate
       [not found] <20200603114212.12525-1-piotr.stankiewicz@intel.com>
@ 2020-06-03 11:48 ` Piotr Stankiewicz
  2020-06-09  9:11 ` [PATCH v3 00/15] Forward MSI-X vector enable error code in pci_alloc_irq_vectors_affinity() Piotr Stankiewicz
  1 sibling, 0 replies; 4+ messages in thread
From: Piotr Stankiewicz @ 2020-06-03 11:48 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci
  Cc: Piotr Stankiewicz, Dennis Dalessandro, Mike Marciniszyn,
	Doug Ledford, Jason Gunthorpe, Arnd Bergmann, Andy Shevchenko,
	linux-rdma, linux-kernel

Seeing as there is shorthand available to use when asking for any type
of interrupt, or any type of message signalled interrupt, leverage it.

Signed-off-by: Piotr Stankiewicz <piotr.stankiewicz@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
---
 drivers/infiniband/hw/qib/qib_pcie.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/qib/qib_pcie.c b/drivers/infiniband/hw/qib/qib_pcie.c
index 3dc6ce033319..caff44d2c12c 100644
--- a/drivers/infiniband/hw/qib/qib_pcie.c
+++ b/drivers/infiniband/hw/qib/qib_pcie.c
@@ -213,7 +213,7 @@ int qib_pcie_params(struct qib_devdata *dd, u32 minw, u32 *nent)
 	u16 linkstat, speed;
 	int nvec;
 	int maxvec;
-	unsigned int flags = PCI_IRQ_MSIX | PCI_IRQ_MSI;
+	unsigned int flags;
 
 	if (!pci_is_pcie(dd->pcidev)) {
 		qib_dev_err(dd, "Can't find PCI Express capability!\n");
@@ -225,7 +225,9 @@ int qib_pcie_params(struct qib_devdata *dd, u32 minw, u32 *nent)
 	}
 
 	if (dd->flags & QIB_HAS_INTX)
-		flags |= PCI_IRQ_LEGACY;
+		flags = PCI_IRQ_ALL_TYPES;
+	else
+		flags = PCI_IRQ_MSI_TYPES;
 	maxvec = (nent && *nent) ? *nent : 1;
 	nvec = pci_alloc_irq_vectors(dd->pcidev, 1, maxvec, flags);
 	if (nvec < 0)
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v3 00/15] Forward MSI-X vector enable error code in pci_alloc_irq_vectors_affinity()
       [not found] <20200603114212.12525-1-piotr.stankiewicz@intel.com>
  2020-06-03 11:48 ` [PATCH v2 08/15] IB/qib: Use PCI_IRQ_MSI_TYPES where appropriate Piotr Stankiewicz
@ 2020-06-09  9:11 ` Piotr Stankiewicz
  2020-06-09  9:18   ` [PATCH v3 08/15] IB/qib: Use PCI_IRQ_MSI_TYPES where appropriate Piotr Stankiewicz
  1 sibling, 1 reply; 4+ messages in thread
From: Piotr Stankiewicz @ 2020-06-09  9:11 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci
  Cc: Jonathan Corbet, Jens Axboe, Kurt Schwemmer, Logan Gunthorpe,
	Antoine Tenart, Herbert Xu, David S . Miller, Gustavo Pimentel,
	Dan Williams, Vinod Koul, Alex Deucher, Christian König,
	David Zhou, David Airlie, Daniel Vetter, Dennis Dalessandro,
	Mike Marciniszyn, Doug Ledford, Jason Gunthorpe,
	Mauro Carvalho Chehab, Arnd Bergmann, Greg Kroah-Hartman,
	Adrian Hunter, Ulf Hansson, Tom Lendacky, Jakub Kicinski,
	Igor Russkikh, Yisen Zhuang, Salil Mehta, Brian King,
	James E . J . Bottomley, Martin K . Petersen, Jim Gill,
	linux-doc, linux-crypto, dmaengine, amd-gfx, dri-devel,
	linux-rdma, linux-media, linux-mmc, netdev, linux-scsi,
	linux-kernel, Piotr Stankiewicz

The primary objective of this patch series is to change the behaviour
of pci_alloc_irq_vectors_affinity() such that it forwards the MSI-X enable
error code when appropriate. In the process, though, it was pointed out
that there are multiple places in the kernel which check/ask for message
signalled interrupts (MSI or MSI-X), which spawned the first patch adding
PCI_IRQ_MSI_TYPES. Finally the rest of the chain converts all users to
take advantage of PCI_IRQ_MSI_TYPES or PCI_IRQ_ALL_TYPES, as
appropriate.

Piotr Stankiewicz (15):
  PCI/MSI: Forward MSI-X vector enable error code in
    pci_alloc_irq_vectors_affinity()
  PCI: Add macro for message signalled interrupt types
  PCI: Use PCI_IRQ_MSI_TYPES where appropriate
  ahci: Use PCI_IRQ_MSI_TYPES where appropriate
  crypto: inside-secure - Use PCI_IRQ_MSI_TYPES where appropriate
  dmaengine: dw-edma: Use PCI_IRQ_MSI_TYPES  where appropriate
  drm/amdgpu: Use PCI_IRQ_MSI_TYPES where appropriate
  IB/qib: Use PCI_IRQ_MSI_TYPES where appropriate
  media: ddbridge: Use PCI_IRQ_MSI_TYPES where appropriate
  vmw_vmci: Use PCI_IRQ_ALL_TYPES where appropriate
  mmc: sdhci: Use PCI_IRQ_MSI_TYPES where appropriate
  amd-xgbe: Use PCI_IRQ_MSI_TYPES where appropriate
  aquantia: atlantic: Use PCI_IRQ_ALL_TYPES where appropriate
  net: hns3: Use PCI_IRQ_MSI_TYPES where appropriate
  scsi: Use PCI_IRQ_MSI_TYPES and PCI_IRQ_ALL_TYPES where appropriate

 Documentation/PCI/msi-howto.rst               |  5 +++--
 drivers/ata/ahci.c                            |  2 +-
 drivers/crypto/inside-secure/safexcel.c       |  2 +-
 drivers/dma/dw-edma/dw-edma-pcie.c            |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c       | 11 +---------
 drivers/infiniband/hw/qib/qib_pcie.c          |  6 +++--
 drivers/media/pci/ddbridge/ddbridge-main.c    |  2 +-
 drivers/misc/vmw_vmci/vmci_guest.c            |  3 +--
 drivers/mmc/host/sdhci-pci-gli.c              |  3 +--
 drivers/mmc/host/sdhci-pci-o2micro.c          |  3 +--
 drivers/net/ethernet/amd/xgbe/xgbe-pci.c      |  2 +-
 .../ethernet/aquantia/atlantic/aq_pci_func.c  |  4 +---
 .../hisilicon/hns3/hns3pf/hclge_main.c        |  3 +--
 .../hisilicon/hns3/hns3vf/hclgevf_main.c      |  3 +--
 drivers/pci/msi.c                             | 22 ++++++++-----------
 drivers/pci/pcie/portdrv_core.c               |  4 ++--
 drivers/pci/switch/switchtec.c                |  3 +--
 drivers/scsi/ipr.c                            |  5 +++--
 drivers/scsi/vmw_pvscsi.c                     |  2 +-
 include/linux/pci.h                           |  4 ++--
 20 files changed, 37 insertions(+), 54 deletions(-)

-- 
2.17.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 08/15] IB/qib: Use PCI_IRQ_MSI_TYPES where appropriate
  2020-06-09  9:11 ` [PATCH v3 00/15] Forward MSI-X vector enable error code in pci_alloc_irq_vectors_affinity() Piotr Stankiewicz
@ 2020-06-09  9:18   ` Piotr Stankiewicz
  2020-06-11 13:17     ` Ruhl, Michael J
  0 siblings, 1 reply; 4+ messages in thread
From: Piotr Stankiewicz @ 2020-06-09  9:18 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci
  Cc: Piotr Stankiewicz, Dennis Dalessandro, Mike Marciniszyn,
	Doug Ledford, Jason Gunthorpe, Arnd Bergmann, Andy Shevchenko,
	linux-rdma, linux-kernel

Seeing as there is shorthand available to use when asking for any type
of interrupt, or any type of message signalled interrupt, leverage it.

Signed-off-by: Piotr Stankiewicz <piotr.stankiewicz@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
---
 drivers/infiniband/hw/qib/qib_pcie.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/qib/qib_pcie.c b/drivers/infiniband/hw/qib/qib_pcie.c
index 3dc6ce033319..caff44d2c12c 100644
--- a/drivers/infiniband/hw/qib/qib_pcie.c
+++ b/drivers/infiniband/hw/qib/qib_pcie.c
@@ -213,7 +213,7 @@ int qib_pcie_params(struct qib_devdata *dd, u32 minw, u32 *nent)
 	u16 linkstat, speed;
 	int nvec;
 	int maxvec;
-	unsigned int flags = PCI_IRQ_MSIX | PCI_IRQ_MSI;
+	unsigned int flags;
 
 	if (!pci_is_pcie(dd->pcidev)) {
 		qib_dev_err(dd, "Can't find PCI Express capability!\n");
@@ -225,7 +225,9 @@ int qib_pcie_params(struct qib_devdata *dd, u32 minw, u32 *nent)
 	}
 
 	if (dd->flags & QIB_HAS_INTX)
-		flags |= PCI_IRQ_LEGACY;
+		flags = PCI_IRQ_ALL_TYPES;
+	else
+		flags = PCI_IRQ_MSI_TYPES;
 	maxvec = (nent && *nent) ? *nent : 1;
 	nvec = pci_alloc_irq_vectors(dd->pcidev, 1, maxvec, flags);
 	if (nvec < 0)
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH v3 08/15] IB/qib: Use PCI_IRQ_MSI_TYPES where appropriate
  2020-06-09  9:18   ` [PATCH v3 08/15] IB/qib: Use PCI_IRQ_MSI_TYPES where appropriate Piotr Stankiewicz
@ 2020-06-11 13:17     ` Ruhl, Michael J
  0 siblings, 0 replies; 4+ messages in thread
From: Ruhl, Michael J @ 2020-06-11 13:17 UTC (permalink / raw)
  To: Stankiewicz, Piotr, Bjorn Helgaas, linux-pci
  Cc: Stankiewicz, Piotr, Dalessandro, Dennis, Marciniszyn, Mike,
	Doug Ledford, Jason Gunthorpe, Arnd Bergmann, Shevchenko, Andriy,
	linux-rdma, linux-kernel

>-----Original Message-----
>From: linux-rdma-owner@vger.kernel.org <linux-rdma-
>owner@vger.kernel.org> On Behalf Of Piotr Stankiewicz
>Sent: Tuesday, June 9, 2020 5:18 AM
>To: Bjorn Helgaas <bhelgaas@google.com>; linux-pci@vger.kernel.org
>Cc: Stankiewicz, Piotr <piotr.stankiewicz@intel.com>; Dalessandro, Dennis
><dennis.dalessandro@intel.com>; Marciniszyn, Mike
><mike.marciniszyn@intel.com>; Doug Ledford <dledford@redhat.com>;
>Jason Gunthorpe <jgg@ziepe.ca>; Arnd Bergmann <arnd@arndb.de>;
>Shevchenko, Andriy <andriy.shevchenko@intel.com>; linux-
>rdma@vger.kernel.org; linux-kernel@vger.kernel.org
>Subject: [PATCH v3 08/15] IB/qib: Use PCI_IRQ_MSI_TYPES where appropriate
>
>Seeing as there is shorthand available to use when asking for any type
>of interrupt, or any type of message signalled interrupt, leverage it.
>
>Signed-off-by: Piotr Stankiewicz <piotr.stankiewicz@intel.com>
>Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
>---
> drivers/infiniband/hw/qib/qib_pcie.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/infiniband/hw/qib/qib_pcie.c
>b/drivers/infiniband/hw/qib/qib_pcie.c
>index 3dc6ce033319..caff44d2c12c 100644
>--- a/drivers/infiniband/hw/qib/qib_pcie.c
>+++ b/drivers/infiniband/hw/qib/qib_pcie.c
>@@ -213,7 +213,7 @@ int qib_pcie_params(struct qib_devdata *dd, u32
>minw, u32 *nent)
> 	u16 linkstat, speed;
> 	int nvec;
> 	int maxvec;
>-	unsigned int flags = PCI_IRQ_MSIX | PCI_IRQ_MSI;
>+	unsigned int flags;
>
> 	if (!pci_is_pcie(dd->pcidev)) {
> 		qib_dev_err(dd, "Can't find PCI Express capability!\n");
>@@ -225,7 +225,9 @@ int qib_pcie_params(struct qib_devdata *dd, u32
>minw, u32 *nent)
> 	}
>
> 	if (dd->flags & QIB_HAS_INTX)
>-		flags |= PCI_IRQ_LEGACY;
>+		flags = PCI_IRQ_ALL_TYPES;
>+	else
>+		flags = PCI_IRQ_MSI_TYPES;

Thinking about lines of code, this patch could probably just be:

-	unsigned int flags = PCI_IRQ_MSIX | PCI_IRQ_MSI;
+	unsigned int flags = PCI_IRQ_MSI_TYPES;

Or maybe even:

-	unsigned int flags = PCI_IRQ_MSIX | PCI_IRQ_MSI;
+	unsigned int flags = PCI_IRQ_ALL_TYPES;

- 	if (dd->flags & QIB_HAS_INTX)
-		flags |= PCI_IRQ_LEGACY;

?

M

> 	maxvec = (nent && *nent) ? *nent : 1;
> 	nvec = pci_alloc_irq_vectors(dd->pcidev, 1, maxvec, flags);
> 	if (nvec < 0)
>--
>2.17.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-11 13:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200603114212.12525-1-piotr.stankiewicz@intel.com>
2020-06-03 11:48 ` [PATCH v2 08/15] IB/qib: Use PCI_IRQ_MSI_TYPES where appropriate Piotr Stankiewicz
2020-06-09  9:11 ` [PATCH v3 00/15] Forward MSI-X vector enable error code in pci_alloc_irq_vectors_affinity() Piotr Stankiewicz
2020-06-09  9:18   ` [PATCH v3 08/15] IB/qib: Use PCI_IRQ_MSI_TYPES where appropriate Piotr Stankiewicz
2020-06-11 13:17     ` Ruhl, Michael J

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).