Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11496479imu; Tue, 1 Jan 2019 00:20:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN6ysgRdL9j7rbs+KXoEaPcMV5sv1Kd7fUkdR1hx2DxGvIcBbRwmE6d8LxiprqEYhVEE3dZZ X-Received: by 2002:a63:c748:: with SMTP id v8mr10086790pgg.108.1546330842593; Tue, 01 Jan 2019 00:20:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546330842; cv=none; d=google.com; s=arc-20160816; b=C67JzIYg9a4HcAMc8bZ8pk5H0Uks6b398LzXEafTGUpZ9OIOh54Cn7W3aSVrFc8Lwb A4q668vefxp9WB7qHs8NC2yC4GTFeJJBecz3ZA3tUjHMEHU69Dx3c9IvUwD7u5GllYFa EZXpMFKceI0MFEGgqrOAM3eCSLdFtKii+rG2j6p7Ei8gXpok8Wm3He7vrKJvcKm8Wt34 95vR83hnibCyqkmNvy+aoQ9lTHQpqJ221Zk5WFjDYfVX6UHtKkXnrnyzzAKMxLywPB8w poW2ULUPiWqgFBSKWPyvQxQ4kcc8NcD8lSAzEBx9fWeCw4trtEsBlLzLFQ/W3jTigYoU qkzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=g17p+qPw3JUpY7qp8KAKGSatio1EREg2DS1u/tjJNas=; b=PQs9Fa725vyYJkne3Qj7xTr9sTmeIOC0hTBscjZHpRq0kYtMJprceynZm9AOjdA6wP jIHIg9rWdHdChRQOD5z+s4LSnIsYvib9wnUqhBAlJDCo6BKPWgiA/W3ws9TOzN+1yKKy GpftF80WUIqE7wRk6mrSQshUxL7DyaErzb8C2SYdqoeLo83VKXbe0x+lAc+9c+jJst4g kxUopfPWwuKKtqHkhjmWtZXY9ScX6roQW0wG2FdRfOEywIdk+IVV8t8B2xhopn277teK XOnMHGBK3voEYF4czcDmxC4CY5C1TMr06PNQftRplrIC0P1IwwgSLuZuoG7UoF1oj8Bg KP1A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g21si46754731pgl.114.2019.01.01.00.20.27; Tue, 01 Jan 2019 00:20:42 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728447AbfAAEA0 (ORCPT + 99 others); Mon, 31 Dec 2018 23:00:26 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:41104 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728276AbfAAEAZ (ORCPT ); Mon, 31 Dec 2018 23:00:25 -0500 X-UUID: 64c31351db5d4ba19bb44812930132a6-20190101 X-UUID: 64c31351db5d4ba19bb44812930132a6-20190101 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1660273875; Tue, 01 Jan 2019 12:00:04 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 1 Jan 2019 12:00:03 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 1 Jan 2019 12:00:03 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Robin Murphy , Rob Herring CC: Tomasz Figa , Will Deacon , , , , , , , , , , , Nicolas Boichat Subject: [PATCH v5 19/20] iommu/mediatek: Add shutdown callback Date: Tue, 1 Jan 2019 11:55:51 +0800 Message-ID: <1546314952-15990-20-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1546314952-15990-1-git-send-email-yong.wu@mediatek.com> References: <1546314952-15990-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: BA3E90807588920A516E43686156FF7C58D87C46E4B96381C65D99E98F62FC1B2000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the reboot burning test, if some Multimedia HW has something wrong, It may keep send the invalid request to IOMMU. In order to avoid affect the reboot flow, we add the shutdown callback to disable M4U HW when shutdown. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 6 ++++++ drivers/iommu/mtk_iommu_v1.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index ddf1969..dcb02e3 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -703,6 +703,11 @@ static int mtk_iommu_remove(struct platform_device *pdev) return 0; } +static void mtk_iommu_shutdown(struct platform_device *pdev) +{ + mtk_iommu_remove(pdev); +} + static int __maybe_unused mtk_iommu_suspend(struct device *dev) { struct mtk_iommu_data *data = dev_get_drvdata(dev); @@ -784,6 +789,7 @@ static int __maybe_unused mtk_iommu_resume(struct device *dev) static struct platform_driver mtk_iommu_driver = { .probe = mtk_iommu_probe, .remove = mtk_iommu_remove, + .shutdown = mtk_iommu_shutdown, .driver = { .name = "mtk-iommu", .of_match_table = of_match_ptr(mtk_iommu_of_ids), diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 6ede428..517dfbd 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -662,6 +662,11 @@ static int mtk_iommu_remove(struct platform_device *pdev) return 0; } +static void mtk_iommu_shutdown(struct platform_device *pdev) +{ + mtk_iommu_remove(pdev); +} + static int __maybe_unused mtk_iommu_suspend(struct device *dev) { struct mtk_iommu_data *data = dev_get_drvdata(dev); @@ -699,6 +704,7 @@ static int __maybe_unused mtk_iommu_resume(struct device *dev) static struct platform_driver mtk_iommu_driver = { .probe = mtk_iommu_probe, .remove = mtk_iommu_remove, + .shutdown = mtk_iommu_shutdown, .driver = { .name = "mtk-iommu-v1", .of_match_table = mtk_iommu_of_ids, -- 1.9.1