From patchwork Tue Nov 6 08:41:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lokesh Vutla X-Patchwork-Id: 10669923 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 810A614E2 for ; Tue, 6 Nov 2018 08:45:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B6D129077 for ; Tue, 6 Nov 2018 08:45:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A34129490; Tue, 6 Nov 2018 08:45:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E8D8C29077 for ; Tue, 6 Nov 2018 08:45:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QIeyRnFMe8yMibM4P6tb+D0bjE6X/sXlv4lA2asnsbg=; b=Nh84iMzmpU7vIn fOnC/IYz7JmYvHSW8UDUTpB0IoBpUdhfPY9mCv2fVMnCqwgrxEfd8/1yzMDVkiXl+v8uLSwXGi+5t 4Hq0qlspXkooBJFlSDiFn4lYelt5vXbeqMIjcNwLZp2dui1E2ynYqWWngVrOAvLDTZoF86GZEArVl ZK44dCT0SCfn0IgIcN73OvH1X4YyGqwoeyiRB2jwI4pda/ryPY4W0nyUHuI41z1KtzToYYeYf3zt3 /M+ASv7qxiC55VKe4fs2B02HbEWsczT+ql9NJkGNlpcpyXU9OkTqiE2HGMBcXLtwgGVgMwO0AeV84 HEnDCiE9l+B2iLD+FRKQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJwyj-0003Ot-JX; Tue, 06 Nov 2018 08:44:53 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJwwc-0001Gj-8z for linux-arm-kernel@bombadil.infradead.org; Tue, 06 Nov 2018 08:42:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=kIl/cLLWdptcHPMDS1dAl6PzFdTumdNoawV4wjR6/xI=; b=VCe4gCFQBsSAKzVHEvVi3NpToq Hvzg8Aeu4gMdSTsdLumuXoQrGu+K30YVu29ITuswZqBYIzLp1M8qZhLhJO9THJgPSWvcgnjKi1Oxb mJ8XegXGgol6PcjsNX8SwLQT8bJZny176NspjJC7E9UDruo4B+8K12Uz8Z03JLLNFORJbZa57Zm9k D4js8w1d50rEug0e1bee9KuM+vKJOQWBMxa2jaSom7uo8HlhAVIQSGQA1ZQIGfl5kBtbr/rKZbHX7 zKh5LmEdJfcMt0NpYvX2FfcHlHM/6jUedWocMKc1gyITZ09XiLU/2byIM4iqbfpfzZ3bhw0U4y39T qEJwr07Q==; Received: from fllv0016.ext.ti.com ([198.47.19.142]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJwwY-0004WQ-UG for linux-arm-kernel@lists.infradead.org; Tue, 06 Nov 2018 08:42:39 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id wA68g1mL092045; Tue, 6 Nov 2018 02:42:01 -0600 Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wA68g1lS128251 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Nov 2018 02:42:01 -0600 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Tue, 6 Nov 2018 02:42:00 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Tue, 6 Nov 2018 02:42:00 -0600 Received: from uda0131933.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id wA68fJ3s032677; Tue, 6 Nov 2018 02:41:57 -0600 From: Lokesh Vutla To: Nishanth Menon , Santosh Shilimkar , Rob Herring , , , Subject: [RFC PATCH v3 09/13] genirq/msi: Add support for .msi_unprepare callback Date: Tue, 6 Nov 2018 14:11:01 +0530 Message-ID: <20181106084105.32483-10-lokeshvutla@ti.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181106084105.32483-1-lokeshvutla@ti.com> References: <20181106084105.32483-1-lokeshvutla@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181106_034239_109504_127C22BA X-CRM114-Status: GOOD ( 12.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Device Tree Mailing List , Grygorii Strashko , Peter Ujfalusi , Lokesh Vutla , Sekhar Nori , linux-kernel@vger.kernel.org, Tero Kristo , Linux ARM Mailing List Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add an optional callback .msi_unprepare to struct msi_domain_ops. This is used to clear any effect that is done by .msi_prepare callback. Signed-off-by: Lokesh Vutla --- Changes since v2: - New patch include/linux/msi.h | 3 +++ kernel/irq/msi.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/linux/msi.h b/include/linux/msi.h index 021f789226b5..1e37aa569a3c 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -237,6 +237,8 @@ struct msi_domain_ops { int (*msi_prepare)(struct irq_domain *domain, struct device *dev, int nvec, msi_alloc_info_t *arg); + void (*msi_unprepare)(struct irq_domain *domain, int nvec, + void *data); void (*msi_finish)(msi_alloc_info_t *arg, int retval); void (*set_desc)(msi_alloc_info_t *arg, struct msi_desc *desc); @@ -317,6 +319,7 @@ void platform_msi_domain_free_irqs(struct device *dev); /* When an MSI domain is used as an intermediate domain */ int msi_domain_prepare_irqs(struct irq_domain *domain, struct device *dev, int nvec, msi_alloc_info_t *args); +void msi_domain_unprepare_irqs(struct irq_domain *domain, int nvec, void *data); int msi_domain_populate_irqs(struct irq_domain *domain, struct device *dev, int virq, int nvec, msi_alloc_info_t *args); struct irq_domain * diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c index e37238317fab..87ce5a5d0c6d 100644 --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -312,6 +312,16 @@ int msi_domain_prepare_irqs(struct irq_domain *domain, struct device *dev, return ret; } +void msi_domain_unprepare_irqs(struct irq_domain *domain, int nvec, + void *data) +{ + struct msi_domain_info *info = domain->host_data; + struct msi_domain_ops *ops = info->ops; + + if (ops->msi_unprepare) + ops->msi_unprepare(domain, nvec, data); +} + int msi_domain_populate_irqs(struct irq_domain *domain, struct device *dev, int virq, int nvec, msi_alloc_info_t *arg) {