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 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 785A0C4167B for ; Tue, 11 Jan 2022 10:57:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3672A60D75; Tue, 11 Jan 2022 10:57:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i5k5QN38miXQ; Tue, 11 Jan 2022 10:57:56 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 0D74960773; Tue, 11 Jan 2022 10:57:55 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id EC751C002F; Tue, 11 Jan 2022 10:57:55 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1D27BC002F for ; Tue, 11 Jan 2022 10:57:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id F02C6410E6 for ; Tue, 11 Jan 2022 10:57:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=collabora.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id viYaqPGu7zsS for ; Tue, 11 Jan 2022 10:57:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by smtp4.osuosl.org (Postfix) with ESMTPS id 17822410E5 for ; Tue, 11 Jan 2022 10:57:52 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id 790DD1F43A3B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1641898671; bh=KxdiyTxbtyGUISJQVKvbV00ATKClSLfkB7WwAzdixIk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=GHv2Q9Hw9O1BbymA6bPBFesiEoq1kePtT66PJ1DjL9T0Lyuw7pmEQejYX27zrEz4u KhuGOzv6vfpDCj5CFrlLnkHBLvzkie3LTBvtrB16YGEWmRcK/Bb2hzvlZVkXsnrFML iNuniQCr123u7ZPxvdmcegl9TU+3TZrthSVp7dxcsRMQ/9BZl2LREPItzri5GxaZkm /WHSAxGZI10qwOxlOJSRyKR/BAco+r212N+f+NrpdwlLsuvMd58CuxENW+9OLhpIjG Rd277bNW5X4zdn5WskZtet5CNVidobI8eHXVog2CXJQkuYeC57x3eV1/JA61Xbmop0 jQiPE2Mahk5rQ== Subject: Re: [PATCH v9 05/15] iommu/mediatek: Add device_link between the consumer and the larb devices To: Yong Wu , Matthias Brugger , Joerg Roedel , Rob Herring , Krzysztof Kozlowski , David Airlie , Mauro Carvalho Chehab References: <20211112105509.12010-1-yong.wu@mediatek.com> <20211112105509.12010-6-yong.wu@mediatek.com> From: AngeloGioacchino Del Regno Message-ID: Date: Tue, 11 Jan 2022 11:57:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211112105509.12010-6-yong.wu@mediatek.com> Content-Language: en-US Cc: devicetree@vger.kernel.org, Will Deacon , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, anthony.huang@mediatek.com, youlin.pei@mediatek.com, Evan Green , Eizan Miyamoto , Matthias Kaehlcke , mingyuan.ma@mediatek.com, linux-media@vger.kernel.org, Chun-Kuang Hu , Daniel Vetter , libo.kang@mediatek.com, yi.kuo@mediatek.com, linux-mediatek@lists.infradead.org, Hsin-Yi Wang , Tiffany Lin , linux-arm-kernel@lists.infradead.org, anan.sun@mediatek.com, acourbot@chromium.org, srv_heupstream@mediatek.com, yf.wang@mediatek.com, iommu@lists.linux-foundation.org, Philipp Zabel , Robin Murphy 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" Il 12/11/21 11:54, Yong Wu ha scritto: > MediaTek IOMMU-SMI diagram is like below. all the consumer connect with > smi-larb, then connect with smi-common. > > M4U > | > smi-common > | > ------------- > | | ... > | | > larb1 larb2 > | | > vdec venc > > When the consumer works, it should enable the smi-larb's power which > also need enable the smi-common's power firstly. > > Thus, First of all, use the device link connect the consumer and the > smi-larbs. then add device link between the smi-larb and smi-common. > > This patch adds device_link between the consumer and the larbs. > > When device_link_add, I add the flag DL_FLAG_STATELESS to avoid calling > pm_runtime_xx to keep the original status of clocks. It can avoid two > issues: > 1) Display HW show fastlogo abnormally reported in [1]. At the beggining, > all the clocks are enabled before entering kernel, but the clocks for > display HW(always in larb0) will be gated after clk_enable and clk_disable > called from device_link_add(->pm_runtime_resume) and rpm_idle. The clock > operation happened before display driver probe. At that time, the display > HW will be abnormal. > > 2) A deadlock issue reported in [2]. Use DL_FLAG_STATELESS to skip > pm_runtime_xx to avoid the deadlock. > > Corresponding, DL_FLAG_AUTOREMOVE_CONSUMER can't be added, then > device_link_removed should be added explicitly. > > Meanwhile, Currently we don't have a device connect with 2 larbs at the > same time. Disallow this case, print the error log. > > [1] https://lore.kernel.org/linux-mediatek/1564213888.22908.4.camel@mhfsdcap03/ > [2] https://lore.kernel.org/patchwork/patch/1086569/ > > Suggested-by: Tomasz Figa > Signed-off-by: Yong Wu > Tested-by: Frank Wunderlich # BPI-R2/MT7623 Reviewed-by: AngeloGioacchino Del Regno _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu