From: Piotr Stankiewicz <piotr.stankiewicz@intel.com> To: Bjorn Helgaas <bhelgaas@google.com>, linux-pci@vger.kernel.org Cc: "Krzysztof Wilczynski" <kw@linux.com>, "Ulf Hansson" <ulf.hansson@linaro.org>, "Igor Russkikh" <irusskikh@marvell.com>, linux-doc@vger.kernel.org, "David Airlie" <airlied@linux.ie>, "Kuppuswamy Sathyanarayanan" <sathyanarayanan.kuppuswamy@linux.intel.com>, dri-devel@lists.freedesktop.org, "Jim Gill" <jgill@vmware.com>, netdev@vger.kernel.org, "Kurt Schwemmer" <kurt.schwemmer@microsemi.com>, "Herbert Xu" <herbert@gondor.apana.org.au>, linux-scsi@vger.kernel.org, "Jonathan Corbet" <corbet@lwn.net>, linux-rdma@vger.kernel.org, "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>, amd-gfx@lists.freedesktop.org, "Jason Gunthorpe" <jgg@ziepe.ca>, "Doug Ledford" <dledford@redhat.com>, "Zenghui Yu" <yuzenghui@huawei.com>, "Jakub Kicinski" <kuba@kernel.org>, "Yisen Zhuang" <yisen.zhuang@huawei.com>, linux-media@vger.kernel.org, "Tom Lendacky" <thomas.lendacky@amd.com>, "Arnd Bergmann" <arnd@arndb.de>, "Antoine Tenart" <antoine.tenart@bootlin.com>, linux-kernel@vger.kernel.org, "James E . J . Bottomley" <jejb@linux.ibm.com>, "Salil Mehta" <salil.mehta@huawei.com>, "Denis Efremov" <efremov@linux.com>, dmaengine@vger.kernel.org, "Brian King" <brking@us.ibm.com>, "VMware PV-Drivers" <pv-drivers@vmware.com>, "Dan Williams" <dan.j.williams@intel.com>, "Mauro Carvalho Chehab" <mchehab@kernel.org>, "Andy Shevchenko" <andriy.shevchenko@intel.com>, "Jens Axboe" <axboe@kernel.dk>, "Mike Marciniszyn" <mike.marciniszyn@intel.com>, "Martin K . Petersen" <martin.petersen@oracle.com>, "Gustavo Pimentel" <gustavo.pimentel@synopsys.com>, "Dennis Dalessandro" <dennis.dalessandro@intel.com>, linux-mmc@vger.kernel.org, "Adrian Hunter" <adrian.hunter@intel.com>, "David S . Miller" <davem@davemloft.net>, "Vinod Koul" <vkoul@kernel.org>, linux-crypto@vger.kernel.org, "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>, "Alex Deucher" <alexander.deucher@amd.com>, "Piotr Stankiewicz" <piotr.stankiewicz@intel.com>, "Kelsey Skunberg" <skunberg.kelsey@gmail.com>, "Heiner Kallweit" <hkallweit1@gmail.com>, "Logan Gunthorpe" <logang@deltatee.com>, "Christian König" <christian.koenig@amd.com>, "Andrew Murray" <amurray@thegoodpenguin.co.uk> Subject: [PATCH v2 02/15] PCI: Add shorthand define for message signalled interrupt types Date: Wed, 3 Jun 2020 13:45:50 +0200 [thread overview] Message-ID: <20200603114553.12866-1-piotr.stankiewicz@intel.com> (raw) In-Reply-To: <20200603114212.12525-1-piotr.stankiewicz@intel.com> There are several places in the kernel which check/ask for MSI or MSI-X interrupts. It would make sense to have a shorthand constant, similar to PCI_IRQ_ALL_TYPES, to use in these situations. So 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> --- 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 83ce1cdf5676..b6c9bf70363e 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1422,8 +1422,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 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Piotr Stankiewicz <piotr.stankiewicz@intel.com> To: Bjorn Helgaas <bhelgaas@google.com>, linux-pci@vger.kernel.org Cc: "Krzysztof Wilczynski" <kw@linux.com>, "Ulf Hansson" <ulf.hansson@linaro.org>, "Igor Russkikh" <irusskikh@marvell.com>, linux-doc@vger.kernel.org, "David Airlie" <airlied@linux.ie>, "Kuppuswamy Sathyanarayanan" <sathyanarayanan.kuppuswamy@linux.intel.com>, dri-devel@lists.freedesktop.org, "Jim Gill" <jgill@vmware.com>, netdev@vger.kernel.org, "Kurt Schwemmer" <kurt.schwemmer@microsemi.com>, "David Zhou" <David1.Zhou@amd.com>, "Herbert Xu" <herbert@gondor.apana.org.au>, linux-scsi@vger.kernel.org, "Jonathan Corbet" <corbet@lwn.net>, linux-rdma@vger.kernel.org, "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>, amd-gfx@lists.freedesktop.org, "Jason Gunthorpe" <jgg@ziepe.ca>, "Doug Ledford" <dledford@redhat.com>, "Zenghui Yu" <yuzenghui@huawei.com>, "Jakub Kicinski" <kuba@kernel.org>, "Yisen Zhuang" <yisen.zhuang@huawei.com>, linux-media@vger.kernel.org, "Tom Lendacky" <thomas.lendacky@amd.com>, "Arnd Bergmann" <arnd@arndb.de>, "Antoine Tenart" <antoine.tenart@bootlin.com>, linux-kernel@vger.kernel.org, "James E . J . Bottomley" <jejb@linux.ibm.com>, "Salil Mehta" <salil.mehta@huawei.com>, "Denis Efremov" <efremov@linux.com>, dmaengine@vger.kernel.org, "Brian King" <brking@us.ibm.com>, "VMware PV-Drivers" <pv-drivers@vmware.com>, "Dan Williams" <dan.j.williams@intel.com>, "Mauro Carvalho Chehab" <mchehab@kernel.org>, "Andy Shevchenko" <andriy.shevchenko@intel.com>, "Jens Axboe" <axboe@kernel.dk>, "Mike Marciniszyn" <mike.marciniszyn@intel.com>, "Martin K . Petersen" <martin.petersen@oracle.com>, "Gustavo Pimentel" <gustavo.pimentel@synopsys.com>, "Dennis Dalessandro" <dennis.dalessandro@intel.com>, linux-mmc@vger.kernel.org, "Adrian Hunter" <adrian.hunter@intel.com>, "David S . Miller" <davem@davemloft.net>, "Vinod Koul" <vkoul@kernel.org>, linux-crypto@vger.kernel.org, "Daniel Vetter" <daniel@ffwll.ch>, "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>, "Alex Deucher" <alexander.deucher@amd.com>, "Piotr Stankiewicz" <piotr.stankiewicz@intel.com>, "Kelsey Skunberg" <skunberg.kelsey@gmail.com>, "Heiner Kallweit" <hkallweit1@gmail.com>, "Logan Gunthorpe" <logang@deltatee.com>, "Christian König" <christian.koenig@amd.com>, "Andrew Murray" <amurray@thegoodpenguin.co.uk> Subject: [PATCH v2 02/15] PCI: Add shorthand define for message signalled interrupt types Date: Wed, 3 Jun 2020 13:45:50 +0200 [thread overview] Message-ID: <20200603114553.12866-1-piotr.stankiewicz@intel.com> (raw) In-Reply-To: <20200603114212.12525-1-piotr.stankiewicz@intel.com> There are several places in the kernel which check/ask for MSI or MSI-X interrupts. It would make sense to have a shorthand constant, similar to PCI_IRQ_ALL_TYPES, to use in these situations. So 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> --- 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 83ce1cdf5676..b6c9bf70363e 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1422,8 +1422,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 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2020-06-03 11:46 UTC|newest] Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-06-02 9:16 [PATCH 00/15] forward MSIx vector enable error code in pci_alloc_irq_vectors_affinity Piotr Stankiewicz 2020-06-02 9:16 ` Piotr Stankiewicz 2020-06-02 9:16 ` Piotr Stankiewicz 2020-06-02 23:06 ` Bjorn Helgaas 2020-06-02 23:06 ` Bjorn Helgaas 2020-06-03 11:42 ` [PATCH v2 00/15] Forward MSI-X vector enable error code in pci_alloc_irq_vectors_affinity() Piotr Stankiewicz 2020-06-03 11:42 ` Piotr Stankiewicz 2020-06-03 11:44 ` [PATCH v2 01/15] PCI/MSI: " Piotr Stankiewicz 2020-06-03 15:48 ` Logan Gunthorpe 2020-06-03 16:04 ` Stankiewicz, Piotr 2020-06-03 16:22 ` Logan Gunthorpe 2020-06-09 9:27 ` Stankiewicz, Piotr 2020-06-03 11:45 ` Piotr Stankiewicz [this message] 2020-06-03 11:45 ` [PATCH v2 02/15] PCI: Add shorthand define for message signalled interrupt types Piotr Stankiewicz 2020-06-03 15:49 ` Logan Gunthorpe 2020-06-03 15:49 ` Logan Gunthorpe 2020-06-04 1:55 ` Luben Tuikov 2020-06-04 1:55 ` Luben Tuikov 2020-06-03 11:46 ` [PATCH v2 03/15] PCI: Use PCI_IRQ_MSI_TYPES where appropriate Piotr Stankiewicz 2020-06-03 11:47 ` [PATCH v2 04/15] ahci: " Piotr Stankiewicz 2020-06-03 11:47 ` [PATCH v2 05/15] crypto: inside-secure - " Piotr Stankiewicz 2020-06-03 13:30 ` kernel test robot 2020-06-03 13:30 ` kernel test robot 2020-06-03 11:47 ` [PATCH v2 06/15] dmaengine: dw-edma: " Piotr Stankiewicz 2020-06-03 11:54 ` Gustavo Pimentel 2020-06-03 11:47 ` [PATCH v2 07/15] drm/amdgpu: " Piotr Stankiewicz 2020-06-03 11:47 ` Piotr Stankiewicz 2020-06-03 11:47 ` Piotr Stankiewicz 2020-06-03 13:43 ` Alex Deucher 2020-06-03 13:43 ` Alex Deucher 2020-06-03 13:43 ` Alex Deucher 2020-06-03 11:48 ` [PATCH v2 08/15] IB/qib: " Piotr Stankiewicz 2020-06-03 11:48 ` [PATCH v2 09/15] media: ddbridge: " Piotr Stankiewicz 2020-06-03 11:48 ` [PATCH v2 10/15] vmw_vmci: Use PCI_IRQ_ALL_TYPES " Piotr Stankiewicz 2020-06-03 11:49 ` [PATCH v2 11/15] mmc: sdhci: Use PCI_IRQ_MSI_TYPES " Piotr Stankiewicz 2020-06-03 11:49 ` [PATCH v2 12/15] amd-xgbe: " Piotr Stankiewicz 2020-06-03 11:49 ` [PATCH v2 13/15] aquantia: atlantic: Use PCI_IRQ_ALL_TYPES " Piotr Stankiewicz 2020-06-03 11:49 ` [PATCH v2 14/15] net: hns3: Use PCI_IRQ_MSI_TYPES " Piotr Stankiewicz 2020-06-03 11:50 ` [PATCH v2 15/15] scsi: Use PCI_IRQ_MSI_TYPES and PCI_IRQ_ALL_TYPES " 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:11 ` Piotr Stankiewicz 2020-06-09 9:11 ` Piotr Stankiewicz 2020-06-09 9:14 ` [PATCH v3 01/15] PCI/MSI: " Piotr Stankiewicz 2020-06-09 15:49 ` Logan Gunthorpe 2020-06-09 15:49 ` Christoph Hellwig 2020-06-09 9:15 ` [PATCH v3 02/15] PCI: Add macro for message signalled interrupt types Piotr Stankiewicz 2020-06-09 9:15 ` Piotr Stankiewicz 2020-06-09 9:16 ` [PATCH v3 03/15] PCI: Use PCI_IRQ_MSI_TYPES where appropriate Piotr Stankiewicz 2020-06-09 15:51 ` Christoph Hellwig 2020-06-09 16:31 ` Stankiewicz, Piotr 2020-06-09 16:35 ` Logan Gunthorpe 2020-06-09 9:17 ` [PATCH v3 04/15] ahci: " Piotr Stankiewicz 2020-06-09 9:17 ` [PATCH v3 05/15] crypto: inside-secure - " Piotr Stankiewicz 2020-06-09 9:17 ` [PATCH v3 06/15] dmaengine: dw-edma: " Piotr Stankiewicz 2020-06-09 10:01 ` Andy Shevchenko 2020-06-09 9:18 ` [PATCH v3 07/15] drm/amdgpu: " Piotr Stankiewicz 2020-06-09 9:18 ` Piotr Stankiewicz 2020-06-09 9:18 ` Piotr Stankiewicz 2020-06-09 20:23 ` Alex Deucher 2020-06-09 20:23 ` Alex Deucher 2020-06-09 20:23 ` Alex Deucher 2020-06-16 7:49 ` Stankiewicz, Piotr 2020-06-16 7:49 ` Stankiewicz, Piotr 2020-06-16 7:49 ` Stankiewicz, Piotr 2020-06-16 8:42 ` [PATCH] drm/amdgpu: Simplify IRQ vector request logic Piotr Stankiewicz 2020-06-16 8:42 ` Piotr Stankiewicz 2020-06-16 8:42 ` 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 2020-06-09 9:18 ` [PATCH v3 09/15] media: ddbridge: " Piotr Stankiewicz 2020-06-09 9:19 ` [PATCH v3 10/15] vmw_vmci: Use PCI_IRQ_ALL_TYPES " Piotr Stankiewicz 2020-06-09 9:19 ` [PATCH v3 11/15] mmc: sdhci: Use PCI_IRQ_MSI_TYPES " Piotr Stankiewicz 2020-06-09 9:19 ` [PATCH v3 12/15] amd-xgbe: " Piotr Stankiewicz 2020-06-09 9:19 ` [PATCH v3 13/15] aquantia: atlantic: Use PCI_IRQ_ALL_TYPES " Piotr Stankiewicz 2020-06-09 9:20 ` [PATCH v3 14/15] net: hns3: Use PCI_IRQ_MSI_TYPES " Piotr Stankiewicz 2020-06-09 9:20 ` [PATCH v3 15/15] scsi: Use PCI_IRQ_MSI_TYPES and PCI_IRQ_ALL_TYPES " 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 2020-06-16 7:33 ` [PATCH v4] PCI/MSI: Forward MSI-X vector enable error code in pci_alloc_irq_vectors_affinity() Piotr Stankiewicz 2020-06-30 22:04 ` Bjorn Helgaas
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=20200603114553.12866-1-piotr.stankiewicz@intel.com \ --to=piotr.stankiewicz@intel.com \ --cc=adrian.hunter@intel.com \ --cc=airlied@linux.ie \ --cc=alexander.deucher@amd.com \ --cc=amd-gfx@lists.freedesktop.org \ --cc=amurray@thegoodpenguin.co.uk \ --cc=andriy.shevchenko@intel.com \ --cc=antoine.tenart@bootlin.com \ --cc=arnd@arndb.de \ --cc=axboe@kernel.dk \ --cc=bhelgaas@google.com \ --cc=brking@us.ibm.com \ --cc=christian.koenig@amd.com \ --cc=corbet@lwn.net \ --cc=dan.j.williams@intel.com \ --cc=davem@davemloft.net \ --cc=dennis.dalessandro@intel.com \ --cc=dledford@redhat.com \ --cc=dmaengine@vger.kernel.org \ --cc=dri-devel@lists.freedesktop.org \ --cc=efremov@linux.com \ --cc=gregkh@linuxfoundation.org \ --cc=gustavo.pimentel@synopsys.com \ --cc=herbert@gondor.apana.org.au \ --cc=hkallweit1@gmail.com \ --cc=irusskikh@marvell.com \ --cc=jejb@linux.ibm.com \ --cc=jgg@ziepe.ca \ --cc=jgill@vmware.com \ --cc=kuba@kernel.org \ --cc=kurt.schwemmer@microsemi.com \ --cc=kw@linux.com \ --cc=linux-crypto@vger.kernel.org \ --cc=linux-doc@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-media@vger.kernel.org \ --cc=linux-mmc@vger.kernel.org \ --cc=linux-pci@vger.kernel.org \ --cc=linux-rdma@vger.kernel.org \ --cc=linux-scsi@vger.kernel.org \ --cc=logang@deltatee.com \ --cc=martin.petersen@oracle.com \ --cc=mchehab@kernel.org \ --cc=mike.marciniszyn@intel.com \ --cc=netdev@vger.kernel.org \ --cc=pv-drivers@vmware.com \ --cc=rafael.j.wysocki@intel.com \ --cc=salil.mehta@huawei.com \ --cc=sathyanarayanan.kuppuswamy@linux.intel.com \ --cc=skunberg.kelsey@gmail.com \ --cc=thomas.lendacky@amd.com \ --cc=ulf.hansson@linaro.org \ --cc=vkoul@kernel.org \ --cc=yisen.zhuang@huawei.com \ --cc=yuzenghui@huawei.com \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.