Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1491328imu; Sat, 8 Dec 2018 00:45:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/WjxAUvvUcdvk3uwIt+H2rgFPZ61Cigy9iyXJ87xQD3IDXX2871dlIHyqENMnr/D6/ZZ7aS X-Received: by 2002:a62:16d6:: with SMTP id 205mr5196359pfw.256.1544258704473; Sat, 08 Dec 2018 00:45:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544258704; cv=none; d=google.com; s=arc-20160816; b=bZkakcstL1IxGpD76nk5aNQ5R6mlmXyfRL3tuIWtqpXMp1o+tAnByVT8Pwr6MGfCsI jLwKKxlL0LnzgTfr2NP8DqxIsamoEYvUsaxZ9x0XQRnyIGyamGw9BETv4d/P+c/jWnh+ iXjhwTLYoG9FM5VvtFetyWAQeAnucUstdIIfChIk+f75c51Y9/fc4O77Ys5dbe1Ha8Qp x3JKCrx7ITQ6L+FI/FkBsPCnboZeuW0tLxGDwaMxH64Pu290MbWffojQTmg5V0FrzETu o1uF0eQNeylARk/W5D0mnFdXviicn0ZP3yZwo7Pm5KgTESAICw9idEVLOYYZNTLRgJH5 ShEw== 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=ZDDBRj7B4EAxqiucNiS3SrleR650hrfX6mQjAUO+J9o=; b=ejXVM9NUkf5+xEcH5v1xL+Yz1nOTMupOkEC4ftlp1uG68M1qqf9diLBYU4DzE52+CA QnrXHH0PVsd+fYmCaBHHPIHX+AfXzmVGjNdRRg+3fmphooOzLKmLNmfRlnPf26JU+/Zj 6ek2qq1mbbqyCd4nS0ebdHHL8fK1apFRyEWOku7adIEFEFonZQ4/Jw+F2s/oyFkKzvQN HzNT2hOISZOFWpezOAtol9LjkVoOuOzPVk92mIdsSDZsxOt7r61tLaFLdPj5K4UYkzhr iCE9hcHQmECvJkzpDVu0B+N/tJwnqTrNDlKxQslf5iEILz6HVIdbE+8GpvRMsSh+eAdl GbpQ== 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 w5si4770375pll.64.2018.12.08.00.44.49; Sat, 08 Dec 2018 00:45:04 -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 S1726327AbeLHIoB (ORCPT + 99 others); Sat, 8 Dec 2018 03:44:01 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:14573 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726124AbeLHIoB (ORCPT ); Sat, 8 Dec 2018 03:44:01 -0500 X-UUID: d33d041f6ef54301a907a2cfbead1068-20181208 X-UUID: d33d041f6ef54301a907a2cfbead1068-20181208 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 740546476; Sat, 08 Dec 2018 16:43:50 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs03n1.mediatek.inc (172.21.101.181) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sat, 8 Dec 2018 16:43:48 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Sat, 8 Dec 2018 16:43:41 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Robin Murphy , Rob Herring CC: Tomasz Figa , Will Deacon , , , , , , , , , , , Nicolas Boichat , Arvind Yadav Subject: [PATCH v4 15/18] iommu/mediatek: Add shutdown callback Date: Sat, 8 Dec 2018 16:39:28 +0800 Message-ID: <1544258371-4600-16-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1544258371-4600-1-git-send-email-yong.wu@mediatek.com> References: <1544258371-4600-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain 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 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index c3b4325..9280031 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -708,6 +708,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); @@ -785,6 +790,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), -- 1.9.1