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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 40F43C433FE for ; Wed, 16 Nov 2022 16:30:17 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4NC7nM59q8z3fHd for ; Thu, 17 Nov 2022 03:30:15 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=P/gXMOOL; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=145.40.73.55; helo=sin.source.kernel.org; envelope-from=helgaas@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=P/gXMOOL; dkim-atps=neutral Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4NC7jL4Yzpz3fHT for ; Thu, 17 Nov 2022 03:26:46 +1100 (AEDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 3B8F1CE1BE8; Wed, 16 Nov 2022 16:26:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 265B5C433C1; Wed, 16 Nov 2022 16:26:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668616003; bh=7dRd1C8mTpkHuyLg0ecBxDafE9jSuXIZwtzca2R9S/U=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=P/gXMOOLklt9M+/GHi301BiUiczOapf+dKNFSW0BH0y6HzMrvFRsEYXJ3m7hzsZ02 p0V5RHlJXYKcmkbTH3tOXnD2TLz0nWE0aNDSFSs/Vaoz/QlJe0ECihGDxI5KJA/qto 3p3kqcvmrg+kARLZ0ruMZDLaBcw6HBEF+j97tmJFM1Tcyr+ftJwAW/7KKGmprqh5ZQ Q0YoUj1JLkwL1qISJE6Dqc3wUiMgrEKZhOCNtikFK9e/BwPTo+tIVIwjXN7fYRTEl1 Z14lyP1muI4If7OVQsFCb7svIs9e8QTRj/MIUObE/rRuPFPEhsAww39nvt6/pBXUhz QeQXvU08px9kA== Date: Wed, 16 Nov 2022 10:26:41 -0600 From: Bjorn Helgaas To: Thomas Gleixner Subject: Re: [patch 29/39] PCI/MSI: Move pci_msi_enabled() to api.c Message-ID: <20221116162641.GA1115904@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221111122015.271447896@linutronix.de> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pci@vger.kernel.org, Will Deacon , Lorenzo Pieralisi , Dave Jiang , Ashok Raj , Joerg Roedel , x86@kernel.org, Jason Gunthorpe , Allen Hubbe , Kevin Tian , "Ahmed S. Darwish" , Jon Mason , linuxppc-dev@lists.ozlabs.org, Alex Williamson , Bjorn Helgaas , Dan Williams , Reinette Chatre , Greg Kroah-Hartman , LKML , Marc Zyngier , Logan Gunthorpe Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Nov 11, 2022 at 02:55:01PM +0100, Thomas Gleixner wrote: > From: Ahmed S. Darwish > > To distangle the maze in msi.c, all exported device-driver MSI APIs are > now to be grouped in one file, api.c. > > Move pci_msi_enabled() and make its kernel-doc comprehensive. > > Signed-off-by: Ahmed S. Darwish > Signed-off-by: Thomas Gleixner Acked-by: Bjorn Helgaas > --- > drivers/pci/msi/api.c | 12 ++++++++++++ > drivers/pci/msi/msi.c | 14 +------------- > drivers/pci/msi/msi.h | 3 +++ > 3 files changed, 16 insertions(+), 13 deletions(-) > --- > diff --git a/drivers/pci/msi/api.c b/drivers/pci/msi/api.c > index 473df7ba0584..ee9ed5ccd94d 100644 > --- a/drivers/pci/msi/api.c > +++ b/drivers/pci/msi/api.c > @@ -307,3 +307,15 @@ void pci_free_irq_vectors(struct pci_dev *dev) > pci_disable_msi(dev); > } > EXPORT_SYMBOL(pci_free_irq_vectors); > + > +/** > + * pci_msi_enabled() - Are MSI(-X) interrupts enabled system-wide? > + * > + * Return: true if MSI has not been globally disabled through ACPI FADT, > + * PCI bridge quirks, or the "pci=nomsi" kernel command-line option. > + */ > +int pci_msi_enabled(void) > +{ > + return pci_msi_enable; > +} > +EXPORT_SYMBOL(pci_msi_enabled); > diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c > index d78646d1c116..59c33bc7fe81 100644 > --- a/drivers/pci/msi/msi.c > +++ b/drivers/pci/msi/msi.c > @@ -13,7 +13,7 @@ > #include "../pci.h" > #include "msi.h" > > -static int pci_msi_enable = 1; > +int pci_msi_enable = 1; > int pci_msi_ignore_mask; > > void pci_msi_update_mask(struct msi_desc *desc, u32 clear, u32 set) > @@ -864,15 +864,3 @@ void pci_no_msi(void) > { > pci_msi_enable = 0; > } > - > -/** > - * pci_msi_enabled - is MSI enabled? > - * > - * Returns true if MSI has not been disabled by the command-line option > - * pci=nomsi. > - **/ > -int pci_msi_enabled(void) > -{ > - return pci_msi_enable; > -} > -EXPORT_SYMBOL(pci_msi_enabled); > diff --git a/drivers/pci/msi/msi.h b/drivers/pci/msi/msi.h > index 77e2587f7e4f..f3f4ede53171 100644 > --- a/drivers/pci/msi/msi.h > +++ b/drivers/pci/msi/msi.h > @@ -84,6 +84,9 @@ static inline __attribute_const__ u32 msi_multi_mask(struct msi_desc *desc) > return (1 << (1 << desc->pci.msi_attrib.multi_cap)) - 1; > } > > +/* Subsystem variables */ > +extern int pci_msi_enable; > + > /* MSI internal functions invoked from the public APIs */ > void pci_msi_shutdown(struct pci_dev *dev); > void pci_msix_shutdown(struct pci_dev *dev); >