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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 B9305C433F5 for ; Tue, 7 Dec 2021 21:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=R6SkoBhQokcHyHWsb/GoR1AwuRUo4pwvnyV1xWXkaRg=; b=VwJK3+3sQTQb2f QX3ZIRLVCsLNvXdvWXxejDLUAeKqkX6fF8VmbtHUTZisAzuPtsQNHnP38G/cSxWdR7tWfjIltW0vR P3Qn3sd3JgbUhYY5NyGWelKsef9qrGgFsikZxokfOVVXs2ax6AT9w0WxhRrC/3brF86Hle2zGPpvx kJnEIROUrwitPmzErXiX/R8msJCMBFQSIl+JGCPhhe+FU4g/21InkcHniqyjY/jus/DYSsG7lewHq NQGpnNjLx8+XASOIGSADMC9g6dxbnwd6hEvBar7rWc1T5q1XJv/455fYZYTYvzhHKelfJRQ42VqyD FRaURpla61NjZ52LzZJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muhew-00A7jc-3s; Tue, 07 Dec 2021 21:05:58 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muhem-00A7gP-Ts for linux-arm-kernel@lists.infradead.org; Tue, 07 Dec 2021 21:05:50 +0000 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 97655B81E8A; Tue, 7 Dec 2021 21:05:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E534FC341C1; Tue, 7 Dec 2021 21:05:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638911146; bh=emmb3xsy+H3LBfwGrcgXTk/PL3JNw+p8ei444INyEeo=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=tUHMVIuvSKD4KpV71T2u3HTnNeDdjH94nw6ue1OFelE7L1C2fPpkpG+VJS6EQ7RbL DE4nTrcL4DzJJW3p9KkxJ90aY6WFOuJBcNOz8jNU3ACfHQRdCHhgymSV73nOEduwEV 6C7Yc+PJ57lEXe3kC7Fnk7gDayIipgMIIFTSVZY22xFXTXz0GcB0An+vkRX1XJHFeD 76cd+8jimETlvZcjXu7IptnZ7ZJ5TZKmn3H2yllAjGpq1LNMQk63AsB8yMhOvkaWG7 8Ad9xB75VRw/OAC03WjVlipOwF+92OCz7KOMco287/fqEZgDdhOY94sgRr2WDdSvK3 r75m+DCO8+wLg== Date: Tue, 7 Dec 2021 15:05:44 -0600 From: Bjorn Helgaas To: Thomas Gleixner Cc: LKML , Marc Zygnier , Alex Williamson , Kevin Tian , Jason Gunthorpe , Megha Dey , Ashok Raj , linux-pci@vger.kernel.org, Cedric Le Goater , xen-devel@lists.xenproject.org, Juergen Gross , Greg Kroah-Hartman , Will Deacon , Santosh Shilimkar , iommu@lists.linux-foundation.org, dmaengine@vger.kernel.org, Stuart Yoder , Laurentiu Tudor , Nishanth Menon , Tero Kristo , linux-arm-kernel@lists.infradead.org, Vinod Koul , Mark Rutland , Robin Murphy , Sinan Kaya Subject: Re: [patch V2 28/36] PCI/MSI: Use __msi_get_virq() in pci_get_vector() Message-ID: <20211207210544.GA77966@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211206210439.181331216@linutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211207_130549_130142_01E46C67 X-CRM114-Status: GOOD ( 18.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Dec 06, 2021 at 11:39:41PM +0100, Thomas Gleixner wrote: > Use msi_get_vector() and handle the return value to be compatible. > > No functional change intended. > > Signed-off-by: Thomas Gleixner Acked-by: Bjorn Helgaas > --- > V2: Handle the INTx case directly instead of trying to be overly smart - Marc > --- > drivers/pci/msi/msi.c | 25 +++++-------------------- > 1 file changed, 5 insertions(+), 20 deletions(-) > > --- a/drivers/pci/msi/msi.c > +++ b/drivers/pci/msi/msi.c > @@ -1032,28 +1032,13 @@ EXPORT_SYMBOL(pci_free_irq_vectors); > */ > int pci_irq_vector(struct pci_dev *dev, unsigned int nr) > { > - if (dev->msix_enabled) { > - struct msi_desc *entry; > + unsigned int irq; > > - for_each_pci_msi_entry(entry, dev) { > - if (entry->msi_index == nr) > - return entry->irq; > - } > - WARN_ON_ONCE(1); > - return -EINVAL; > - } > + if (!dev->msi_enabled && !dev->msix_enabled) > + return !nr ? dev->irq : -EINVAL; > > - if (dev->msi_enabled) { > - struct msi_desc *entry = first_pci_msi_entry(dev); > - > - if (WARN_ON_ONCE(nr >= entry->nvec_used)) > - return -EINVAL; > - } else { > - if (WARN_ON_ONCE(nr > 0)) > - return -EINVAL; > - } > - > - return dev->irq + nr; > + irq = msi_get_virq(&dev->dev, nr); > + return irq ? irq : -EINVAL; > } > EXPORT_SYMBOL(pci_irq_vector); > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel