Message ID | 20240130093812.1746512-6-andre.draszik@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-44273-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1112892dyb; Tue, 30 Jan 2024 02:07:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGvNRBE8UWdbWO2E+lUwZ8EX/6dJPtxfe7+bHE4iRp1iAwXcVH21tpQEDZAhIenxYbYds4+ X-Received: by 2002:a17:902:e5cd:b0:1d8:b0bf:3e4a with SMTP id u13-20020a170902e5cd00b001d8b0bf3e4amr4669670plf.47.1706609244502; Tue, 30 Jan 2024 02:07:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706609244; cv=pass; d=google.com; s=arc-20160816; b=saQUMLK/T8FzDcb/Q1gGboPi8CTXFlL84fUuNlmkbN2vV5oS/2dsLiZGln+dBKVCC8 yiuVm+RhbyYLN9k5guZI8tJzQgfTSnb2Sfk9uNp/cP4vT+wO4pUvAv5A7UKQQuU+pqsc jswFmDL50rXfAnTLX/i+bnQvzKIfACpZK1hot0FVeJt6ONeJAkSJwQli8rKRxYZ613L8 +BlcJZImckLVmWcuQFUhk0RrA4fYM/mI7ssuCCTGo5XW8SSUGodu9HvkNnHFTNiAciP5 We8/Lyi1HyrW9mlgS2gXC6AXaCUpYrioX4lx2/zDXaZoxpbmhFwnSpuL6Zv9HCYMiw+/ LMgQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=KZk2SdLQMZocjryQ3lzHBmDN2CyWaX4eaN62+3uup3Y=; fh=ZGadyDwCU5WVzEodYWwk1qgDGMzZjqeJjHUADzctJAI=; b=CdqIsIkyca+zrQ2wmqUxULScXkHonl/h+IjhUd8OyC6AVJXHN4olQY0vh5IOk0C+ni DEFeG/S7h4IF+dctcJ6XRsdialkX2OE9LjA3EohdN3EdeEXoOLBGYpYhe+h6ghhvNvzE m5e/iMgcbMxbHEEjtK+GlAGBmjxif71EKMRT2q8npgFKMptq2eLlVVgHrEWTLXZOUtWR 8ouDYIBq7fGOY9ArrLIYfNai9mEALzkaGTb6c3HX2O13ssAL4NrLUQFs7lOaDzVREnL9 WHPbM6UeecGa28ODDDBO77rIKxDYSvr/69S16cCG92SEA7G8LmQTlr0Y/bjMunCC6vQn FlGg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SSCKTKop; 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-44273-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44273-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d22-20020a170902aa9600b001d755ec8c90si6914107plr.525.2024.01.30.02.07.24 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 02:07:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44273-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SSCKTKop; 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-44273-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44273-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 685FBB282BD for <ouuuleilei@gmail.com>; Tue, 30 Jan 2024 09:40:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F7DC67759; Tue, 30 Jan 2024 09:38:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SSCKTKop" Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (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 58D4D605D5 for <linux-kernel@vger.kernel.org>; Tue, 30 Jan 2024 09:38:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706607513; cv=none; b=Yz02UBt5u9w+jzezJ88ffnkbBLkEoeTZ1noQFiHODHnobdYDpcoTLm13+Ulm42OxXLKnaVrHH7K5ByPxwO9AFWUDwfF3t+zsjcodfoTXYLCKk4T3/ubAJN3hK2df1wUoBZUa0QljqVz/GxBpv45ChJx+7xSMeZPsCp+BxwgGyrs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706607513; c=relaxed/simple; bh=VJi9wt2ttIi50NSnSzxGbUiXLYP3vcXYzxcUWXWEWGA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZFZzqPcjBAgb87CvHWM15kSMC+b7Yojiwx53zNl63xX1WJ822WAyMWX9uACOXHMoP/XDm69lf4cjq2W1NwmKllXVYxvPKR0LDPs4v+sIa0579sCM7hZ0WDst3MMpdsqyRe+Azl/tNIzITcnqDiGgLvHm2esALWIQ/bXuuVfz0CU= 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=SSCKTKop; arc=none smtp.client-ip=209.85.208.48 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-f48.google.com with SMTP id 4fb4d7f45d1cf-55ef4a66008so2613434a12.3 for <linux-kernel@vger.kernel.org>; Tue, 30 Jan 2024 01:38:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706607509; x=1707212309; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KZk2SdLQMZocjryQ3lzHBmDN2CyWaX4eaN62+3uup3Y=; b=SSCKTKopuZ18CYIq93LhFIiBAMqz0BBXBG28J/LdpZFxtrIMnA/O+UQhuHWgZ6D4da fLtgerbXj9lgxBVghvDhfqFHW5UkciHTkTTSSpT/u/cSmyek9Vn3FLoN2CCuXnNk28tI VXovOUeAIQCXMwCWg/obeSZDinPhQrntIZLezcXuDauy5zE2hTkvPPbLACAuapSVoqCa k1HmF3cru9EXF35+d32DAF/kRdNfMa1Y2hNQWRMohpWkX6f5scQZkHvWU6qt0N9YR/vT spc9IiK7oMCgluMG1QHLMcjVi6jjOwnZ8iB5AbosLfFDYkrqoOKUGFKzcsglJ4RKkv46 jSWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706607509; x=1707212309; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KZk2SdLQMZocjryQ3lzHBmDN2CyWaX4eaN62+3uup3Y=; b=qumy+tajC75FcHstw5BK/OP3jNhQKV3UfsH6dLO5GJdCHvYM3OlBJ71I/T+MkE8Gpf pUGn3Ufh1oVUAsk7yphsVy2eBpvz1UAikBYpsnaS6FMwr2eZ3m7FzGAJBW1wDp76ogmX WO3zYWdyOTAPQObAPTxwdL9huuSTy5Bs8Z7/skQjWfUF1/5KYjjWu4s0ETPEF8AWzrFn xjRCXbcc6yeSSXSssJttcAKVJWXhP9YGXPqAFLsSQKSzpaXO6w3DFpkiiE6ebYTMJx0i t8NNCQWAOeIMi6qdxmWnBQWLxuv7eU1gLsSFCZVcsrlHnXH5I8pwtF4GXb4atzFjsMrG aC0g== X-Gm-Message-State: AOJu0YyTp58ld4THXe2S25KnWxZ33ZiZGtjQvxb8F6PsVpgICIFMfgho CaUtPrabSBTdz2pDd02zfhDyWM+3X9sP7l4IItFnRsHYgVZcczZ2eRRRP7tRATc= X-Received: by 2002:a05:6402:79a:b0:55f:2aa0:caf1 with SMTP id d26-20020a056402079a00b0055f2aa0caf1mr2164556edy.17.1706607509358; Tue, 30 Jan 2024 01:38:29 -0800 (PST) Received: from puffmais.c.googlers.com.com (94.189.141.34.bc.googleusercontent.com. [34.141.189.94]) by smtp.gmail.com with ESMTPSA id q10-20020aa7cc0a000000b0055ef56f4575sm2281225edt.39.2024.01.30.01.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 01:38:29 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= <andre.draszik@linaro.org> To: peter.griffin@linaro.org, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, tudor.ambarus@linaro.org, willmcvicker@google.com, semen.protsenko@linaro.org, alim.akhtar@samsung.com, s.nawrocki@samsung.com, tomasz.figa@gmail.com, cw00.choi@samsung.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, =?utf-8?q?Andr=C3=A9?= =?utf-8?q?_Draszik?= <andre.draszik@linaro.org> Subject: [PATCH v2 5/6] clk: samsung: gs101: don't mark non-essential clocks as critical Date: Tue, 30 Jan 2024 09:36:44 +0000 Message-ID: <20240130093812.1746512-6-andre.draszik@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240130093812.1746512-1-andre.draszik@linaro.org> References: <20240130093812.1746512-1-andre.draszik@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789509494804738414 X-GMAIL-MSGID: 1789509494804738414 |
Series |
gs101 oriole: peripheral block 0 (peric0) fixes
|
|
Commit Message
André Draszik
Jan. 30, 2024, 9:36 a.m. UTC
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. We have fixed the gs101 DT and can therefore drop this incorrect work-around here, the uart driver will claim these clocks as needed. Note that this commit has the side-effect of causing earlycon to stop 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 Nonetheless we shouldn't keep these clocks running unconditionally just for earlycon. Clocks should be disabled where possible. If earlycon is required in the future, e.g. for debug, this commit can simply be reverted (locally!). Fixes: 893f133a040b ("clk: samsung: gs101: add support for cmu_peric0") Signed-off-by: André Draszik <andre.draszik@linaro.org> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> --- v2: * collect Reviewed-by: tags --- drivers/clk/samsung/clk-gs101.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Comments
On 30/01/2024 10:36, André Draszik wrote: > 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. > > We have fixed the gs101 DT and can therefore drop this incorrect > work-around here, the uart driver will claim these clocks as needed. How did you fixed the DTS? Which commit did it? Are we going back to basics of driver changes depending on DTS? Best regards, Krzysztof
Hi Krzysztof, On Thu, 2024-02-01 at 11:02 +0100, Krzysztof Kozlowski wrote: > On 30/01/2024 10:36, André Draszik wrote: > > 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. > > > > We have fixed the gs101 DT and can therefore drop this incorrect > > work-around here, the uart driver will claim these clocks as needed. > > How did you fixed the DTS? Which commit did it? Are we going back to > basics of driver changes depending on DTS? Sorry if the description isn't clear. a) these clocks are not critical for the system to work, and this patch fixes that. b) the initial DTSI for gs101 used incorrect clocks for the serial, and it didn't work. The work-around was to specify these clocks here as critical instead. Patch #4 in this series has corrected the DTSI. So there is no dependency between the DTS update and the driver update here as such, no new properties, or otherwise. That said, now that b) above has been fixed (in patch #4), it is OK to mark these clocks as non-critical without any ill effects. That's all that is happening. I was merely referencing that in the commit message. I can rephrase things if you wish. Cheers, Andre'
diff --git a/drivers/clk/samsung/clk-gs101.c b/drivers/clk/samsung/clk-gs101.c index 61bb0dcf84ee..5c338ac9231c 100644 --- a/drivers/clk/samsung/clk-gs101.c +++ b/drivers/clk/samsung/clk-gs101.c @@ -2982,20 +2982,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, 0, 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,