Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp443145rdb; Wed, 17 Jan 2024 06:51:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsW4jOOTZot53zf7FgyXRBcv0HBDRM8JzdLYFL9b2KuWnXa3CM3n1teppwY3o5ISYB0gCb X-Received: by 2002:a05:6402:3551:b0:559:d229:372f with SMTP id f17-20020a056402355100b00559d229372fmr572325edd.92.1705503108771; Wed, 17 Jan 2024 06:51:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705503108; cv=pass; d=google.com; s=arc-20160816; b=iF6C1sH7M/JYQRqJbvsIdMj/w+jd/fTsLCKsFcb+jFOHQoTmyqdKYMQUalmccHBCsn hwz8kXugJG0hyAH8C2uIBc/xQs5oy9vyOWXiqnGjkE8ADIpPSVLjN5Gxy5+aHyphMLHJ qTbpMiI0LdNqNlUxKer8abDeFuWYYYmG1mlwsZthGjMC/KyZDTLWtv+Xnr6ulumX8LP1 yelBymT8QtSybg4VkOIniW0e2L7j+W5PD166hE9oJphx/YPUNajS4t1j5Dr5buQMBkAi P3OKRfhkNHtiK83FbTo+2jWCKevtRq9TWKPJlbsxF2pum6BLXrAYbwDvCY0GBj8vc3Kk EZWA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=wUp7AtgEUSYNvZ7/fVy0kILGk6FxXL69i5KUD1q97UU=; fh=J+NkDdm0N3ZKQP+3G3x2ygZD23aPspRa7XB5tfaokdw=; b=fTkUu+c2oXFbvWbqGvhtnD9imTouOzYQra7UakH+Ib9kDBOWHnpLztnkDbI86vjxa4 i/HHuHZFku/XgogLhinHoaboEoYmiFsoGUgr7DdOARk5COQI2VNmbh6LjD1x+S5FJpWX UqiCT3DhDeEkcJbPHDlt3Vf1AGnTHohXyVjPJYWX7BD0F+4Odfyv8zy+XQUk3W134OOA qCsrPenvvb5g4mZIRGl8rEvSC5z+xvmSzz9aRnSj/xszAx3P2qIS/1Ev0ywordBSjHX9 pzUNqJOxoRd/WI6zy6OK/0cd4pGA/DjmHNOrWHG+1T5m7JMZVUnN68ROhYt1gBkaOi2h tjVw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KD7tYHP+; 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-29104-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29104-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h2-20020a50cdc2000000b00559b160f67csi1575823edj.557.2024.01.17.06.51.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 06:51:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29104-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KD7tYHP+; 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-29104-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29104-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5CD651F24A31 for ; Wed, 17 Jan 2024 14:51:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B5D222615; Wed, 17 Jan 2024 14:49:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KD7tYHP+" Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 DEE3F225A1 for ; Wed, 17 Jan 2024 14:49:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705502954; cv=none; b=W0KyTpklE8u5SKNrvgU/zciwA6YoPakPiCQUB/LlEpulrpXbRkwg3rNMsezsr02yGe0iDmwMiNkQzE4e+DS6o4rjmsGhqROnbUzRpuAIwfZHvcdLuhTLN5MAT2+VXxTmMAr5RCNN+FQM4aC/QrPLXlZP574QaeTvEwHs3MK/Gs4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705502954; c=relaxed/simple; bh=xbOsZ7hNf9ivXDXTjA3fkk2LMk4yyJfbnqb4EOp2G0o=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:Content-Language: To:Cc:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; b=OsOdZQKM0Mb/2Sv38OLJnSEUR+6xzos/viNpv0U6RclWUrO+bFnUNoI81vdQPDRbG0v6NaN+resJ7L1BvtVkk9w1c61+h62F0VWpWnR5Hg8++tjnJxyp+oeva6q/Uhb67LZbl/xT2+ieSQN/7HVbyWqOHZ+wEVfFQPJtgjSw6Ek= 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=KD7tYHP+; arc=none smtp.client-ip=209.85.218.50 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-ej1-f50.google.com with SMTP id a640c23a62f3a-a28cc85e6b5so1324638266b.1 for ; Wed, 17 Jan 2024 06:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705502950; x=1706107750; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=wUp7AtgEUSYNvZ7/fVy0kILGk6FxXL69i5KUD1q97UU=; b=KD7tYHP+aNzQhO/v8Gv6InoamNLudK4Bu9cxQ+vn/k3HfVqP/E1JNP+iskw4JLgUtU Co1rI5XiV6gNnExMeB3S2NqqJ/ZGsCrmbtCxpO4it+pxJbC96bxLyhxN8FB9NmKGbZO2 o3yP/aCKX4K4TDq51T7lYwzi3c6QrTr43py2Zz9DwA2h3IwdT1jRKgdH4H4IYs8NpIlO znZ8Dym8DyCwWfUE7qg/KfyLxSODbs+xdiefQnfnRbxLfTM6XuDeY/9V4GkXKoN2xoKV mg/F1IK1wLQjhFeWj8mD/Z/oPl2Wn/OAA32IDY3SIh80GqnWE5R0FgB0Wdyy067xwPkW aFfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705502950; x=1706107750; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wUp7AtgEUSYNvZ7/fVy0kILGk6FxXL69i5KUD1q97UU=; b=tavn2Iy0rB/lpJCftq3ko1gQCI2AA4PO0DGodVJHIx8IWhLRlGj6aM+tCbtNQ7G288 0EpGx0ZgJKENVITePnI4B0gL+awZ8wcK0i86H+tDva1slhJxy6mAp9KtvS48t5yJDrpG yYZNpHkZbGruPd5OBA+KT9jl6gmUlOuex3wKQXxJ4CIocmEDPUIjhmQ9Okir0O16+/Hk gg5hJUWtiMdlh1/9D+TquXcCzuwm4J2IppCtSflyfeRIoQy4mMILN2+baufdkxSltZ0Y 7Avp27baLYfcTL9dUq4iFVUWngTJpLPs8BEktv87uDveXi8c1fVv5hLxJsSVoEPe7CNS TgCg== X-Gm-Message-State: AOJu0Yxvej7Zvmzm6UFfT1/wvuVY0TDCmgCib8/1Qa/5QiHBtjdvV0xS vED0i8PajZ05jsLUCwUAhd0mchQG0gTA+A== X-Received: by 2002:a17:907:7215:b0:a2c:cf7a:b70b with SMTP id dr21-20020a170907721500b00a2ccf7ab70bmr3242363ejc.145.1705502950157; Wed, 17 Jan 2024 06:49:10 -0800 (PST) Received: from [192.168.2.107] ([79.115.63.202]) by smtp.gmail.com with ESMTPSA id o10-20020a170906288a00b00a2a632e4eebsm7758780ejd.119.2024.01.17.06.49.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jan 2024 06:49:09 -0800 (PST) Message-ID: Date: Wed, 17 Jan 2024 14:49:07 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 07/12] clk: samsung: gs101: add support for cmu_peric0 Content-Language: en-US To: Sam Protsenko Cc: peter.griffin@linaro.org, krzysztof.kozlowski+dt@linaro.org, gregkh@linuxfoundation.org, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, conor+dt@kernel.org, andi.shyti@kernel.org, alim.akhtar@samsung.com, jirislaby@kernel.org, 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, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-serial@vger.kernel.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com References: <20240109125814.3691033-1-tudor.ambarus@linaro.org> <20240109125814.3691033-8-tudor.ambarus@linaro.org> From: Tudor Ambarus In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, Sam, Thanks for reviewing the series! On 1/16/24 17:42, Sam Protsenko wrote: cut >> Few clocks are marked as critical because when either of them is >> disabled, the system hangs even if their clock parents are enabled. >> >> Reviewed-by: Peter Griffin >> Signed-off-by: Tudor Ambarus >> --- cut >> >> diff --git a/drivers/clk/samsung/clk-gs101.c b/drivers/clk/samsung/clk-gs101.c >> index 782993951fff..f3f0f5feb28d 100644 >> --- a/drivers/clk/samsung/clk-gs101.c >> +++ b/drivers/clk/samsung/clk-gs101.c cut >> +static const struct samsung_gate_clock peric0_gate_clks[] __initconst = { >> + /* Disabling this clock makes the system hang. Mark the clock as critical. */ >> + GATE(CLK_GOUT_PERIC0_PERIC0_CMU_PERIC0_PCLK, >> + "gout_peric0_peric0_cmu_peric0_pclk", "mout_peric0_bus_user", >> + CLK_CON_GAT_CLK_BLK_PERIC0_UID_PERIC0_CMU_PERIC0_IPCLKPORT_PCLK, >> + 21, CLK_IS_CRITICAL, 0), > Why not just CLK_IGNORE_UNUSED? As I understand this gate clock can be When either of the clocks that I marked as critical is disabled, the system hangs, even if their clock parent is enabled. I tested this by enabling the clock debugfs with write permissions. I prepared-enabled the parent clock to increase their user count so that when the child gets disabled to not disable the parent as well. When disabling the child the system hung, even if its parent was enabled. Thus I considered that the child is critical. I mentioned this in the commit message as well. Please tell if get this wrong. > used to disable PCLK (bus clock) provided to the whole CMU_PERIC0. > Aren't there any valid cases for disabling this clock, like during > some PM transitions? For Exynos850 clock driver I marked all clocks of They aren't, because if one switches off any of these clocks that are marked as critical, the system hangs and it will not be able to resume. > this kind as CLK_IGNORE_UNUSED and it works fine. In other words: I'd > say CLK_IS_CRITICAL flag is more "strong" than CLK_IGNORE_UNUSED, and > requires better and more specific explanation, to make sure we are not > abusing it. And I'm not sure this is the case. Is the explanation from the commit message enough? > > The same goes for the rest of clocks marked as CLK_IS_CRITICAL in this > patch. Please check if maybe using CLK_IGNORE_UNUSED makes sense for > any of those as well. I've already checked and all behave as described above. Thanks, ta