Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp327770rdb; Thu, 5 Oct 2023 07:12:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHhDcnVRU2yBsFgmI7/Q9pKifIiNwwgYENdx1lmQaaQKKR6IbzQ1GffxGEjg+D2+bB63rGY X-Received: by 2002:a05:6a20:938b:b0:157:d7cd:ebd with SMTP id x11-20020a056a20938b00b00157d7cd0ebdmr5983640pzh.1.1696515120010; Thu, 05 Oct 2023 07:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696515119; cv=none; d=google.com; s=arc-20160816; b=NdwBiGTzq1qXCPbh6mk82xdkXGdU7NtDDH6kOL7vfloZPJQj0Z8QhTTlEhvYp/eXM7 ++QG8WuTOx3GwUBwTDAerFvUCR3w9qXQiy7OiqWMitE/fHxRt3i8t4vA76Cjmob0+4UZ aNN3Yfrn21cp/X23uourNGaCIrwJJxqImTG+WezEvgBB0Uy83UU+eLUVay7kHORmqgXK S7ka9t5MeL7X0SGkPymwdzv0wTeHXmD86p8w2s76azwRCMrBhocScoYr3aQFUz+2S1Af U5wM0XXMYLPcTxAut430fyMcu2cfy65f7Ng3rnMStT+CTsLk3SzNIrROSAWv2QpIpy5l bmdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=8C3S6R9ODJnwBBdyVLXFCJVkErEGsewqv+RWdlFmuu4=; fh=3OVyu0ukW0svaw9n3mIKZsZLUlacehyuMb555VPGsgQ=; b=h0U81+DeJyp4zs8o+4O4qXz8PcVNEXIqD+13DfJPErGrwbN27pjMnJW+zRRMmpwGEV QpW9Mrd5MLelxCvJ1GTwykDQx6vi4BIlxeyGdng5ynnupwEm/gbC/RZvPoA191LpAxsI mOYkQWoDnU/zwVtffUeHkGmt84PKflahLSxL0H5Fd1Lkv7OGOrl6X4N5qoGq3/wIPV+V 9qhZhHgCffJ6771gLy7BsLLcdXZk2d27OKfl+uFKC95Z0SUka+4KNI4xdRg3l5qUO89n GC+DridzrzVpZubPOKNh47lM/mfUbNllisMfQhAI/9oTFq+0V3JL36tzbHOaYxEC+Mq7 9GOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=TYXCAJR3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id a185-20020a6390c2000000b00578d08489a8si1481207pge.832.2023.10.05.07.11.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 07:11:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=TYXCAJR3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 8CF10807C5D2; Thu, 5 Oct 2023 07:10:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232918AbjJEOJY (ORCPT + 99 others); Thu, 5 Oct 2023 10:09:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229801AbjJEOHM (ORCPT ); Thu, 5 Oct 2023 10:07:12 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9201920E63; Thu, 5 Oct 2023 03:30:53 -0700 (PDT) Received: from eugen-station.. (unknown [109.166.134.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ehristev) by madras.collabora.co.uk (Postfix) with ESMTPSA id 788FC660731C; Thu, 5 Oct 2023 11:30:50 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1696501852; bh=2Mi1NddfuW/82kOV74BmtTvxR7wGV2+vD7ZiTomFj3s=; h=From:To:Cc:Subject:Date:From; b=TYXCAJR3AyXvczf81GZZtUgcV0C/ci0C7wgmO9FMs7Gjn8hm4FJZcHkKfPWq5B2/R 0raXWsQBPpZibqTaBiINosn+XBaEv+lD5tWNBipMh7siQFrpu5gkQGDeMmInNBVj1s C70YnVETbXUGBirnVTRsUdjhsJKJLm/9L4lEebtwsRgSCoAhuKLHI6Qnm9MuEjFA6Y VlB3MnFk93N8sZ0UUp/p7zY+NVw/2qJfnQaeJOjgCV0p9U1OyHs9P+0wabbA3N3Ejh Wha03VdiaaWFvebCBu1UHqqraJHt3BaH1uhUTN3ouVQ138KIo5Ako8OJ+o53Nqbk/6 ElNOcA1Pyn1cg== From: Eugen Hristev To: matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com Cc: allen-kh.cheng@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Eugen Hristev Subject: [PATCH] arm64: dts: mediatek: mt8186: fix clock names for power domains Date: Thu, 5 Oct 2023 13:30:41 +0300 Message-Id: <20231005103041.352478-1-eugen.hristev@collabora.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 05 Oct 2023 07:10:11 -0700 (PDT) Clocks for each power domain are split into big categories: pd clocks and subsys clocks. According to the binding, all clocks which have a dash '-' in their name are treated as subsys clocks, and must be placed at the end of the list. The other clocks which are pd clocks must come first. Fixed the naming and the placing of all clocks in the power domains. For the avoidance of doubt, prefixed all subsys clocks with the 'subsys' prefix. The binding does not enforce strict clock names, the driver uses them in bulk, only making a difference for pd clocks vs subsys clocks. The above problem appears to be trivial, however, it leads to incorrect power up and power down sequence of the power domains, because some clocks will be mistakenly taken for subsys clocks and viceversa. One consequence is the fact that if the DIS power domain goes power down and power back up during the boot process, when it comes back up, there are still transactions left on the bus which makes the display inoperable. Some of the clocks for the DIS power domain were wrongly using '_' instead of '-', which again made these clocks being treated as pd clocks instead of subsys clocks. Fixes: d9e43c1e7a38 ("arm64: dts: mt8186: Add power domains controller") Signed-off-by: Eugen Hristev --- arch/arm64/boot/dts/mediatek/mt8186.dtsi | 42 +++++++++++++++--------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt8186.dtsi b/arch/arm64/boot/dts/mediatek/mt8186.dtsi index af6f6687de35..7121d4312bee 100644 --- a/arch/arm64/boot/dts/mediatek/mt8186.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8186.dtsi @@ -924,7 +924,8 @@ power-domain@MT8186_POWER_DOMAIN_CSIRX_TOP { reg = ; clocks = <&topckgen CLK_TOP_SENINF>, <&topckgen CLK_TOP_SENINF1>; - clock-names = "csirx_top0", "csirx_top1"; + clock-names = "subsys-csirx-top0", + "subsys-csirx-top1"; #power-domain-cells = <0>; }; @@ -942,7 +943,8 @@ power-domain@MT8186_POWER_DOMAIN_ADSP_AO { reg = ; clocks = <&topckgen CLK_TOP_AUDIODSP>, <&topckgen CLK_TOP_ADSP_BUS>; - clock-names = "audioadsp", "adsp_bus"; + clock-names = "audioadsp", + "subsys-adsp-bus"; #address-cells = <1>; #size-cells = <0>; #power-domain-cells = <1>; @@ -975,8 +977,11 @@ power-domain@MT8186_POWER_DOMAIN_DIS { <&mmsys CLK_MM_SMI_COMMON>, <&mmsys CLK_MM_SMI_GALS>, <&mmsys CLK_MM_SMI_IOMMU>; - clock-names = "disp", "mdp", "smi_infra", "smi_common", - "smi_gals", "smi_iommu"; + clock-names = "disp", "mdp", + "subsys-smi-infra", + "subsys-smi-common", + "subsys-smi-gals", + "subsys-smi-iommu"; mediatek,infracfg = <&infracfg_ao>; #address-cells = <1>; #size-cells = <0>; @@ -993,15 +998,17 @@ power-domain@MT8186_POWER_DOMAIN_VDEC { power-domain@MT8186_POWER_DOMAIN_CAM { reg = ; - clocks = <&topckgen CLK_TOP_CAM>, - <&topckgen CLK_TOP_SENINF>, + clocks = <&topckgen CLK_TOP_SENINF>, <&topckgen CLK_TOP_SENINF1>, <&topckgen CLK_TOP_SENINF2>, <&topckgen CLK_TOP_SENINF3>, + <&camsys CLK_CAM2MM_GALS>, <&topckgen CLK_TOP_CAMTM>, - <&camsys CLK_CAM2MM_GALS>; - clock-names = "cam-top", "cam0", "cam1", "cam2", - "cam3", "cam-tm", "gals"; + <&topckgen CLK_TOP_CAM>; + clock-names = "cam0", "cam1", "cam2", + "cam3", "gals", + "subsys-cam-tm", + "subsys-cam-top"; mediatek,infracfg = <&infracfg_ao>; #address-cells = <1>; #size-cells = <0>; @@ -1020,9 +1027,9 @@ power-domain@MT8186_POWER_DOMAIN_CAM_RAWA { power-domain@MT8186_POWER_DOMAIN_IMG { reg = ; - clocks = <&topckgen CLK_TOP_IMG1>, - <&imgsys1 CLK_IMG1_GALS_IMG1>; - clock-names = "img-top", "gals"; + clocks = <&imgsys1 CLK_IMG1_GALS_IMG1>, + <&topckgen CLK_TOP_IMG1>; + clock-names = "gals", "subsys-img-top"; mediatek,infracfg = <&infracfg_ao>; #address-cells = <1>; #size-cells = <0>; @@ -1041,8 +1048,11 @@ power-domain@MT8186_POWER_DOMAIN_IPE { <&ipesys CLK_IPE_LARB20>, <&ipesys CLK_IPE_SMI_SUBCOM>, <&ipesys CLK_IPE_GALS_IPE>; - clock-names = "ipe-top", "ipe-larb0", "ipe-larb1", - "ipe-smi", "ipe-gals"; + clock-names = "subsys-ipe-top", + "subsys-ipe-larb0", + "subsys-ipe-larb1", + "subsys-ipe-smi", + "subsys-ipe-gals"; mediatek,infracfg = <&infracfg_ao>; #power-domain-cells = <0>; }; @@ -1061,7 +1071,9 @@ power-domain@MT8186_POWER_DOMAIN_WPE { clocks = <&topckgen CLK_TOP_WPE>, <&wpesys CLK_WPE_SMI_LARB8_CK_EN>, <&wpesys CLK_WPE_SMI_LARB8_PCLK_EN>; - clock-names = "wpe0", "larb-ck", "larb-pclk"; + clock-names = "wpe0", + "subsys-larb-ck", + "subsys-larb-pclk"; mediatek,infracfg = <&infracfg_ao>; #power-domain-cells = <0>; }; -- 2.34.1