Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp500303pxb; Thu, 23 Sep 2021 05:01:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJeq+AwTDkPASh2i5LSKTXlCjA55O19w4o7JzbBoMA9pQXHEvDDPfFIbmgxvK8FzUH8JoN X-Received: by 2002:a17:906:8151:: with SMTP id z17mr4455486ejw.468.1632398513966; Thu, 23 Sep 2021 05:01:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632398513; cv=none; d=google.com; s=arc-20160816; b=Yq6exiGl3wDUS2hy0E2O8+midFiCppQd3mQV5IvolMYhET3gjv32QhtCJPlIozoZE7 E69clY4OAfL+zzXt+Fju5MbmqukSGEmsh865gcvKWl6xWTLMg7YGR4hPkrU7UT8xCrCU S3cECo6rskJMcp8W+abpwCtMF7NdZQGLJstvADDxancS1bJNwC6rmLIBMVOz4NaFaZqW 2vt4tPR/3+0EZqm/qHQXDLcoguIqu5qimyJswy2ycRlZ0hmZhbRndoBS2cZc5Tr1pZwc P+7rugqnlUkCtAEhdUcGNyhpxYQnafxXjpfGBW5RBLmYnuhkeyGoEpJYGx6xF2NgsVti fF5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=55mjnYzY0ANs9sAl3LioiQINoY5oPFeeQ1lEOeDKL2w=; b=tlWIfcLYY0GZ67hbsJbqVpPKWGudIS1/OZaCVjPPgBpix9K/Z8KwQc61Q9yssILomE u+E3M93OKhl6k5KsQ7GFqNacFWQTRU22GH2tDDHgV2WtZh6s0CLrcovjRUHMOXKrpgqZ TsK39e9+zM13aY5QjXjIL56KROwqcYCSe2C+uM2ieBtaQDSpg1c3mmZhXUuknrOfUS4Q T12xaWqPjDjZyUUCEKMZ3OrytG+I7IjKQ7jBLx8x9ZPJ3WULZREIV4bdRW/4OMSGQ3mN CNoRfEDnujWMw5RJHarGdMt9bTIw6dQR1DE/9sORjoiRZ4K1KnLIAtfbcf7iY8Xxqw/q dOQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f29si5767711ejj.773.2021.09.23.05.01.25; Thu, 23 Sep 2021 05:01:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240768AbhIWMBL (ORCPT + 99 others); Thu, 23 Sep 2021 08:01:11 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:48604 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S240729AbhIWMBH (ORCPT ); Thu, 23 Sep 2021 08:01:07 -0400 X-UUID: 1fb5f79466974d7ba8d2395c84e64ced-20210923 X-UUID: 1fb5f79466974d7ba8d2395c84e64ced-20210923 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1143161127; Thu, 23 Sep 2021 19:59:31 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 23 Sep 2021 19:59:29 +0800 Received: from localhost.localdomain (10.17.3.154) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 23 Sep 2021 19:59:28 +0800 From: Yong Wu To: Joerg Roedel , Rob Herring , Matthias Brugger , Will Deacon , Robin Murphy CC: Krzysztof Kozlowski , Tomasz Figa , , , , , , , Hsin-Yi Wang , , , , , Subject: [PATCH v3 04/33] iommu/mediatek: Remove clk_disable in mtk_iommu_remove Date: Thu, 23 Sep 2021 19:58:11 +0800 Message-ID: <20210923115840.17813-5-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210923115840.17813-1-yong.wu@mediatek.com> References: <20210923115840.17813-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After the commit b34ea31fe013 ("iommu/mediatek: Always enable the clk on resume"), the iommu clock is controlled by the runtime callback. thus remove the clk control in the mtk_iommu_remove. Otherwise, it will warning like: echo 14018000.iommu > /sys/bus/platform/drivers/mtk-iommu/unbind [ 51.413044] ------------[ cut here ]------------ [ 51.413648] vpp0_smi_iommu already disabled [ 51.414233] WARNING: CPU: 2 PID: 157 at */v5.15-rc1/kernel/mediatek/ drivers/clk/clk.c:952 clk_core_disable+0xb0/0xb8 [ 51.417174] Hardware name: MT8195V/C(ENG) (DT) [ 51.418635] pc : clk_core_disable+0xb0/0xb8 [ 51.419177] lr : clk_core_disable+0xb0/0xb8 ... [ 51.429375] Call trace: [ 51.429694] clk_core_disable+0xb0/0xb8 [ 51.430193] clk_core_disable_lock+0x24/0x40 [ 51.430745] clk_disable+0x20/0x30 [ 51.431189] mtk_iommu_remove+0x58/0x118 [ 51.431705] platform_remove+0x28/0x60 [ 51.432197] device_release_driver_internal+0x110/0x1f0 [ 51.432873] device_driver_detach+0x18/0x28 [ 51.433418] unbind_store+0xd4/0x108 [ 51.433886] drv_attr_store+0x24/0x38 [ 51.434363] sysfs_kf_write+0x40/0x58 [ 51.434843] kernfs_fop_write_iter+0x164/0x1e0 Fixes: b34ea31fe013 ("iommu/mediatek: Always enable the clk on resume") Reported-by: Hsin-Yi Wang Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 3e8f0164d26c..5c24e8e10a73 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -925,7 +925,6 @@ static int mtk_iommu_remove(struct platform_device *pdev) if (iommu_present(&platform_bus_type)) bus_set_iommu(&platform_bus_type, NULL); - clk_disable_unprepare(data->bclk); device_link_remove(data->smicomm_dev, &pdev->dev); pm_runtime_disable(&pdev->dev); devm_free_irq(&pdev->dev, data->irq, data); -- 2.18.0