Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1906978lqa; Tue, 30 Apr 2024 02:55:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVqDljKtOLvMIeHsGHbfXeXbZlfhQYpGtxA0mO0O/7MsLWUbbQ0PDoWZmpWRobJ/TUDimZ50hfF/MNcnxBH4pDtBTjGVkKloi9l8NCsfw== X-Google-Smtp-Source: AGHT+IHvdnWRIw5dZR4VDedOxBpZ67lxpBoNc4HLT4N9K3k/fIed5FhO9yZpQNTCe1QFwg8PYyeh X-Received: by 2002:a05:6a00:2d21:b0:6ea:c3bc:2031 with SMTP id fa33-20020a056a002d2100b006eac3bc2031mr15684638pfb.7.1714470939706; Tue, 30 Apr 2024 02:55:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714470939; cv=pass; d=google.com; s=arc-20160816; b=Sp7K0D7KfiVDYGtmTMuDzR6Xvok0Jet9zfQuseOU7RtHpCzrB7sxErqRFKI/ZgvVK+ 4gAu195/vt37LHqZD0HCNfIa1R/cbEshODkN3+nNOqZJUo81RvUJ2GNHV5raIWcTtV3b g0GSJMzNAFZcwsUNX+nt1/yWxjdD2gZ86bxmr+i3/KoL4B3hOhN6viB607lx6xmnHB9U HbbOg8GGlTZwkYOymc8hCBgCjOXA2njxmT746CkSUwfyQrwHCvB8qOEihULraZvbjsCP BeEmC6xGLPma/+CxRRGmgx1/WAzNL2/3LIQI1LJ/JNGk6RKYzpRu+UsNEp3L0y9PSx0E fEUQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=LIvR9hyWtdM+/jljJrdEtSyYzizLCNd2LjUpy5o2Iys=; fh=LLfXzSbxpDcKsLzSZveVhv4uoAZHAXehNe7VD8/Mpoo=; b=Flj2eL1HszAaqb5KmEJ7VGU/eVQD2FEXNjRYfFzELBxVplXiQZ30FpcakHRCTTjatA liOK/kAz6J5AC55PNHgi3Tk3c1IRYeMFwfcr/yh0x9sLa/ppkbQ3a5bE+EWS3DzlOqv3 uqmP8ZOfItIuR6SKToAvEmRnQ62eZeqXFtvffwnrPvlsl3MIUj2BmYOfsuAIczQTo1Z6 I8GIi3r21zCA/9SnS8E4KNtczFA94LxK5/wwkXZo/pFBXirV2kpaMq77rjyd8k0QyYYM DixlwSR8rniGBCE81eju1UpKd2KIBULV4tfHo+OzMmvNPEPgmEjpe30baPCGzokSdjMW dVxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tcWq37AR; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-163727-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163727-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h6-20020a056a00170600b006e69fdb9967si22075608pfc.3.2024.04.30.02.55.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 02:55:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163727-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tcWq37AR; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-163727-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163727-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2652E2844F1 for ; Tue, 30 Apr 2024 09:55:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC2DF1292C7; Tue, 30 Apr 2024 09:55:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="tcWq37AR" Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EBB9128389 for ; Tue, 30 Apr 2024 09:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714470930; cv=none; b=o5shSMYbW7vPCe4O2pbSwytIhx5QvZLHJPD2i0lvvctTpbTHg0/IfZXL7PJ7MQjrBI4Y30ka2TAWzoD7UKU/nx2ByQfKwk5oRfCiqmbArVYP5Nt1djf8QE8WmhpCg75yrFn0Cu1i2L+47YstVinqeWffmA9QohCiM2ZHR+tNK4s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714470930; c=relaxed/simple; bh=9lx880lfiI6yD9a/xUAVu/CVpco3Im6UqhcEbDnVlws=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=hhZuL5d7V5lfEQTfZctEDqiGYs6xLQEsev49vEtZsMVdTlh1J9V7TPVKtFsMo9apbSpWTDcOL8dicoX3+XhJHiwVlWHihG9BdXw8gZ8uMLihxGu3hYLRAtxX6fdOsg63/gyUGt9USHz6K3dzXGD4kqZKGyUhWT92pWcm7l6IHoY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=tcWq37AR; arc=none smtp.client-ip=209.85.208.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-57230faeb81so3258303a12.0 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=vger.kernel.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=tcWq37AR5sEPtXyHr5JvSUWy/b6Hb4/AaSTbbtPXkbxfSYBIcZMuWMmqm9gHr0g8rT m5LeXpCTm2g0Zm2LiwFCLuLhNTkBIMI0Xtsyqm33kH/srXa6FDnGkzKUyIabzZyT+r2T m2qlsYQRLiwW6xz0z11zn98F2VbVsL6c7EOiNbOW6kxwnf7oxtmril8BT2oEkwiOQpIU ZCw/9j5FC9IBTINk2Hr1NtDuDiOGFf5D1mXly4nVZ+OUtbK2H4wrGuY450oQphJ/3OD5 yVm23NXmXg1yrlrm0b98yh7a927OsYzwkrDU7mfvBLwY8yB2x530tYbzKAKymBZ7B5HU uHKw== 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=glzM/nCRnlhfVdD6rbbPieXOtJrmVMhKK1JUWM9rvIgLOZw+kklYJg5cXLYElitHf1 QSSrfdiMuGLca+a+7dQgiSkmuABcoLayrjeqfbs1lxv9v9daNFLwrOB1llPPDHhg0alX AnqjqVqhXGXIafn2bfFhDuu528mNNQBjP3LqB4Ph1NuHvO3+/33zcrZhh/zmNqw3PbPm CUtjwGSDNUuv/5bZxCrnTzgC061vPkyeNJYfsQ8rTnFH3u4ZD0KSLcaWJiiR9/Cl3Yua ubM0NTQX12lVyHOtgoLIbAaEukzi/XChKyHdFMtylfN/NBUOGZ4YT8z8UxQPGSgSyUDT /ijA== X-Forwarded-Encrypted: i=1; AJvYcCVfAvMdNocUyb7iy0qyesYi0oqTw52fynbRPyFDbLy4Edj0gXOBH22habk8LV8DP5RCb7RWHww5Yv4ffe8tgDu8O3jTa+yqvn0ZLtIX X-Gm-Message-State: AOJu0YxfIKVlcUJxf6KapeofwwJ2RjdF0f5pEFm2coEYP1CXRQHNv0jU PzTMMrC/IECI9tmbusjS/4V1HRhJK2i43gOgt5v1Yz5JgkMm0CNtPqejyYbbHLA= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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 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 --- drivers/clk/samsung/clk-gs101.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 = { --- base-commit: d04466706db5e241ee026f17b5f920e50dee26b5 change-id: 20240430-gs101-apm-clocks-fb0918ceaecb Best regards, -- André Draszik