From patchwork Thu Nov 17 15:08:25 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: 21734 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp453707wrr; Thu, 17 Nov 2022 07:12:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf755cFlHOAf5yCoD8udUSmxsK8M35w+mPBMELuDUkEorxKCRogsBSluGpNmE3Xj99c5K7i2 X-Received: by 2002:aa7:cccb:0:b0:462:9bc2:d039 with SMTP id y11-20020aa7cccb000000b004629bc2d039mr2607611edt.127.1668697941952; Thu, 17 Nov 2022 07:12:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668697941; cv=none; d=google.com; s=arc-20160816; b=wrWP3HDWjU1KkZDrj2LDeAeJ+0ViHAtIpj1hs35fWT1G7GrBqKBnsqW6UWkjLoTq32 0JpjqiOPODKtKax6v/ql+y07pgQOIrtnF9r+0+5gBKVy2eGvqfKQrb1+5GIozqGDpBxa Ulqa2GgGKSOUQVBDaURykrW+FEXi1Tfg4V3IAN4bSpL7cz5x5z4ApxEgVaTcsful8Fbj cGcSyw/K+YQ6xduWaFe+TwNvvPEXFLkB8qGYwHNMSXiwn/uhqqIfxsQpwKDB3rKEu3OG QbvdAZHWbEgn/2Rsuku70sHcEGxbIM8sUsmz34SiMO2sVz4O5zXWwChwhrX52gr7h5re UYiQ== 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=T/K9lHuiSF7Wxg1kZkD09F7nqwS2mS7RJYeIJN95CV8=; b=cYIvwvosJBkTjJK8xcu9PVMrf0sDD7Yy+uIC3q97pcU7pYdhzgFlpcDrrOoi2yB230 wLIylU5eC7Mmyw10mAfG5p5vjEX2iwkITMapgfKXrd+ebO0zqRpqFLBr7KdiJbR9Mk7a /Syr3Q5rWhDKtGt7HyFfwBoMHADoRxnuCctrCLjPZBALH6iT+0nca8tklnrDVbjGmIah 0uVNxHio8AvWzrFVi10XKzHiH+Irw4fAsxF0vKxkkXUmq+VCIrWbLLv5nZVcagcaVRFu CDOjwy3pFarVlEs9Yi9BpAuqLFCQPjemo8Aym72+nUvdAl8Be4io0kmfv8+7BC6o302l RAYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Ib59n7Ba; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="L/h4y9+A"; 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 st7-20020a170907c08700b007877b1c7f27si701355ejc.829.2022.11.17.07.11.55; Thu, 17 Nov 2022 07:12:21 -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=Ib59n7Ba; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="L/h4y9+A"; 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 S240623AbiKQPLL (ORCPT + 99 others); Thu, 17 Nov 2022 10:11:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240257AbiKQPJ2 (ORCPT ); Thu, 17 Nov 2022 10:09:28 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C17C5B7C7; Thu, 17 Nov 2022 07:08:27 -0800 (PST) Date: Thu, 17 Nov 2022 15:08:25 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668697706; 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=T/K9lHuiSF7Wxg1kZkD09F7nqwS2mS7RJYeIJN95CV8=; b=Ib59n7BaEPcE2T8pQfPHhE7nE9IRvB2k8SWL0O4sluGrZUyJzYyNSRKyHFpDVPa6rRG5Cd 3wTQ9ZhqKcQjgwVjQDBuzAeGZGE9nXLcbmt/rLthC+tdwz1VGCcnuuUhETGUrOY0043Eri ny4xTP6QdovRm2/YFoLH7PYJGaUvTQ7/i5bLT2yMPaGCgcLBkDkFjdPo1yNQx+hezAzQht T+gTdeucXBvB1za9fc6VDg4+ZaE9GHLs0dl0XjwvzasbDKQjpQpH3rg9UjpcvfVHZnG0LZ lVLYvrob795NwnSALFaqFE2WsvHLB5TL76j+qB2yY1EjQFpcpqpCKBk16rwq5Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668697706; 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=T/K9lHuiSF7Wxg1kZkD09F7nqwS2mS7RJYeIJN95CV8=; b=L/h4y9+AMmuorHcTb8831SQ5PGPJFX8Iqk/Bmt22eSHP3YZB8v4yJjy0iEgT8HziT/3bKF FD8mdNtk4udG9HBQ== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] genirq/msi: Provide msi_domain_ops:: Post_free() Cc: Thomas Gleixner , Ashok Raj , Jason Gunthorpe , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20221111122014.063153448@linutronix.de> References: <20221111122014.063153448@linutronix.de> MIME-Version: 1.0 Message-ID: <166869770523.4906.5860379495214796785.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?1749756612839646295?= X-GMAIL-MSGID: =?utf-8?q?1749756612839646295?= The following commit has been merged into the irq/core branch of tip: Commit-ID: f6d3486a3d2f3c67d732641834eec872fcc66472 Gitweb: https://git.kernel.org/tip/f6d3486a3d2f3c67d732641834eec872fcc66472 Author: Thomas Gleixner AuthorDate: Fri, 11 Nov 2022 14:54:27 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 17 Nov 2022 15:15:19 +01:00 genirq/msi: Provide msi_domain_ops:: Post_free() To prepare for removing the exposure of __msi_domain_free_irqs() provide a post_free() callback in the MSI domain ops which can be used to solve the problem of the only user of __msi_domain_free_irqs() in arch/powerpc. Signed-off-by: Thomas Gleixner Reviewed-by: Ashok Raj Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20221111122014.063153448@linutronix.de --- include/linux/msi.h | 4 ++++ kernel/irq/msi.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/include/linux/msi.h b/include/linux/msi.h index 9b552ee..7f6aba9 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -315,6 +315,8 @@ struct msi_domain_info; * function. * @domain_free_irqs: Optional function to override the default free * function. + * @msi_post_free: Optional function which is invoked after freeing + * all interrupts. * * @get_hwirq, @msi_init and @msi_free are callbacks used by the underlying * irqdomain. @@ -359,6 +361,8 @@ struct msi_domain_ops { struct device *dev, int nvec); void (*domain_free_irqs)(struct irq_domain *domain, struct device *dev); + void (*msi_post_free)(struct irq_domain *domain, + struct device *dev); }; /** diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c index 3ccc7f6..c71c37d 100644 --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -1026,6 +1026,8 @@ void msi_domain_free_irqs_descs_locked(struct irq_domain *domain, struct device lockdep_assert_held(&dev->msi.data->mutex); ops->domain_free_irqs(domain, dev); + if (ops->msi_post_free) + ops->msi_post_free(domain, dev); msi_domain_free_msi_descs(info, dev); }