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.7 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 10139C433E0 for ; Tue, 9 Jun 2020 13:39:36 +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 E203A20760 for ; Tue, 9 Jun 2020 13:39:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E203A20760 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 C1F0389F49; Tue, 9 Jun 2020 13:39:34 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6482589D8E; Tue, 9 Jun 2020 09:16:16 +0000 (UTC) IronPort-SDR: zCokkDkPLS//ftJydpQWvT76eKQ1fjjNc5Eiij5NRuJHWF4sEz7KprcE+XxHtSDeB8xaKfH4ox 7L7/6ML1LdEA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2020 02:16:15 -0700 IronPort-SDR: hp4mnEgwYJN3k5YG9bDAy849AXPGUKmf4LsrxP56qR+DacQiImJi6DClfq8LoeL5sx6zVfbbkf ct05bOPM9AqQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,491,1583222400"; d="scan'208";a="473008387" Received: from gklab-125-110.igk.intel.com ([10.91.125.110]) by fmsmga005.fm.intel.com with ESMTP; 09 Jun 2020 02:16:03 -0700 From: Piotr Stankiewicz To: Bjorn Helgaas , linux-pci@vger.kernel.org Subject: [PATCH v3 02/15] PCI: Add macro for message signalled interrupt types Date: Tue, 9 Jun 2020 11:15:53 +0200 Message-Id: <20200609091556.623-1-piotr.stankiewicz@intel.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20200609091148.32749-1-piotr.stankiewicz@intel.com> References: <20200609091148.32749-1-piotr.stankiewicz@intel.com> X-Mailman-Approved-At: Tue, 09 Jun 2020 13:39:33 +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, Yicong Yang , 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 , Piotr Stankiewicz , 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 , Kelsey Skunberg , Logan Gunthorpe , =?UTF-8?q?Christian=20K=C3=B6nig?= , Heiner Kallweit 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 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 Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Reviewed-by: Logan Gunthorpe --- 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 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx