From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64EA6C433E1 for ; Fri, 7 Aug 2020 02:14:56 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3934F2177B for ; Fri, 7 Aug 2020 02:14:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="c5FOfhM3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3934F2177B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CF918886E1; Fri, 7 Aug 2020 02:14:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RZaM9SGY-J6t; Fri, 7 Aug 2020 02:14:54 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 2A023886D1; Fri, 7 Aug 2020 02:14:54 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 057D3C0051; Fri, 7 Aug 2020 02:14:54 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8C0CAC004C for ; Fri, 7 Aug 2020 02:14:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7EFF32538B for ; Fri, 7 Aug 2020 02:14:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FfYZjI+P-Sbb for ; Fri, 7 Aug 2020 02:14:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mailgw02.mediatek.com (unknown [1.203.163.81]) by silver.osuosl.org (Postfix) with ESMTP id 8E92B25281 for ; Fri, 7 Aug 2020 02:14:50 +0000 (UTC) X-UUID: ae261989d0a84694b73d2c8c8dba076f-20200807 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=JxLw+a2yeVjmglZikNxU8lr4nwwrSEYeYUL+KumKsqM=; b=c5FOfhM3iSiu7+xP15b3XDvMWwrLlwtsPmxaHuWGhHoYIBNpLdWiYZJGvrfdK7jufM6otqkjqxA5FBbkLi+uAgsDYoMhfIPLdZwQwGc4nR78riPRRhBuVnYDK3Bbv/cI9bV7NAMueuIRJJUtPLzD1LV5vHtvpwLSZMPWlKchP70=; X-UUID: ae261989d0a84694b73d2c8c8dba076f-20200807 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 2043936039; Fri, 07 Aug 2020 10:14:44 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 Aug 2020 10:14:39 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 7 Aug 2020 10:14:41 +0800 Message-ID: <1596766438.18559.4.camel@mhfsdcap03> Subject: Re: [PATCH 11/21] iommu/mediatek: Add power-domain operation From: Yong Wu To: chao hao Date: Fri, 7 Aug 2020 10:13:58 +0800 In-Reply-To: <1595839778.2350.4.camel@mbjsdccf07> References: <20200711064846.16007-1-yong.wu@mediatek.com> <20200711064846.16007-12-yong.wu@mediatek.com> <1595839778.2350.4.camel@mbjsdccf07> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 1FA9D0F3014E9C59CFEAA84127CB84AF86104ADCF9CE47405B4B97E5C86E5DE82000:8 X-MTK: N Cc: youlin.pei@mediatek.com, devicetree@vger.kernel.org, Nicolas Boichat , cui.zhang@mediatek.com, srv_heupstream@mediatek.com, Robin Murphy , linux-kernel@vger.kernel.org, Evan Green , Tomasz Figa , iommu@lists.linux-foundation.org, Rob Herring , linux-mediatek@lists.infradead.org, Matthias Brugger , chao hao <"Chao. Hao"@mediatek.com>, ming-fan.chen@mediatek.com, anan.sun@mediatek.com, Will Deacon , linux-arm-kernel@lists.infradead.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Mon, 2020-07-27 at 16:49 +0800, chao hao wrote: > On Sat, 2020-07-11 at 14:48 +0800, Yong Wu wrote: > > In the previous SoC, the M4U HW is in the EMI power domain which is > > always on. the latest M4U is in the display power domain which may be > > turned on/off, thus we have to add pm_runtime interface for it. > > > > we should enable its power before M4U hw initial. and disable it after HW > > initialize. > > > > When the engine work, the engine always enable the power and clocks for > > smi-larb/smi-common, then the M4U's power will always be powered on > > automatically via the device link with smi-common. > > > > Note: we don't enable the M4U power in iommu_map/unmap for tlb flush. > > If its power already is on, of course it is ok. if the power is off, > > the main tlb will be reset while M4U power on, thus the tlb flush while > > m4u power off is unnecessary, just skip it. > > > > Signed-off-by: Yong Wu ... > > > > if (data->plat_data->m4u_plat == M4U_MT8173) { > > @@ -728,7 +756,15 @@ static int mtk_iommu_probe(struct platform_device *pdev) > > > > platform_set_drvdata(pdev, data); > > > > + if (dev->pm_domain) > > + pm_runtime_enable(dev); > > hi yong, > > If you put "pm_runtime_enable" here, it maybe not device_link with > smi_common for previous patch: > if(i || !pm_runtime_enabled(dev)) > continue; > > Whether put it up front? Thanks for review. My fault here. I will fix it. > > best regards, > chao _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23BD8C433DF for ; Fri, 7 Aug 2020 02:15:13 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E6E07221E4 for ; Fri, 7 Aug 2020 02:15:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="1ZOT7pnI"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="l+RBTv0D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6E07221E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Date:To:From: Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hlYXDxB7hnosfe470YXc8GcxBEjX3UeYA1KK+qq4vUM=; b=1ZOT7pnI7M3nvRPVOnuv1w4iX V6VRY7s1rgX9EGdsIEa+chCLwxiJNA7U2Kqk0AaIQMXKHCm4JovWdrxCRZaeCS1Ub1SXt7dKOQmoO urU6on89pWu3HCkOwNBTWzNADQ1Bpnw9dw6wZYW8kxormdnfoltrXy6LTm0kQlUEoj4f7auhWG7yN sxEVFIWZN4KzkaOaL+JhrkQusSgjj7qfcFVlV8nKCW7PFLAXCZatpjkzeo0HiLgTC3UEGAEZ7Y8Bi ZBqAMYcbIHA/YVg1ACEUwBoTVDlSOK6/nKIjKYMqgfyzGdeJE9L4G7k5YXKIUKGQq/n9XJLws4CcJ sMEPatqaA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3ruP-0006mo-Ag; Fri, 07 Aug 2020 02:15:01 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3ruL-0006lM-O7; Fri, 07 Aug 2020 02:14:59 +0000 X-UUID: 670f058df33a4e22aae4c82da28ba5d3-20200806 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=JxLw+a2yeVjmglZikNxU8lr4nwwrSEYeYUL+KumKsqM=; b=l+RBTv0DOOwABLyn0zkSWQ6GJ8dp+dHQh7jy9o88huP1ezHtZpswiLi4IS6t4vysNZ3WnZKAvzeNm7F802Tn6tFz46iVrVweOsEmPLJoiGwUNaSjp3nP/tDKZjsI5aWJLvV3pUwt8nCMcYo6yO6JDhwUjkc3ieKHgRLZceEKWfA=; X-UUID: 670f058df33a4e22aae4c82da28ba5d3-20200806 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1862859217; Thu, 06 Aug 2020 18:14:47 -0800 Received: from MTKMBS31DR.mediatek.inc (172.27.6.102) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 6 Aug 2020 19:14:46 -0700 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 Aug 2020 10:14:39 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 7 Aug 2020 10:14:41 +0800 Message-ID: <1596766438.18559.4.camel@mhfsdcap03> Subject: Re: [PATCH 11/21] iommu/mediatek: Add power-domain operation From: Yong Wu To: chao hao Date: Fri, 7 Aug 2020 10:13:58 +0800 In-Reply-To: <1595839778.2350.4.camel@mbjsdccf07> References: <20200711064846.16007-1-yong.wu@mediatek.com> <20200711064846.16007-12-yong.wu@mediatek.com> <1595839778.2350.4.camel@mbjsdccf07> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 1FA9D0F3014E9C59CFEAA84127CB84AF86104ADCF9CE47405B4B97E5C86E5DE82000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200806_221457_918594_5404F3D5 X-CRM114-Status: GOOD ( 19.60 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: youlin.pei@mediatek.com, devicetree@vger.kernel.org, Nicolas Boichat , cui.zhang@mediatek.com, srv_heupstream@mediatek.com, Robin Murphy , Joerg Roedel , linux-kernel@vger.kernel.org, Evan Green , Tomasz Figa , iommu@lists.linux-foundation.org, Rob Herring , linux-mediatek@lists.infradead.org, Matthias Brugger , chao hao <"Chao. Hao"@mediatek.com>, ming-fan.chen@mediatek.com, anan.sun@mediatek.com, Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Mon, 2020-07-27 at 16:49 +0800, chao hao wrote: > On Sat, 2020-07-11 at 14:48 +0800, Yong Wu wrote: > > In the previous SoC, the M4U HW is in the EMI power domain which is > > always on. the latest M4U is in the display power domain which may be > > turned on/off, thus we have to add pm_runtime interface for it. > > > > we should enable its power before M4U hw initial. and disable it after HW > > initialize. > > > > When the engine work, the engine always enable the power and clocks for > > smi-larb/smi-common, then the M4U's power will always be powered on > > automatically via the device link with smi-common. > > > > Note: we don't enable the M4U power in iommu_map/unmap for tlb flush. > > If its power already is on, of course it is ok. if the power is off, > > the main tlb will be reset while M4U power on, thus the tlb flush while > > m4u power off is unnecessary, just skip it. > > > > Signed-off-by: Yong Wu ... > > > > if (data->plat_data->m4u_plat == M4U_MT8173) { > > @@ -728,7 +756,15 @@ static int mtk_iommu_probe(struct platform_device *pdev) > > > > platform_set_drvdata(pdev, data); > > > > + if (dev->pm_domain) > > + pm_runtime_enable(dev); > > hi yong, > > If you put "pm_runtime_enable" here, it maybe not device_link with > smi_common for previous patch: > if(i || !pm_runtime_enabled(dev)) > continue; > > Whether put it up front? Thanks for review. My fault here. I will fix it. > > best regards, > chao _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69729C433DF for ; Fri, 7 Aug 2020 02:16:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 414FD20855 for ; Fri, 7 Aug 2020 02:16:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZTyMinr9"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="l+RBTv0D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 414FD20855 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Date:To:From: Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Q9rO6/CLX+rat9fv6A+HX5ZZvGUzK39358XOUukzBXA=; b=ZTyMinr93YQ0HulXlfIZEdBhG Fr+INfPDzJmdFEfdnu4hl7vIIM/ZLdy9zAB6K2htBQCKxSFI2PaxSHp+SIMutJzuze8SJt1gxI4JS WPFY1/8KOYjenVpZtGJgReVhtiK5K4Tqk55VtAkB50GsMMQ246pCEIBMbdQX79rUw/wA+v2MW5Lnu +oz/M4kd2AqtRW2kJeWf0C8eNXcVInfHD6X1YFgxTO7qqeMyeBvOzNWgrXWu3WtEcv/iN3FqHbgF1 XhbpCN9uKdQCkLF+40rRc8hxln05W15h9pjLRPnxTm6miWSJzIpH8g43orX7EK/5WIf/2KjlgxiXR kCoUNMNhA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3ruQ-0006mx-R6; Fri, 07 Aug 2020 02:15:02 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3ruL-0006lM-O7; Fri, 07 Aug 2020 02:14:59 +0000 X-UUID: 670f058df33a4e22aae4c82da28ba5d3-20200806 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=JxLw+a2yeVjmglZikNxU8lr4nwwrSEYeYUL+KumKsqM=; b=l+RBTv0DOOwABLyn0zkSWQ6GJ8dp+dHQh7jy9o88huP1ezHtZpswiLi4IS6t4vysNZ3WnZKAvzeNm7F802Tn6tFz46iVrVweOsEmPLJoiGwUNaSjp3nP/tDKZjsI5aWJLvV3pUwt8nCMcYo6yO6JDhwUjkc3ieKHgRLZceEKWfA=; X-UUID: 670f058df33a4e22aae4c82da28ba5d3-20200806 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1862859217; Thu, 06 Aug 2020 18:14:47 -0800 Received: from MTKMBS31DR.mediatek.inc (172.27.6.102) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 6 Aug 2020 19:14:46 -0700 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 Aug 2020 10:14:39 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 7 Aug 2020 10:14:41 +0800 Message-ID: <1596766438.18559.4.camel@mhfsdcap03> Subject: Re: [PATCH 11/21] iommu/mediatek: Add power-domain operation From: Yong Wu To: chao hao Date: Fri, 7 Aug 2020 10:13:58 +0800 In-Reply-To: <1595839778.2350.4.camel@mbjsdccf07> References: <20200711064846.16007-1-yong.wu@mediatek.com> <20200711064846.16007-12-yong.wu@mediatek.com> <1595839778.2350.4.camel@mbjsdccf07> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 1FA9D0F3014E9C59CFEAA84127CB84AF86104ADCF9CE47405B4B97E5C86E5DE82000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200806_221457_918594_5404F3D5 X-CRM114-Status: GOOD ( 19.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: youlin.pei@mediatek.com, devicetree@vger.kernel.org, Nicolas Boichat , cui.zhang@mediatek.com, srv_heupstream@mediatek.com, Robin Murphy , Joerg Roedel , linux-kernel@vger.kernel.org, Evan Green , Tomasz Figa , iommu@lists.linux-foundation.org, Rob Herring , linux-mediatek@lists.infradead.org, Matthias Brugger , chao hao <"Chao. Hao"@mediatek.com>, ming-fan.chen@mediatek.com, anan.sun@mediatek.com, Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 2020-07-27 at 16:49 +0800, chao hao wrote: > On Sat, 2020-07-11 at 14:48 +0800, Yong Wu wrote: > > In the previous SoC, the M4U HW is in the EMI power domain which is > > always on. the latest M4U is in the display power domain which may be > > turned on/off, thus we have to add pm_runtime interface for it. > > > > we should enable its power before M4U hw initial. and disable it after HW > > initialize. > > > > When the engine work, the engine always enable the power and clocks for > > smi-larb/smi-common, then the M4U's power will always be powered on > > automatically via the device link with smi-common. > > > > Note: we don't enable the M4U power in iommu_map/unmap for tlb flush. > > If its power already is on, of course it is ok. if the power is off, > > the main tlb will be reset while M4U power on, thus the tlb flush while > > m4u power off is unnecessary, just skip it. > > > > Signed-off-by: Yong Wu ... > > > > if (data->plat_data->m4u_plat == M4U_MT8173) { > > @@ -728,7 +756,15 @@ static int mtk_iommu_probe(struct platform_device *pdev) > > > > platform_set_drvdata(pdev, data); > > > > + if (dev->pm_domain) > > + pm_runtime_enable(dev); > > hi yong, > > If you put "pm_runtime_enable" here, it maybe not device_link with > smi_common for previous patch: > if(i || !pm_runtime_enabled(dev)) > continue; > > Whether put it up front? Thanks for review. My fault here. I will fix it. > > best regards, > chao _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AD12C433E0 for ; Fri, 7 Aug 2020 02:14:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 26DE822CF7 for ; Fri, 7 Aug 2020 02:14:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="c5FOfhM3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726126AbgHGCOw (ORCPT ); Thu, 6 Aug 2020 22:14:52 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:43331 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726027AbgHGCOw (ORCPT ); Thu, 6 Aug 2020 22:14:52 -0400 X-UUID: ae261989d0a84694b73d2c8c8dba076f-20200807 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=JxLw+a2yeVjmglZikNxU8lr4nwwrSEYeYUL+KumKsqM=; b=c5FOfhM3iSiu7+xP15b3XDvMWwrLlwtsPmxaHuWGhHoYIBNpLdWiYZJGvrfdK7jufM6otqkjqxA5FBbkLi+uAgsDYoMhfIPLdZwQwGc4nR78riPRRhBuVnYDK3Bbv/cI9bV7NAMueuIRJJUtPLzD1LV5vHtvpwLSZMPWlKchP70=; X-UUID: ae261989d0a84694b73d2c8c8dba076f-20200807 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 2043936039; Fri, 07 Aug 2020 10:14:44 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 Aug 2020 10:14:39 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 7 Aug 2020 10:14:41 +0800 Message-ID: <1596766438.18559.4.camel@mhfsdcap03> Subject: Re: [PATCH 11/21] iommu/mediatek: Add power-domain operation From: Yong Wu To: chao hao CC: Joerg Roedel , Matthias Brugger , Rob Herring , Robin Murphy , Will Deacon , Evan Green , Tomasz Figa , , , , , , , , Nicolas Boichat , , , , chao hao <"Chao. Hao"@mediatek.com> Date: Fri, 7 Aug 2020 10:13:58 +0800 In-Reply-To: <1595839778.2350.4.camel@mbjsdccf07> References: <20200711064846.16007-1-yong.wu@mediatek.com> <20200711064846.16007-12-yong.wu@mediatek.com> <1595839778.2350.4.camel@mbjsdccf07> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 1FA9D0F3014E9C59CFEAA84127CB84AF86104ADCF9CE47405B4B97E5C86E5DE82000:8 X-MTK: N Content-Transfer-Encoding: base64 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org T24gTW9uLCAyMDIwLTA3LTI3IGF0IDE2OjQ5ICswODAwLCBjaGFvIGhhbyB3cm90ZToNCj4gT24g U2F0LCAyMDIwLTA3LTExIGF0IDE0OjQ4ICswODAwLCBZb25nIFd1IHdyb3RlOg0KPiA+IEluIHRo ZSBwcmV2aW91cyBTb0MsIHRoZSBNNFUgSFcgaXMgaW4gdGhlIEVNSSBwb3dlciBkb21haW4gd2hp Y2ggaXMNCj4gPiBhbHdheXMgb24uIHRoZSBsYXRlc3QgTTRVIGlzIGluIHRoZSBkaXNwbGF5IHBv d2VyIGRvbWFpbiB3aGljaCBtYXkgYmUNCj4gPiB0dXJuZWQgb24vb2ZmLCB0aHVzIHdlIGhhdmUg dG8gYWRkIHBtX3J1bnRpbWUgaW50ZXJmYWNlIGZvciBpdC4NCj4gPiANCj4gPiB3ZSBzaG91bGQg ZW5hYmxlIGl0cyBwb3dlciBiZWZvcmUgTTRVIGh3IGluaXRpYWwuIGFuZCBkaXNhYmxlIGl0IGFm dGVyIEhXDQo+ID4gaW5pdGlhbGl6ZS4NCj4gPiANCj4gPiBXaGVuIHRoZSBlbmdpbmUgd29yaywg dGhlIGVuZ2luZSBhbHdheXMgZW5hYmxlIHRoZSBwb3dlciBhbmQgY2xvY2tzIGZvcg0KPiA+IHNt aS1sYXJiL3NtaS1jb21tb24sIHRoZW4gdGhlIE00VSdzIHBvd2VyIHdpbGwgYWx3YXlzIGJlIHBv d2VyZWQgb24NCj4gPiBhdXRvbWF0aWNhbGx5IHZpYSB0aGUgZGV2aWNlIGxpbmsgd2l0aCBzbWkt Y29tbW9uLg0KPiA+IA0KPiA+IE5vdGU6IHdlIGRvbid0IGVuYWJsZSB0aGUgTTRVIHBvd2VyIGlu IGlvbW11X21hcC91bm1hcCBmb3IgdGxiIGZsdXNoLg0KPiA+IElmIGl0cyBwb3dlciBhbHJlYWR5 IGlzIG9uLCBvZiBjb3Vyc2UgaXQgaXMgb2suIGlmIHRoZSBwb3dlciBpcyBvZmYsDQo+ID4gdGhl IG1haW4gdGxiIHdpbGwgYmUgcmVzZXQgd2hpbGUgTTRVIHBvd2VyIG9uLCB0aHVzIHRoZSB0bGIg Zmx1c2ggd2hpbGUNCj4gPiBtNHUgcG93ZXIgb2ZmIGlzIHVubmVjZXNzYXJ5LCBqdXN0IHNraXAg aXQuDQo+ID4gDQo+ID4gU2lnbmVkLW9mZi1ieTogWW9uZyBXdSA8eW9uZy53dUBtZWRpYXRlay5j b20+DQoNCi4uLg0KDQo+ID4gIA0KPiA+ICAJaWYgKGRhdGEtPnBsYXRfZGF0YS0+bTR1X3BsYXQg PT0gTTRVX01UODE3Mykgew0KPiA+IEBAIC03MjgsNyArNzU2LDE1IEBAIHN0YXRpYyBpbnQgbXRr X2lvbW11X3Byb2JlKHN0cnVjdCBwbGF0Zm9ybV9kZXZpY2UgKnBkZXYpDQo+ID4gIA0KPiA+ICAJ cGxhdGZvcm1fc2V0X2RydmRhdGEocGRldiwgZGF0YSk7DQo+ID4gIA0KPiA+ICsJaWYgKGRldi0+ cG1fZG9tYWluKQ0KPiA+ICsJCXBtX3J1bnRpbWVfZW5hYmxlKGRldik7DQo+IA0KPiBoaSB5b25n LA0KPiANCj4gSWYgeW91IHB1dCAicG1fcnVudGltZV9lbmFibGUiIGhlcmUsIGl0IG1heWJlIG5v dCBkZXZpY2VfbGluayB3aXRoDQo+IHNtaV9jb21tb24gZm9yIHByZXZpb3VzIHBhdGNoOiANCj4g aWYoaSB8fCAhcG1fcnVudGltZV9lbmFibGVkKGRldikpDQo+ICAgICBjb250aW51ZTsNCj4gDQo+ IFdoZXRoZXIgcHV0IGl0IHVwIGZyb250Pw0KDQpUaGFua3MgZm9yIHJldmlldy4gTXkgZmF1bHQg aGVyZS4gSSB3aWxsIGZpeCBpdC4NCg0KPiANCj4gYmVzdCByZWdhcmRzLA0KPiBjaGFvDQoNCg==