From patchwork Fri Nov 11 13:54:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 18755 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp752679wru; Fri, 11 Nov 2022 05:56:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf76GZOvnqcRBQ1f7eb/AnPTE4EWdZB37A/QuY+wDOKv36M8SOgSp9xiYRHkkuBUEM8pWFGQ X-Received: by 2002:a17:906:b181:b0:7ad:69eb:90c3 with SMTP id w1-20020a170906b18100b007ad69eb90c3mr1966473ejy.285.1668174997279; Fri, 11 Nov 2022 05:56:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668174997; cv=none; d=google.com; s=arc-20160816; b=OOEsdxEF/omHTTjVTc+gJAzAtOPHO/ZAZWfwhEurgZghztVTBccAxYiUS8kQZVJUUt ZTQQozSA/Z85XHEtcOtSihC9AAHYaaXDzyAvzbhwz8N3tYVyDNEENgq0eDKoMsVOjCtB eN/deSbv7AXSAfMiSxc6PWRrgiEPSjbfIt6Jf4HRx6ynn+FF/pV9sMF5Q2jGzJlVtn4p C/nlkKZOAGjRXIal/n1Za/+UvBvMf2BW7dUj8FCaxbF8MhG3I2tN33cGG+BmMdIYwT1b nei++4wgDWFXCnd9k9JiaGleE+7YpfXgzCjP6DL9LXD8SGRVPz7AqiHzz45vdME+mmfY oUGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=pIvr9Rr0WHVjkSJi7bxH/bI9Rim62Flb8AM+4v5YvL4=; b=EnQabYETFnShpZ20AyU6WVsQiPrHuBJgbsvJyyqMXj8cshojeMc6I6PiubXYSrLgrB dUolYmq0rZb4ciHiCBvWVZh623lZYPuF3sPEuJriAsvF6qPOI4KHM51pKTMRncssl+nx 279+apuALAvnz6VDuGaVkgIpPS2DRveGcaRS1EX4mHFZp9FKygCNTcdAKtdvdTj2gRxO /sRO1+iz75+s2N8dP77prH3OL8nIAcj7uRAhRUtJxPt1Hk9+f6sb1bhpv0u9FNJEftQZ nPg6Ja3q/lHQeQExTyp/4NnWhgMtzUB6BL2KJISmxNpgI2heClRUD48NOcQ5VijsgQbP eFoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=whjvZ1hG; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=wxPrtb03; 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 sh32-20020a1709076ea000b007adbe7695a5si2235268ejc.935.2022.11.11.05.56.12; Fri, 11 Nov 2022 05:56:37 -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=whjvZ1hG; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=wxPrtb03; 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 S233674AbiKKNzJ (ORCPT + 99 others); Fri, 11 Nov 2022 08:55:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233655AbiKKNyx (ORCPT ); Fri, 11 Nov 2022 08:54:53 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4C167018C; Fri, 11 Nov 2022 05:54:28 -0800 (PST) Message-ID: <20221111122014.063153448@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668174867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=pIvr9Rr0WHVjkSJi7bxH/bI9Rim62Flb8AM+4v5YvL4=; b=whjvZ1hGnpGUhhkqm9I0JMcNO4qtQO27s2DQH8Oz9beyGWo7DUQsr+41f0+cZiGoF9CSwx vy50S9pzw9A2kbFhsoMOktYg78PizaWs9IR3KZshscuyc2m56wjLCpqJFSZBll2eH6V8nU MFd9D8/wAHhHSsTq9hOhTwRl6vK+7OlKxNjL0jjqxx5Jpk/xWBNusgl4nofXeNU4sGa2Jp 4xxBlfu+GgVENgM2JLDzwXreETXKAUYT3oNe/e3Yp7Pby/icgOzh/0FpdMoIZobV0qz8X0 +eNahDWVvyqLmTEvfdcUV0DxSloKi+SoF3/VjpwVitY04LcMpyXhGyF/Qz4d6A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668174867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=pIvr9Rr0WHVjkSJi7bxH/bI9Rim62Flb8AM+4v5YvL4=; b=wxPrtb03zedDnlK+TXh2gy6+0tXIlW3ThKc+ATDQcqkU5payjRpOO+xzL6leSmWxWqt9sy poWzdm2Y5IW7krDQ== From: Thomas Gleixner To: LKML Cc: 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 , Michael Ellerman , Christophe Leroy , linuxppc-dev@lists.ozlabs.org, "Ahmed S. Darwish" , Reinette Chatre Subject: [patch 08/39] genirq/msi: Provide msi_domain_ops::post_free() References: <20221111120501.026511281@linutronix.de> MIME-Version: 1.0 Date: Fri, 11 Nov 2022 14:54:27 +0100 (CET) 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?1749208266057488564?= X-GMAIL-MSGID: =?utf-8?q?1749208266057488564?= 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: Jason Gunthorpe --- include/linux/msi.h | 4 ++++ kernel/irq/msi.c | 2 ++ 2 files changed, 6 insertions(+) --- 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); }; /** --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -1026,6 +1026,8 @@ void msi_domain_free_irqs_descs_locked(s 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); }