Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11533263imu; Tue, 1 Jan 2019 01:15:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/XplV1JjIL/iSq8tz+ethTGoD4r01AQOWndeyJkULpGO9gEqmm3lDQ0TcQVWa6O7Bgh/HSX X-Received: by 2002:a62:e0d8:: with SMTP id d85mr40079317pfm.214.1546334150360; Tue, 01 Jan 2019 01:15:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546334150; cv=none; d=google.com; s=arc-20160816; b=BMoU5Kw7C/HNGh9EWGF8WZMM/FzwZgZQF46T2YSadt+ipvfzVh2dg4MKSIhQZWi+Vu k6ZBCOfk0fWm1lhJXqfn64KdDWP5gCc6qpIpix7gw7QurtUwV5LgwnbOS30fc+w+VsOw QuBNZL5Bz9rFON/PnrUFaAAx2EWxmMhy9ouaYu1gr8QMQXh919xD70okfWN2nryqfzhj 8jCYKehDMX4JoguQFtSs+foAsjNvAfT/ssKjY8K8TvT1mhvbYO2fGIFFYh34Bul7kdjS /0MrvlKHJSqqGki6XNq3mJojf47jf+9w9fom4T3YWGiQGCzy30zHbSaUkvAXJGXaNzXN my1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=ZWImgJ6fyplp0webiYttLG0D2nUhpLQZPuG8GNlE/pE=; b=OzMw48O6RZVfH+OQiyeHclLYcZreosu26Yvxp+KFRbOT+dJ+p/UxUpjRsTaxwBOm1O oSK8HsU59WHj0lfU3WG2J4mW7iQwbmj2iE5m7iTl9jkdKd39GqwXAwMnS1nCP7a82Rvn gpSKbmJlPq0LSMi0Yo1G42dqVYxtPU6izhoP5LrEhVyqplGx2+WwDJQ4mDPTjJB+PSiL rB/hgL5Eu3GIReEEEz1UJsMrZG15o392j92sKY/HPL5UdA2NBOlP1xCwKOWY13dqumPn gV13gX91y4KgbqFzKhhhXKCBDREbxiOr4CQRgOgNkTiUIZUqxDWIZ746B/V/BLTzIspm DdGA== 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 32si29284908plg.29.2019.01.01.01.15.12; Tue, 01 Jan 2019 01:15:50 -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 S1728234AbfAAEvf (ORCPT + 99 others); Mon, 31 Dec 2018 23:51:35 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:51896 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726740AbfAAEve (ORCPT ); Mon, 31 Dec 2018 23:51:34 -0500 X-UUID: 2b92e5bd38144bac8313d87bac1e32d0-20190101 X-UUID: 2b92e5bd38144bac8313d87bac1e32d0-20190101 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1186191890; Tue, 01 Jan 2019 12:51:29 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 1 Jan 2019 12:51:27 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 1 Jan 2019 12:51:26 +0800 From: Yong Wu To: Joerg Roedel , Greg Kroah-Hartman , Matthias Brugger , Rob Herring CC: Robin Murphy , Tomasz Figa , Will Deacon , , , , , , , , , , , Nicolas Boichat Subject: [PATCH 00/13] Clean up "mediatek,larb" after adding device_link Date: Tue, 1 Jan 2019 12:51:03 +0800 Message-ID: <1546318276-18993-1-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 40C8168AB5B51643D5C91BE1842E5E56A0565B3483FA56B61046AC7EDDCA7E762000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org MediaTek IOMMU block diagram always like below: M4U | smi-common | ------------- | | ... | | larb1 larb2 | | vdec venc All the consumer connect with smi-larb, then connect with smi-common. MediaTek IOMMU don't have its power-domain. When the consumer works, it should enable the smi-larb's power which also need enable the smi-common's power firstly. Thus, Firstly, use the device link connect the consumer and the smi-larbs. then add device link between the smi-larb and smi-common. The ref_count of the device_link normally is over 1, when the consumer device driver is removed, we should remove all the device_link, Hence, I add the patch "driver core: xxx" at the beginning of this patchset. After adding the device_link, then "mediatek,larb" property can be removed. the iommu consumer don't need call the mtk_smi_larb_get/put to enable the power and clock of smi-larb and smi-common. This patchset depends on "MT8183 IOMMU SUPPORT"[1]. [1] https://lists.linuxfoundation.org/pipermail/iommu/2019-January/032387.html Yong Wu (13): dt-binding: mediatek: Get rid of mediatek,larb for multimedia HW driver core: Remove the link if there is no driver with AUTO flag iommu/mediatek: Add probe_defer for smi-larb iommu/mediatek: Add device_link between the consumer and the larb devices memory: mtk-smi: Add device-link between smi-larb and smi-common media: mtk-jpeg: Get rid of mtk_smi_larb_get/put media: mtk-mdp: Get rid of mtk_smi_larb_get/put media: mtk-vcodec: Get rid of mtk_smi_larb_get/put drm/mediatek: Get rid of mtk_smi_larb_get/put memory: mtk-smi: Get rid of mtk_smi_larb_get/put iommu/mediatek: Use builtin_platform_driver arm: dts: mediatek: Get rid of mediatek,larb for MM nodes arm64: dts: mediatek: Get rid of mediatek,larb for MM nodes .../bindings/display/mediatek/mediatek,disp.txt | 9 ----- .../bindings/media/mediatek-jpeg-decoder.txt | 4 --- .../devicetree/bindings/media/mediatek-mdp.txt | 8 ----- .../devicetree/bindings/media/mediatek-vcodec.txt | 4 --- arch/arm/boot/dts/mt2701.dtsi | 1 - arch/arm/boot/dts/mt7623.dtsi | 1 - arch/arm64/boot/dts/mediatek/mt8173.dtsi | 15 -------- drivers/base/core.c | 4 +-- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 11 ------ drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 26 -------------- drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 1 - drivers/iommu/mtk_iommu.c | 40 +++++++++------------- drivers/iommu/mtk_iommu_v1.c | 32 ++++++++--------- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 22 ------------ drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 2 -- drivers/media/platform/mtk-mdp/mtk_mdp_comp.c | 38 -------------------- drivers/media/platform/mtk-mdp/mtk_mdp_comp.h | 2 -- drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 1 - .../media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c | 19 ---------- drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h | 3 -- drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 1 - .../media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c | 38 -------------------- drivers/memory/mtk-smi.c | 30 ++++------------ include/soc/mediatek/smi.h | 20 ----------- 24 files changed, 40 insertions(+), 292 deletions(-) -- 1.9.1