From patchwork Thu Nov 17 15:08:01 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: 21719 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp453001wrr; Thu, 17 Nov 2022 07:11:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf7VPT8deifjhBe6zi6CS4lacVWJT1kFwYQfNbFPi/ER/xv6ozeWogBuFfqbWObAR4graWLm X-Received: by 2002:a17:906:2e86:b0:7a5:f8a5:6f86 with SMTP id o6-20020a1709062e8600b007a5f8a56f86mr2368922eji.610.1668697883924; Thu, 17 Nov 2022 07:11:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668697883; cv=none; d=google.com; s=arc-20160816; b=EW9zEgXv6QHl2CnGXEDi60H2F5h0yuZEIPVAdaLSWWgwOrw8PaQO92lf2n5b5fIT51 W/zQTiMwBKaV4Xoh2mNKnZaIo8cisDvFaymtABK9uFNyJKjz7dMvgTZ5GrqKUufzEHh+ f087t5hpkuF4qYcvz/s7ZwlDnISfkHY9nDwKTMagX++VSkkQVySoHEtHSXOhj2D4X04K mKW/2jvK8QgPQPf1KAwuxx51wWEd/SQ7t0S8e8h+ysKQLuWJ9bQLTzi/hdr54nBzopSw on9pW0xKGD6Lyx5OsFvThc/FM9n5fuOdZ9IlAh4SLngjQUssy7YjwijzkGY4VB+vuH9+ OBcQ== 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=UXKrLsTXnBxcU8Uuv7OZgp4g2eFKodzz2HJBzEFymVE=; b=sAIK0q5BIrHg7Fd/ofr2sTQf0L9kALQFlu0Oq5ExKkI9QWibwlq+qAQV9hH+jEb6jt mWh8goAkmz/BUyd3mMYrq+sKZoLwz7z+0aHzIOXg10AGH3SN5cxAW7vDP274KrHSFVy2 jTJgN/jd8wjfiey7Acdxi8DLO0IroJ+lNvlViQ0Y+EJGCG4sOGhSC11jlGV+nDWD7n3z h9ayVy2ujlerZgwJR93gzo2+RzNMo6a67eqjQOVySvV7cNkS3RbMqdvMf4bqqMQ7A25P qA1YvNZJ0WIsBr7oaFDg0tkkCNQ0sBKXaR+2+J0uK0EsWIM+oK8hW9Esf+fCzUvlZfDz lKFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=KWu+Vi5d; dkim=neutral (no key) header.i=@linutronix.de; 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 nc7-20020a1709071c0700b0078266dc4b8csi806100ejc.719.2022.11.17.07.10.47; Thu, 17 Nov 2022 07:11:23 -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=KWu+Vi5d; dkim=neutral (no key) header.i=@linutronix.de; 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 S239843AbiKQPJH (ORCPT + 99 others); Thu, 17 Nov 2022 10:09:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240193AbiKQPIZ (ORCPT ); Thu, 17 Nov 2022 10:08:25 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82DC874CE4; Thu, 17 Nov 2022 07:08:04 -0800 (PST) Date: Thu, 17 Nov 2022 15:08:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668697683; 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=UXKrLsTXnBxcU8Uuv7OZgp4g2eFKodzz2HJBzEFymVE=; b=KWu+Vi5dATEwS63ZzQ1/7bB50tKWU5uhbiuQ7w8X+laeD4SYP1zcoUbGLpIEIhIi23RzXS c3F/KK7o+7CfFxR/1Wpev4wt41s8TyoReG6QBmbDDZExHJWBsnKwSplwSWqWq2zkXqaLJB 74kMPihH0bjeJYK3IkffUyTchJuZa2LEUI9Bw6Ii15L+RKYarAYGB1GWiejsABRpSNzEjL 0ie1VPxpGz6vfNvVC2uOQfABmvsRvgNFiTg3BRWAhEXY7EGy/t+ILTnPbQQ1N9FoKTtSnL AEH3UuV4D30jrjuYOgpO4518niPdYt/fCZE59avIBvGS74ywvFxAI/Gll1P6ag== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668697683; 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=UXKrLsTXnBxcU8Uuv7OZgp4g2eFKodzz2HJBzEFymVE=; b=gc4KsrymHXVkU7EKydbV1cFdfUuls+vXxHjZ8QeVYhidgKJTsibzKG/Ca6Zcd+HLmwKIAb ZB8z9X05ZGAhHoAQ== 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_msi_enabled() 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.271447896@linutronix.de> References: <20221111122015.271447896@linutronix.de> MIME-Version: 1.0 Message-ID: <166869768194.4906.4177814909795041412.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?1749208422425165230?= X-GMAIL-MSGID: =?utf-8?q?1749756552570700370?= The following commit has been merged into the irq/core branch of tip: Commit-ID: 897a0b6aa8c7ee0015e8d1f781e8e61069aafe16 Gitweb: https://git.kernel.org/tip/897a0b6aa8c7ee0015e8d1f781e8e61069aafe16 Author: Ahmed S. Darwish AuthorDate: Fri, 11 Nov 2022 14:55:01 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 17 Nov 2022 15:15:21 +01:00 PCI/MSI: Move pci_msi_enabled() 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_msi_enabled() 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.271447896@linutronix.de --- 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 93ddc55..49ae3a3 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 d78646d..59c33bc 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 77e2587..f3f4ede 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);