From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 469F8C433E0 for ; Wed, 3 Jun 2020 13:10:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 26C7A20679 for ; Wed, 3 Jun 2020 13:10:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26C7A20679 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2071B893A2; Wed, 3 Jun 2020 13:10:36 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4E45489A44; Wed, 3 Jun 2020 11:46:31 +0000 (UTC) IronPort-SDR: VtjIrxg2v6CaUxOjXC9aPa8kA/xT5UUOnGQsMFjcM7Vyg4BIVSxtcoGLE1KXcKN/EWZ6fcR4Ut v0Lft05dCE3A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 04:46:30 -0700 IronPort-SDR: Q94X9qPKVl71qdIrOAFFgbTGyF3AE77MO4MqUWVQgQJjOxjmL31V62gRhPhld6Hwc1sLALK73m Aq6qF9BxPGWw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,467,1583222400"; d="scan'208";a="471047512" Received: from gklab-125-110.igk.intel.com ([10.91.125.110]) by fmsmga006.fm.intel.com with ESMTP; 03 Jun 2020 04:46:20 -0700 From: Piotr Stankiewicz To: Bjorn Helgaas , linux-pci@vger.kernel.org Subject: [PATCH v2 02/15] PCI: Add shorthand define for message signalled interrupt types Date: Wed, 3 Jun 2020 13:45:50 +0200 Message-Id: <20200603114553.12866-1-piotr.stankiewicz@intel.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20200603114212.12525-1-piotr.stankiewicz@intel.com> References: <20200603114212.12525-1-piotr.stankiewicz@intel.com> X-Mailman-Approved-At: Wed, 03 Jun 2020 13:10:35 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Krzysztof Wilczynski , Ulf Hansson , Igor Russkikh , linux-doc@vger.kernel.org, David Airlie , Kuppuswamy Sathyanarayanan , dri-devel@lists.freedesktop.org, Jim Gill , netdev@vger.kernel.org, Kurt Schwemmer , David Zhou , Herbert Xu , linux-scsi@vger.kernel.org, Jonathan Corbet , linux-rdma@vger.kernel.org, "Rafael J. Wysocki" , amd-gfx@lists.freedesktop.org, Jason Gunthorpe , Doug Ledford , Zenghui Yu , Jakub Kicinski , Yisen Zhuang , linux-media@vger.kernel.org, Tom Lendacky , Arnd Bergmann , Antoine Tenart , linux-kernel@vger.kernel.org, "James E . J . Bottomley" , Salil Mehta , Denis Efremov , dmaengine@vger.kernel.org, Brian King , VMware PV-Drivers , Dan Williams , Mauro Carvalho Chehab , Andy Shevchenko , Jens Axboe , Mike Marciniszyn , "Martin K . Petersen" , Gustavo Pimentel , Dennis Dalessandro , linux-mmc@vger.kernel.org, Adrian Hunter , "David S . Miller" , Vinod Koul , linux-crypto@vger.kernel.org, Daniel Vetter , Greg Kroah-Hartman , Alex Deucher , Piotr Stankiewicz , Kelsey Skunberg , Heiner Kallweit , Logan Gunthorpe , =?UTF-8?q?Christian=20K=C3=B6nig?= , Andrew Murray MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" 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 Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko --- 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