Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1251962imj; Sun, 17 Feb 2019 01:22:28 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibi+CTzInp1l9J4pf7fLJTs8EklasY/d4c7z8TFDff9VqJ/bofUCzbmQnljEft4d0KIIsoK X-Received: by 2002:a63:100c:: with SMTP id f12mr17463951pgl.324.1550395348794; Sun, 17 Feb 2019 01:22:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550395348; cv=none; d=google.com; s=arc-20160816; b=jjYx6sdyvjowCYz/UEHXabos7/U5vBHV9W5cZ4WNXEMdsnbvkOqhfCL8QNt0KlHHL3 /6sLox7goQumqPAxp4ya7QyRnh87QnDXYElW0fAr6+wNf54ZmphxHA8yMHuY+ZSKwdbV /zNKlOMdQGtD5+Z1/QjkAnqxQYDxaQiNbVD7qTEy5SGjn6W7kc43q2JuQP9rJvpp8Vuj D/Zv9fR4qBt7vfI5Pfns/02SmVgNuN2x8LsSzzvD8G99O0c0PfAmJDBKBFGxLKASydPp ahC+2IaPhwe5D2oh745olDr7L9omGW+6/O45ScPnfoLF9Cp1C2BvdxG5AMkFMTPGHFyv R/1Q== 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=KEm5nSaQDPeDxVcLxUdlK/x2nLE/Mg/XbOcfXIiftMA=; b=LGAqwtA/P7nGuKsLmZorb4c108nT5YDVdqsPmA5lCfYwAXhe6MsTiLdLPLU8NJD7QI 6l/fNMDsGkaixVaSyx+F4/Rd2FMLP3myMDhjHlJJVR+K4WRRGyXR9LOtWUJhLvq0jWtC 1Kqc3ANqVmJEkRNgQtHow3UZ3bcdmBOdFK/rMVYDSWfjHnX+LKNMvTK4ywH2GqEGT3ic StC6n4g/2JIdejB69vefywtR7Xs+4XrUr7V0z/eIGRgj018za/Yqp5ruFn6bCFE9fooC sGbcqb//QGOHl+DQAAQJDRaLt4XnKshAVntQLXh7XILuRJQl7LMb6VvgdWJVDKlb3daP se+w== 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 f21si9156573pgv.111.2019.02.17.01.22.12; Sun, 17 Feb 2019 01:22:28 -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 S1727819AbfBQJJa (ORCPT + 99 others); Sun, 17 Feb 2019 04:09:30 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:46050 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727680AbfBQJJ2 (ORCPT ); Sun, 17 Feb 2019 04:09:28 -0500 X-UUID: 83494a69ade54e2aa538aafa1d61b5bc-20190217 X-UUID: 83494a69ade54e2aa538aafa1d61b5bc-20190217 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 181692658; Sun, 17 Feb 2019 17:09:23 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs03n1.mediatek.inc (172.21.101.181) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sun, 17 Feb 2019 17:09:22 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Sun, 17 Feb 2019 17:09:21 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Robin Murphy , Rob Herring CC: Evan Green , Tomasz Figa , Will Deacon , , , , , , , , , , Nicolas Boichat , , Matthias Kaehlcke Subject: [PATCH v6 19/22] iommu/mediatek: Add shutdown callback Date: Sun, 17 Feb 2019 17:04:57 +0800 Message-ID: <1550394300-17420-20-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550394300-17420-1-git-send-email-yong.wu@mediatek.com> References: <1550394300-17420-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 This patch only improve the shutdown flow. The shutdown callback will mute the M4U HW when the system shutdown. Signed-off-by: Yong Wu Reviewed-by: Evan Green --- 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 b02854c..8742841 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -702,6 +702,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); @@ -783,6 +788,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 4f15043..dd84eea 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -660,6 +660,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); @@ -697,6 +702,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