linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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-09  9:11 ` Piotr Stankiewicz
  2020-06-09 16:22   ` [PATCH v3 02/15] PCI: Add macro for message signalled interrupt types Piotr Stankiewicz
  0 siblings, 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 02/15] PCI: Add macro for message signalled interrupt types
  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 16:22   ` Piotr Stankiewicz
  2020-06-10  7:08     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Piotr Stankiewicz @ 2020-06-09 16:22 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci
  Cc: Piotr Stankiewicz, Jonathan Corbet, Andrew Murray,
	Logan Gunthorpe, Andy Shevchenko, Zenghui Yu, Kelsey Skunberg,
	Rafael J. Wysocki, Krzysztof Wilczynski,
	Kuppuswamy Sathyanarayanan, Heiner Kallweit, Herbert Xu,
	Yicong Yang, Denis Efremov, linux-doc, linux-kernel

There are several places in the kernel which check/ask for MSI or MSI-X
interrupts. It would make sense to have a macro which defines all types
of message signalled interrupts, to use in such situations. Add
PCI_IRQ_MSI_TYPES, for this purpose.

Signed-off-by: Piotr Stankiewicz <piotr.stankiewicz@intel.com>
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
---
 Documentation/PCI/msi-howto.rst | 5 +++--
 include/linux/pci.h             | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Documentation/PCI/msi-howto.rst b/Documentation/PCI/msi-howto.rst
index aa2046af69f7..2800ff5aa395 100644
--- a/Documentation/PCI/msi-howto.rst
+++ b/Documentation/PCI/msi-howto.rst
@@ -105,7 +105,8 @@ if it can't meet the minimum number of vectors.
 The flags argument is used to specify which type of interrupt can be used
 by the device and the driver (PCI_IRQ_LEGACY, PCI_IRQ_MSI, PCI_IRQ_MSIX).
 A convenient short-hand (PCI_IRQ_ALL_TYPES) is also available to ask for
-any possible kind of interrupt.  If the PCI_IRQ_AFFINITY flag is set,
+any possible kind of interrupt, and (PCI_IRQ_MSI_TYPES) to ask for message
+signalled interrupts (MSI or MSI-X).  If the PCI_IRQ_AFFINITY flag is set,
 pci_alloc_irq_vectors() will spread the interrupts around the available CPUs.
 
 To get the Linux IRQ numbers passed to request_irq() and free_irq() and the
@@ -160,7 +161,7 @@ the single MSI mode for a device.  It could be done by passing two 1s as
 Some devices might not support using legacy line interrupts, in which case
 the driver can specify that only MSI or MSI-X is acceptable::
 
-	nvec = pci_alloc_irq_vectors(pdev, 1, nvec, PCI_IRQ_MSI | PCI_IRQ_MSIX);
+	nvec = pci_alloc_irq_vectors(pdev, 1, nvec, PCI_IRQ_MSI_TYPES);
 	if (nvec < 0)
 		goto out_err;
 
diff --git a/include/linux/pci.h b/include/linux/pci.h
index c79d83304e52..a99094f17b21 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1431,8 +1431,8 @@ int pci_set_vga_state(struct pci_dev *pdev, bool decode,
  */
 #define PCI_IRQ_VIRTUAL		(1 << 4)
 
-#define PCI_IRQ_ALL_TYPES \
-	(PCI_IRQ_LEGACY | PCI_IRQ_MSI | PCI_IRQ_MSIX)
+#define PCI_IRQ_MSI_TYPES	(PCI_IRQ_MSI | PCI_IRQ_MSIX)
+#define PCI_IRQ_ALL_TYPES	(PCI_IRQ_LEGACY | PCI_IRQ_MSI_TYPES)
 
 /* kmem_cache style wrapper around pci_alloc_consistent() */
 
-- 
2.17.2


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

* Re: [PATCH v3 02/15] PCI: Add macro for message signalled interrupt types
  2020-06-09 16:22   ` [PATCH v3 02/15] PCI: Add macro for message signalled interrupt types Piotr Stankiewicz
@ 2020-06-10  7:08     ` Christoph Hellwig
  2020-06-16  7:39       ` Stankiewicz, Piotr
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2020-06-10  7:08 UTC (permalink / raw)
  To: Piotr Stankiewicz
  Cc: Bjorn Helgaas, linux-pci, Jonathan Corbet, Andrew Murray,
	Logan Gunthorpe, Andy Shevchenko, Zenghui Yu, Kelsey Skunberg,
	Rafael J. Wysocki, Krzysztof Wilczynski,
	Kuppuswamy Sathyanarayanan, Heiner Kallweit, Herbert Xu,
	Yicong Yang, Denis Efremov, linux-doc, linux-kernel

On Tue, Jun 09, 2020 at 06:22:40PM +0200, Piotr Stankiewicz wrote:
> There are several places in the kernel which check/ask for MSI or MSI-X
> interrupts. It would make sense to have a macro which defines all types
> of message signalled interrupts, to use in such situations. Add
> PCI_IRQ_MSI_TYPES, for this purpose.

To state my objection voices in patch 3 here again:

I think this is a very bad idea.  Everyone knows what MSI and MSI-X
mean and that directly maps to specification.  The new IMS interrupt
scheme from the Intel SIOV spec for example is a message signalled
interrupt type as well and should not be picked up automatically.

If we want to change anything in this area we should probably remove
PCI_IRQ_ALL_TYPES instead..

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

* RE: [PATCH v3 02/15] PCI: Add macro for message signalled interrupt types
  2020-06-10  7:08     ` Christoph Hellwig
@ 2020-06-16  7:39       ` Stankiewicz, Piotr
  0 siblings, 0 replies; 4+ messages in thread
From: Stankiewicz, Piotr @ 2020-06-16  7:39 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Bjorn Helgaas, linux-pci, Jonathan Corbet, Andrew Murray,
	Logan Gunthorpe, Shevchenko, Andriy, Zenghui Yu, Kelsey Skunberg,
	Wysocki, Rafael J, Krzysztof Wilczynski,
	Kuppuswamy Sathyanarayanan, Heiner Kallweit, Herbert Xu,
	Yicong Yang, Denis Efremov, linux-doc, linux-kernel

> -----Original Message-----
> From: Christoph Hellwig <hch@infradead.org>
> Sent: Wednesday, June 10, 2020 9:08 AM
> 
> On Tue, Jun 09, 2020 at 06:22:40PM +0200, Piotr Stankiewicz wrote:
> > There are several places in the kernel which check/ask for MSI or
> > MSI-X interrupts. It would make sense to have a macro which defines
> > all types of message signalled interrupts, to use in such situations.
> > Add PCI_IRQ_MSI_TYPES, for this purpose.
> 
> To state my objection voices in patch 3 here again:
> 
> I think this is a very bad idea.  Everyone knows what MSI and MSI-X mean and
> that directly maps to specification.  The new IMS interrupt scheme from the Intel
> SIOV spec for example is a message signalled interrupt type as well and should
> not be picked up automatically.
> 
> If we want to change anything in this area we should probably remove
> PCI_IRQ_ALL_TYPES instead..

Thanks, I've resent only the first patch as v4 of the chain, and dropped the rest.

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

end of thread, other threads:[~2020-06-16  7:39 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-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 16:22   ` [PATCH v3 02/15] PCI: Add macro for message signalled interrupt types Piotr Stankiewicz
2020-06-10  7:08     ` Christoph Hellwig
2020-06-16  7:39       ` Stankiewicz, Piotr

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