From patchwork Tue Apr 30 09:54:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13648654 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 90864C4345F for ; Tue, 30 Apr 2024 09:55:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id:MIME-Version:Subject: Date:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+Qbv9ZVakYsACHYIrZt+HzNG2635usEfkp4owHbV81U=; b=pSCAoNamQrKRzX RmMZ5UCecSRMvbxw7fCjY4cGUzJzp9fImbbQSDklkKLXbRn0vnmnQLqRa9W7aZAJZ6pNx4fYsExZh mRh8hYul4/bgHMDkkGBDgYWbfRpxiUdYjI+ad5XNdFMFtlpoRLXDEb5Z2cOUPFFWzxNh8/zAibdml 4Ha1otiPFvRUHJ7IrCXNjKMfw7AMH0zeRk/Vya702s55h8clclQHhJ9Kkh1M7qc8dkpgMn7tp1hsz NCufb9gkQ8WXsSMyTVE/wJcDhOtJUbVsn4FdokqADdFN0ak29YFoID4Ol/r4c2OTKrALdo5q54iEg PChHDX9NPscHDyzFRBOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1kCy-00000005v78-3fl9; Tue, 30 Apr 2024 09:55:33 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1kCv-00000005v6O-32lq for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 09:55:31 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a51f9ad7684so375456366b.2 for ; Tue, 30 Apr 2024 02:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714470928; x=1715075728; darn=lists.infradead.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=LIvR9hyWtdM+/jljJrdEtSyYzizLCNd2LjUpy5o2Iys=; b=V5/bEly4NgHr70kMxYUHycSdINzMnYfUWhlKjfo/4Zbz0WF9FezJ4kIpiCAblFjOv0 /bsrvSioK1dNw6fdC5q83JfOUxRHVbGvC9SpSUMinukbSRn05Yo8Vf6ACmfzZz9qfWJe jEPQgBKiVZ2+FpaOUFP7vkA9TDLDfpQPCmvXMySxMxZKKnsb2GlXr9zXjxLWSPdgCFcb HcEw0edxtB6zL9gnCFJYXnCttszKsHgx5Lrao1b+C2bQZ4d6fJBykTKnwmj1cQMvJZzd 38Tcv055UM93KiU+3Kv2NFJPuTDVT1d927PH3FK0vEeGLCphMx1Etz4Rm+imSPfNWGe+ efpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714470928; x=1715075728; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LIvR9hyWtdM+/jljJrdEtSyYzizLCNd2LjUpy5o2Iys=; b=rn78lJHLL4ldVGLNHMLvRE7+hkkey9VHJvr6NUvhl3rfKkia/AO09ifh0R1O79hGM9 2m7sXiXNLZ5Q63TTq9shAZ40Jpw98kjaWbXK2WG+x4SkXbZvaeXC6VMHYhhGBKpn2CB0 I3zMEyptBNdm018VghsQNHSecX/M4HLVG/UeHiyXZM+fn0WZBRLJ7mjEUGvwzi/RGMG7 PepI2WwSqonBNsRn7E9YuDGoU0rZ4JjBIhGRAr3yooPwCcs1HbK7H/22F0PLZ7XLDYUX pidg4veMWP/v06+IJ9DW7WE8561NKM6drNYquCQlU2oleKD5XRRAXfi9BJp+xFe252yK NW3w== X-Gm-Message-State: AOJu0YyqSmHef53diKIn2kL93jvjndWwNjC/c6t66JzsbpIncUVIjLId CA6HfaIJPQwfZGp3noDc3f23Xib68YzZA42w1Vz/AlHpPIF+xwBqc7w4j6vcm7Q= X-Google-Smtp-Source: AGHT+IE6fV0iB/xgSECdLEU1cMbMP4tHIStnA0sSkf5GyCXZmTRa+hHGM14tL6YsA5PHe09Defti1A== X-Received: by 2002:a50:cdd2:0:b0:568:abe3:52b2 with SMTP id h18-20020a50cdd2000000b00568abe352b2mr12260940edj.23.1714470927657; Tue, 30 Apr 2024 02:55:27 -0700 (PDT) Received: from puffmais.c.googlers.com (8.239.204.35.bc.googleusercontent.com. [35.204.239.8]) by smtp.gmail.com with ESMTPSA id dq16-20020a170907735000b00a524318c380sm14886833ejc.80.2024.04.30.02.55.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 02:55:27 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Tue, 30 Apr 2024 10:54:59 +0100 Subject: [PATCH] clk: samsung: gs101: mark some apm UASC and XIU clocks critical MIME-Version: 1.0 Message-Id: <20240430-gs101-apm-clocks-v1-1-b2e2335e84f5@linaro.org> X-B4-Tracking: v=1; b=H4sIAPK/MGYC/x3MPQqAMAxA4atIZgOpOqhXEYc2Rg3+0oAI4t0tj t/w3gMmUcWgzR6IcqnpsSe4PAOe/T4J6pAMBRUVVSXhZI4c+nNDXg9eDMdAjatZvHCAlJ1RRr3 /Zde/7weAuo/yYgAAAA== To: Peter Griffin , Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi , Alim Akhtar , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Tudor Ambarus , Will McVicker , kernel-team@android.com, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_025529_795778_15B56E39 X-CRM114-Status: GOOD ( 17.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The system hangs when any of these clocks are turned off. With the introduction of pinctrl clock support [1], the approach taken in this clock driver for the APM clocks to rely solely on the clk_ignore_unused kernel command line option does not work anymore and the system hangs during boot. gout_apm_func is a parent clock to the clocks that are going to be handled by the pinctrl driver [2], namely gout_apm_apbif_gpio_alive_pclk and gout_apm_apbif_gpio_far_alive_pclk. It also is the parent to the clocks marked as critical in this commit here (and some others that aren't relevant for this commit)). This means that once the pinctrl driver decides to turn off clocks, the clock framework will subsequently turn off parent clocks of those pinctrl clocks if they have no (apparent) user. Since gout_apm_func is the parent, and since no drivers are hooked up to it or any of its other children, gout_apm_func will be turned off. This will cause the system to hang, as the clocks marked as critical in this commit stop having an input. We might have to add a driver for these clocks, but in the meantime let's just ensure they stay on even if siblings are turned off. For the avoidance of doubt: This commit doesn't mean that we can boot with clk_ignore_unused. Link: https://lore.kernel.org/r/20240426-samsung-pinctrl-busclock-v3-0-adb8664b8a7e@linaro.org [1] Link: https://lore.kernel.org/r/20240429-samsung-pinctrl-busclock-dts-v1-0-5e935179f3ca@linaro.org [2] Signed-off-by: André Draszik Reviewed-by: Tudor Ambarus --- drivers/clk/samsung/clk-gs101.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- base-commit: d04466706db5e241ee026f17b5f920e50dee26b5 change-id: 20240430-gs101-apm-clocks-fb0918ceaecb Best regards, diff --git a/drivers/clk/samsung/clk-gs101.c b/drivers/clk/samsung/clk-gs101.c index 05129c3b2f68..e2a6a1992505 100644 --- a/drivers/clk/samsung/clk-gs101.c +++ b/drivers/clk/samsung/clk-gs101.c @@ -1896,16 +1896,16 @@ static const struct samsung_gate_clock apm_gate_clks[] __initconst = { CLK_CON_GAT_GOUT_BLK_APM_UID_UASC_G_SWD_IPCLKPORT_PCLK, 21, 0, 0), GATE(CLK_GOUT_APM_UASC_P_APM_ACLK, "gout_apm_uasc_p_apm_aclk", "gout_apm_func", - CLK_CON_GAT_GOUT_BLK_APM_UID_UASC_P_APM_IPCLKPORT_ACLK, 21, 0, 0), + CLK_CON_GAT_GOUT_BLK_APM_UID_UASC_P_APM_IPCLKPORT_ACLK, 21, CLK_IS_CRITICAL, 0), GATE(CLK_GOUT_APM_UASC_P_APM_PCLK, "gout_apm_uasc_p_apm_pclk", "gout_apm_func", - CLK_CON_GAT_GOUT_BLK_APM_UID_UASC_P_APM_IPCLKPORT_PCLK, 21, 0, 0), + CLK_CON_GAT_GOUT_BLK_APM_UID_UASC_P_APM_IPCLKPORT_PCLK, 21, CLK_IS_CRITICAL, 0), GATE(CLK_GOUT_APM_WDT_APM_PCLK, "gout_apm_wdt_apm_pclk", "gout_apm_func", CLK_CON_GAT_GOUT_BLK_APM_UID_WDT_APM_IPCLKPORT_PCLK, 21, 0, 0), GATE(CLK_GOUT_APM_XIU_DP_APM_ACLK, "gout_apm_xiu_dp_apm_aclk", "gout_apm_func", - CLK_CON_GAT_GOUT_BLK_APM_UID_XIU_DP_APM_IPCLKPORT_ACLK, 21, 0, 0), + CLK_CON_GAT_GOUT_BLK_APM_UID_XIU_DP_APM_IPCLKPORT_ACLK, 21, CLK_IS_CRITICAL, 0), }; static const struct samsung_cmu_info apm_cmu_info __initconst = {