Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1587501imu; Tue, 6 Nov 2018 00:44:19 -0800 (PST) X-Google-Smtp-Source: AJdET5cJhnBrsWvFCDImRpTG3mPCPyobVKzqQocXriw1PxLqsQa2Bzb6UUL+MmJSKovJWmp7SIlI X-Received: by 2002:a63:1cd:: with SMTP id 196-v6mr6716733pgb.152.1541493859314; Tue, 06 Nov 2018 00:44:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541493859; cv=none; d=google.com; s=arc-20160816; b=Z0Fqs1h5jJKQ36m1P0dAUub2+MfRw0EQbuQ2l5N3g4vL3mYyzPE94B2J/M9Rpji5Vb ea2spZ3h1IMO2nU4juS+8xz1tT86ux5sqfvBI91B3yx2aGZWNrPXN4YjIcVPvV/AF/x0 W/aqvMP5/KG/ta9K3b2bN0whgvohpSCulN99zT3Osjc+KF62kC0B3xKd4mYq3+bROnDd oHqNwZUcFCK3oRGEJ2rywT8OByT3mS0re9+GRyQDlqn2nBfORDZevuBF1SLMcSULqhoY RC7RFlK4rR4rFZEgcvtLuPqA/bhgzhi3M9wzd8PK29NxVEhLN2NvCJOaxpDY5bkdlvUe W0NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kIl/cLLWdptcHPMDS1dAl6PzFdTumdNoawV4wjR6/xI=; b=cw1QR2LP/HqQEP1YDMrwH7JKIsJZGVgPxTS39eVNDppv9fiJotwH1aW5A1syTwiig5 gpPvarpwNDl+lrAl8lkMozx/3iDJXfGn2azF90bRfNm4JknE8XDVvjZMucvuP74b0eAt pM0JJ41hRiJcmmNBcky1U+OAzXaBIv5lRLLAm/r4Ukzdfh99UnR/qDpT8M7q91/O4WUG SMo8BSk3ki3AfFY/xNFCU9BLtuxwpwuMgE/bnrNuZoOlzK8tSDslZkOPYBRpKaNTZCiL xbrBVgfbgTohIQ4VAmqjzQom4o4OU9YtmOmnQQ5JqAZWXFZ3RUFG5RdnHbg4gbl1z8Xn TJag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 207-v6si30058672pfw.277.2018.11.06.00.44.04; Tue, 06 Nov 2018 00:44:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387509AbeKFSGs (ORCPT + 99 others); Tue, 6 Nov 2018 13:06:48 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:34720 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729416AbeKFSGs (ORCPT ); Tue, 6 Nov 2018 13:06:48 -0500 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 , , , CC: Linux ARM Mailing List , , Tero Kristo , Sekhar Nori , Device Tree Mailing List , Grygorii Strashko , Peter Ujfalusi , Lokesh Vutla 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) { -- 2.19.1