From patchwork Thu Aug 8 14:11:16 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: 13757559 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 1BDB4C52D6F for ; Thu, 8 Aug 2024 14:14:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=i61g3HqvXtrI0H4Wdt6BZeDZIZP41pUUULE7Fmxi5BU=; b=YKeHJMki+efe5ffDI8t/Re3+29 3H4NrBMcLOObZPqyws71CsYYRsCR7s3gp+z0ixDCitCaRGN4gQ2nQyiq5rs2LcUjmCZptLgwyDDOl vEhli7cko9sVt25HlU9ynDxp8M6TQv/NVPFkeyV/5Fn2sad+LuW75a0D6XiJlRx2c/Dt9ojyHvwqV 8NAndcBL4/sUBFhB+U6FhW/E6ZR57Tg0qH3pJxnXwpxYWtGvqv4AMQEmasY5OcrIWCdGunb9Y43/O 2yA3z4rnQB74nCynX7LO30MPhT85IG5YtO21kcpHJVSGCD4Zo7Br8Pw0ni7ddTd0FG29stQ/4OqZz AjPZPq2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc3u7-00000008Tp7-2Q1l; Thu, 08 Aug 2024 14:14:11 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc3rM-00000008StY-14QC for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2024 14:11:23 +0000 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5bb477e3a6dso992620a12.0 for ; Thu, 08 Aug 2024 07:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723126278; x=1723731078; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=i61g3HqvXtrI0H4Wdt6BZeDZIZP41pUUULE7Fmxi5BU=; b=AScQpozxldEOTiAPoR6uwfNLoP0K6rp8pwG5BZIfyzBddnHNbpdYAQnJhxTI1hF0ca 3bB+4v/ON89nS3yDAL86+/tJj1fu4PGnTizIzCCDEinik1t2ObSOPDF7fTH0XprCOgaO OL1Y4s8SR9xcQmSKOwkgInRNhS0Cblnd211LgB+OH4gdwIs4kKIzg9XwtaDns68Z/wht UOhM5E2XfG51MwloEx/zhtx3/Yhjn2I1MJUfXAzTckH29WEe//p+5HcC/40+3OLlUxj9 AJB5tlbxlCU+wLnU50zCNe93sEV1CC+9z4NPMMYBC8rajKwMHVXeJHCEaOf4lLgFHFNK PyhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723126278; x=1723731078; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i61g3HqvXtrI0H4Wdt6BZeDZIZP41pUUULE7Fmxi5BU=; b=VbTghjfJo8P2Ri9+rHnbFLPC/lywPrNwN517h9xGmX44t3cf8ui4eVaz+KyVuln+8+ l7ZybZcTgqvcYjDpbWBQUxAS/6P+X7NjQDieGs+tTR48ibT29j+URMLVxOz+/wbmmLGd twU9qUIYEcpp/3l/dozmP8t0I/q2H4vDnME9V2oV36KsyGbaDeCjPqL7OoaRqm3enMnA Mib8HRYaowjDFyIaXPTy3iXSvmtlVtNZ2hL8fCGLLBKzhxFuN4NTZ5//1N7GWrAz+ffq EcnzeGM6Rx7l5MuDjdT2PR0cssQ138Z42byVFUQK6D7y2oxuvI0GGZO8hyGaAPuU29o6 yNlw== X-Forwarded-Encrypted: i=1; AJvYcCX1hMwslQemXKosO3306BdmoJqqZ3flUEzMCDRhp5s5L5LKSvjFqSl5UkRaBzBle3aouet+KSVWsg99LMpgPo5blrfw2PTnFAuBJxXFClZGZe7FZn0= X-Gm-Message-State: AOJu0YyKpu1Mo/100tepL44FtajWjIsCk4a1g0Bkc2VnF1TClroYcbT8 KqvLc+lGSiQBBfZ/7qNBp6pvEV+UO2v+wqtFkr1CcnTaZ2pPR2ZxiL4JODebSnc= X-Google-Smtp-Source: AGHT+IEiMhOMDiTpZBQDmYwk/4O0X4rmiXEoHQeeCddSIXSmt9SZ1xmlKbwP23bfJ7piM3Yp2IjSiw== X-Received: by 2002:a05:6402:2354:b0:5b8:34a9:7fd9 with SMTP id 4fb4d7f45d1cf-5bbb23c7b6dmr1889019a12.27.1723126277640; Thu, 08 Aug 2024 07:11:17 -0700 (PDT) Received: from puffmais.c.googlers.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bbb2c29f79sm671761a12.33.2024.08.08.07.11.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 07:11:17 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Thu, 08 Aug 2024 15:11:16 +0100 Subject: [PATCH v5 02/20] clk: samsung: gs101: don't mark non-essential (UART) clocks critical MIME-Version: 1.0 Message-Id: <20240808-gs101-non-essential-clocks-2-v5-2-11cffef0634e@linaro.org> References: <20240808-gs101-non-essential-clocks-2-v5-0-11cffef0634e@linaro.org> In-Reply-To: <20240808-gs101-non-essential-clocks-2-v5-0-11cffef0634e@linaro.org> To: Michael Turquette , Stephen Boyd , Peter Griffin , Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi , Alim Akhtar , Sam Protsenko , Tudor Ambarus , Abel Vesa , Peng Fan , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: Will McVicker , kernel-team@android.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, imx@lists.linux.dev, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_071120_335096_5B54ADF3 X-CRM114-Status: GOOD ( 17.97 ) 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 peric0_top1_ipclk_0 and peric0_top1_pclk_0 are the clocks going to peric0/uart_usi, with pclk being the bus clock. Without pclk running, any bus access will hang. Unfortunately, in commit d97b6c902a40 ("arm64: dts: exynos: gs101: update USI UART to use peric0 clocks") the gs101 DT ended up specifying an incorrect pclk in the respective node and instead the two clocks here were marked as critical. As a side-effect and by accident, having them 'critical' also worked-around a problem where earlycon stops to work sometime into the boot for two reasons: * peric0_top1_ipclk_0 requires its parent gout_cmu_peric0_ip to be running, but because earlycon doesn't deal with clocks that parent will be disabled when none of the other drivers that actually deal with clocks correctly require it to be running and the real serial driver (which does deal with clocks) hasn't taken over yet * hand-over between earlycon and serial driver appears to be fragile and clocks get enabled and disabled a few times, which also causes register access to hang while earlycon is still active (A wordier explanation can also be found in [1]) Since then, the DT has been updated to use the correct clock in commit 21e4e8807bfc ("arm64: dts: exynos: gs101: use correct clocks for usi_uart"). Furthermore, the clk core now helps OF platforms with their stdout (earlycon) clocks during early boot and thereby avoids the problem described above. The driver here can now be corrected and the work-arounds removed. Do so. Link: https://lore.kernel.org/all/d45de3b2bb6b48653842cf1f74e58889ed6783ae.camel@linaro.org/ [1] Fixes: 893f133a040b ("clk: samsung: gs101: add support for cmu_peric0") Signed-off-by: André Draszik Reviewed-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- v5: update commit message v4: - the earlycon issue described in the commit message in previous versions of this patch is gone with "clk: samsung: gs101: allow earlycon to work unconditionally", so no need to mention anything v3: - add git commit SHA1s (Krzysztof) - add link to wordier description of earlycon issue v2: - commit message typo fixed - collect Reviewed-by: tags --- drivers/clk/samsung/clk-gs101.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/clk/samsung/clk-gs101.c b/drivers/clk/samsung/clk-gs101.c index 1759eb23263b..0c963e72e8bd 100644 --- a/drivers/clk/samsung/clk-gs101.c +++ b/drivers/clk/samsung/clk-gs101.c @@ -3947,20 +3947,18 @@ static const struct samsung_gate_clock peric0_gate_clks[] __initconst = { "gout_peric0_peric0_top0_pclk_9", "mout_peric0_bus_user", CLK_CON_GAT_GOUT_BLK_PERIC0_UID_PERIC0_TOP0_IPCLKPORT_PCLK_9, 21, 0, 0), - /* Disabling this clock makes the system hang. Mark the clock as critical. */ GATE(CLK_GOUT_PERIC0_PERIC0_TOP1_IPCLK_0, "gout_peric0_peric0_top1_ipclk_0", "dout_peric0_usi0_uart", CLK_CON_GAT_GOUT_BLK_PERIC0_UID_PERIC0_TOP1_IPCLKPORT_IPCLK_0, - 21, CLK_IS_CRITICAL, 0), + 21, 0, 0), GATE(CLK_GOUT_PERIC0_PERIC0_TOP1_IPCLK_2, "gout_peric0_peric0_top1_ipclk_2", "dout_peric0_usi14_usi", CLK_CON_GAT_GOUT_BLK_PERIC0_UID_PERIC0_TOP1_IPCLKPORT_IPCLK_2, 21, CLK_SET_RATE_PARENT, 0), - /* Disabling this clock makes the system hang. Mark the clock as critical. */ GATE(CLK_GOUT_PERIC0_PERIC0_TOP1_PCLK_0, "gout_peric0_peric0_top1_pclk_0", "mout_peric0_bus_user", CLK_CON_GAT_GOUT_BLK_PERIC0_UID_PERIC0_TOP1_IPCLKPORT_PCLK_0, - 21, CLK_IS_CRITICAL, 0), + 21, 0, 0), GATE(CLK_GOUT_PERIC0_PERIC0_TOP1_PCLK_2, "gout_peric0_peric0_top1_pclk_2", "mout_peric0_bus_user", CLK_CON_GAT_GOUT_BLK_PERIC0_UID_PERIC0_TOP1_IPCLKPORT_PCLK_2,