Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp865285rwb; Wed, 16 Nov 2022 08:38:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf4b8IwL+6YA/gvccm0nOETSu/Pzi4AeWjawkvgt3gBy/0Gmv27uYP3sBnbAh2iPj4kKO/eJ X-Received: by 2002:a17:902:a402:b0:186:994b:5b55 with SMTP id p2-20020a170902a40200b00186994b5b55mr9959717plq.100.1668616700483; Wed, 16 Nov 2022 08:38:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668616700; cv=none; d=google.com; s=arc-20160816; b=vvpM+yyg3MMaQC/38gv+ao0Wz62nNgR2Z8EUJ5khmseXY9B5FVyMQsrcGSGpWgMWea 4L51GhFJj1YGhevLO5+Ow7Pb7RWMl7boyBGq/6/EF7WETmsml+abNvvcPpgyOwBWkGDd NilRA/79eBY9E66gScmuvcSG/Ek/uXVK8cRyVO+iqpxJ4mV/BzvHcY37M9IyMIxcbV+m Ddh0OYT8sdImj5SE2IB/meB5PMENPrumSWxLoRa+PzhhYocL+1o9BSrOnihRp4j1wGo2 Ph7o9/p1Eoly2LWoiMxyoeyECTivnUp8V9Rp4F7SXR2Y+7twCqc/Pg8SlopsbMGehv3H 4oIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=1Z2LZQ9RQK1SKHaslbYgiRL7QVVz7EqJvwO8s1RhXto=; b=OdH6UrqnUTzmCSBVArqUHm3QzskP/QvL8D3FR4nJfXoK9Ra41Q0UJlOMmBj/JjlFlq 6/QniGmeGfq7tNwbKCQOfoXK0HMxWXTrAK8GzujWhJyfreBgqR4ejdE9wWApgL/mcopY MdL5jIuwpYiU1J7EetI29nThVzpNp7b6Sah/se9vFpPVKj1Bb13wwjzWStM6O1PKb+PJ SPassVqf6UPN2er3RD0tFfTdP5qrCdeTAoZjkLPlt4iU+6WBKq4xaqXCnb6Qyy//yepO RxO7lus/yb7uHtdUvZWtO6kh8AesbfVSAGWYn4cEWTdGIOKxOj9I7jyRkiZ+Zmnh9BIc XwoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PJ6wYAJR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z15-20020a170903018f00b0017676f11aebsi16408311plg.5.2022.11.16.08.38.09; Wed, 16 Nov 2022 08:38:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PJ6wYAJR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233207AbiKPQaG (ORCPT + 91 others); Wed, 16 Nov 2022 11:30:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239159AbiKPQ3r (ORCPT ); Wed, 16 Nov 2022 11:29:47 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFC506035F; Wed, 16 Nov 2022 08:24:00 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 7B3C6B81DE2; Wed, 16 Nov 2022 16:23:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7905C433C1; Wed, 16 Nov 2022 16:23:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668615838; bh=DiTEt8XP0MxtxKbF5ev7VXOTUwbITQ2VyXFIkyGrEn4=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=PJ6wYAJRMkj/NnbJKwutaEqZGsul0Y5oZ+yT84rWOuJiP+x2WAy2XC1Hdsnf2CweP Y0+tPWImMSwYmXIsB64fs2r3+RwLwvptw8bZNL/hnIdDAGQoshhpq2d+G4awA8LAEi cbUeZHPd0sTqISD9d50J//8Xvlv1QxAiamBAD7GWuiHsBIQQQZ/Kdle1bKcYK2sTIe NQgxmVstgW3cEmnfco4AZJUTpnhbNfpEElLkIPJXmpTyq30zRs0Dn2VzVeYjl0Z/We TaVLWE0vlpVmCGS9+QNfYXtDa7eocyk+ce9knsywPyNpt11zw1FZyBCTGgYY2Yi4Q9 /uoSU11QFLcxw== Date: Wed, 16 Nov 2022 10:23:56 -0600 From: Bjorn Helgaas To: Thomas Gleixner Cc: LKML , x86@kernel.org, Joerg Roedel , Will Deacon , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Greg Kroah-Hartman , Jason Gunthorpe , Dave Jiang , Alex Williamson , Kevin Tian , Dan Williams , Logan Gunthorpe , Ashok Raj , Jon Mason , Allen Hubbe , "Ahmed S. Darwish" , Reinette Chatre , Michael Ellerman , Christophe Leroy , linuxppc-dev@lists.ozlabs.org Subject: Re: [patch 24/39] PCI/MSI: Move pci_irq_vector() to api.c Message-ID: <20221116162356.GA1115513@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221111122014.984490384@linutronix.de> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 11, 2022 at 02:54:53PM +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_irq_vector() and let its kernel-doc match the rest of the file. > > Signed-off-by: Ahmed S. Darwish > Signed-off-by: Thomas Gleixner Acked-by: Bjorn Helgaas > --- > drivers/pci/msi/api.c | 23 +++++++++++++++++++++++ > drivers/pci/msi/msi.c | 24 ------------------------ > 2 files changed, 23 insertions(+), 24 deletions(-) > --- > diff --git a/drivers/pci/msi/api.c b/drivers/pci/msi/api.c > index 8546749afa6e..0f1ec87e3f9f 100644 > --- a/drivers/pci/msi/api.c > +++ b/drivers/pci/msi/api.c > @@ -182,3 +182,26 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs, > return nvecs; > } > EXPORT_SYMBOL(pci_alloc_irq_vectors_affinity); > + > +/** > + * pci_irq_vector() - Get Linux IRQ number of a device interrupt vector > + * @dev: the PCI device to operate on > + * @nr: device-relative interrupt vector index (0-based); has different > + * meanings, depending on interrupt mode > + * MSI-X the index in the MSI-X vector table > + * MSI the index of the enabled MSI vectors > + * INTx must be 0 > + * > + * Return: the Linux IRQ number, or -EINVAL if @nr is out of range > + */ > +int pci_irq_vector(struct pci_dev *dev, unsigned int nr) > +{ > + unsigned int irq; > + > + if (!dev->msi_enabled && !dev->msix_enabled) > + return !nr ? dev->irq : -EINVAL; > + > + irq = msi_get_virq(&dev->dev, nr); > + return irq ? irq : -EINVAL; > +} > +EXPORT_SYMBOL(pci_irq_vector); > diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c > index a028774f438d..38ad2fe4b85c 100644 > --- a/drivers/pci/msi/msi.c > +++ b/drivers/pci/msi/msi.c > @@ -900,30 +900,6 @@ void pci_free_irq_vectors(struct pci_dev *dev) > EXPORT_SYMBOL(pci_free_irq_vectors); > > /** > - * pci_irq_vector - return Linux IRQ number of a device vector > - * @dev: PCI device to operate on > - * @nr: Interrupt vector index (0-based) > - * > - * @nr has the following meanings depending on the interrupt mode: > - * MSI-X: The index in the MSI-X vector table > - * MSI: The index of the enabled MSI vectors > - * INTx: Must be 0 > - * > - * Return: The Linux interrupt number or -EINVAl if @nr is out of range. > - */ > -int pci_irq_vector(struct pci_dev *dev, unsigned int nr) > -{ > - unsigned int irq; > - > - if (!dev->msi_enabled && !dev->msix_enabled) > - return !nr ? dev->irq : -EINVAL; > - > - irq = msi_get_virq(&dev->dev, nr); > - return irq ? irq : -EINVAL; > -} > -EXPORT_SYMBOL(pci_irq_vector); > - > -/** > * pci_irq_get_affinity - return the affinity of a particular MSI vector > * @dev: PCI device to operate on > * @nr: device-relative interrupt vector index (0-based). >