From patchwork Thu Nov 17 15:08:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 21717 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp452899wrr; Thu, 17 Nov 2022 07:11:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf7h15WKB27sgIa4xmJUikQbYwQuu1M0ndDobxiW0fxF58mcsoqHXjbl8bvD2bgvJj5iItth X-Received: by 2002:a17:907:2ad7:b0:79e:8360:8c3d with SMTP id fm23-20020a1709072ad700b0079e83608c3dmr2576301ejc.146.1668697875224; Thu, 17 Nov 2022 07:11:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668697875; cv=none; d=google.com; s=arc-20160816; b=emKjisw30ba3ASGLdImM1o30biCVBd4M4qlOy8rOPb1Dc9UiaimOLOHpuzSoeHyZUo BfDRdA5y3/chY/au3HihGdxrC70/OmhfDwy3Cz2UtPxMmQQPqdwALt1ey/1dvqOAGL9/ FHu+/5UIK1KP1Oa2p6EO2jFjOTN2lUH16CWTID3D8OYh/A4iWysV/V+WauJUSEPNQpIp vBReYdGT9R3b8iXczUooUW9c9FmguEfgzpcjU0CNsIVitmOJf2x7WgFz3OJIACCYHYD7 K3jnbt68sF7jb+fPLfI1Rj5lkRFtd8dpjklYimgucUmHiyrgkWmXfFvFkIr/nPDgDkmw W5Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=rZjMnWePQEtbMBFxB0ie29NpXUSaoI74i/VpN4xx1V8=; b=yGVOVG+8lLpqjEh83Q7WwouS/pHFBy7G6n767nxt0wGInTxOYug4DRqwsdMEJvySRO Qk8h0KHD7XrFnRP7KCPXO5SkWWiSotnpGDh9/nH07Ho1v6WWuuZ4GQ5HtKH8aKVNo/Gx DYZczpf4eiMaq9O2XQ530CA1w8DvTupdmB6J8TxvjYt8mimlxV8WiYJC2czrFnez/z3R XCk476j0+8x2Zq0Edk3NubvtoFZtPY27NR5/VUSJH0pPtNYq0VpqDxr5vQ10zOlgP3a2 Xf3liq+d4KmPi929ubsvy8PuiB+ID8DcSjQ9bR77MFwc9ZX1WPJIogy6f763lq7gvH/v rN+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=yurlAnIu; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=gwEw2vKm; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n11-20020a05640205cb00b00468fd5712a3si195085edx.351.2022.11.17.07.10.38; Thu, 17 Nov 2022 07:11:15 -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=@linutronix.de header.s=2020 header.b=yurlAnIu; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=gwEw2vKm; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240499AbiKQPJg (ORCPT + 99 others); Thu, 17 Nov 2022 10:09:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240296AbiKQPIv (ORCPT ); Thu, 17 Nov 2022 10:08:51 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 291AF769F5; Thu, 17 Nov 2022 07:08:09 -0800 (PST) Date: Thu, 17 Nov 2022 15:08:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668697687; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rZjMnWePQEtbMBFxB0ie29NpXUSaoI74i/VpN4xx1V8=; b=yurlAnIuT4mfgpDwqKwuVGw5zQDjH7Yjb7vkOgAEc++ppuvS7CPrTsode2KE9FESDNGEDF TJe3BSPJ3W4ynH+w+J16G4AQH8Huu4yiWGWQ0gBD7dgldmGm+YGmzOY2LXImKKv+AjYd9O Skvx2TxE3oqq6N9tmh5ZZZhHd4Uo0Icz0iqqB3xLyGdQuwBZXW20XyTiN2iAr3Wc+iOO0p mbxZQMeRKC9DcLtGh6XFgL2yFZq/DSPB4764+3BqW5maVEFZjIzB+hpgcNh7UhmsYq3+/0 JkFs7VZjLBHrPJWz5C/XGOVpB1SR5EV0rfFb7Vn9/qhVQO7KVMmnO7eQfO2NDw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668697687; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rZjMnWePQEtbMBFxB0ie29NpXUSaoI74i/VpN4xx1V8=; b=gwEw2vKmRaojPFc8vXKkyNWRX8LW0q/QpWnzLcgZEPYEsIWB1GUreYVQZeH2jbZnNpLf06 H+wdtgRjRFfRtaBw== From: "tip-bot2 for Ahmed S. Darwish" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] PCI/MSI: Move pci_free_irq_vectors() to api.c Cc: "Ahmed S. Darwish" , Thomas Gleixner , Bjorn Helgaas , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20221111122015.042870570@linutronix.de> References: <20221111122015.042870570@linutronix.de> MIME-Version: 1.0 Message-ID: <166869768653.4906.6407407753277072388.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749208372909429031?= X-GMAIL-MSGID: =?utf-8?q?1749756543417384477?= The following commit has been merged into the irq/core branch of tip: Commit-ID: 059f778d66ba88e1acad89a46cfb35eb8703feef Gitweb: https://git.kernel.org/tip/059f778d66ba88e1acad89a46cfb35eb8703feef Author: Ahmed S. Darwish AuthorDate: Fri, 11 Nov 2022 14:54:54 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 17 Nov 2022 15:15:21 +01:00 PCI/MSI: Move pci_free_irq_vectors() to api.c To disentangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_free_irq_vectors() and make its kernel-doc comprehensive. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20221111122015.042870570@linutronix.de --- drivers/pci/msi/api.c | 15 +++++++++++++++ drivers/pci/msi/msi.c | 13 ------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/pci/msi/api.c b/drivers/pci/msi/api.c index 0f1ec87..2ff2a9c 100644 --- a/drivers/pci/msi/api.c +++ b/drivers/pci/msi/api.c @@ -205,3 +205,18 @@ int pci_irq_vector(struct pci_dev *dev, unsigned int nr) return irq ? irq : -EINVAL; } EXPORT_SYMBOL(pci_irq_vector); + +/** + * pci_free_irq_vectors() - Free previously allocated IRQs for a device + * @dev: the PCI device to operate on + * + * Undo the interrupt vector allocations and possible device MSI/MSI-X + * enablement earlier done through pci_alloc_irq_vectors_affinity() or + * pci_alloc_irq_vectors(). + */ +void pci_free_irq_vectors(struct pci_dev *dev) +{ + pci_disable_msix(dev); + pci_disable_msi(dev); +} +EXPORT_SYMBOL(pci_free_irq_vectors); diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c index 38ad2fe..ed8caf5 100644 --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -887,19 +887,6 @@ int __pci_enable_msix_range(struct pci_dev *dev, } /** - * pci_free_irq_vectors - free previously allocated IRQs for a device - * @dev: PCI device to operate on - * - * Undoes the allocations and enabling in pci_alloc_irq_vectors(). - */ -void pci_free_irq_vectors(struct pci_dev *dev) -{ - pci_disable_msix(dev); - pci_disable_msi(dev); -} -EXPORT_SYMBOL(pci_free_irq_vectors); - -/** * 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).