Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp265452rdb; Tue, 19 Dec 2023 16:34:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGUbWNf7gHcjq2hSZySzpLFiaCYc0rXsa5IlOWr8Q1NfE8pzYzhznn5xi6IZoEWx0mDSJXQ X-Received: by 2002:a05:6a20:7f8a:b0:190:8e40:6f2a with SMTP id d10-20020a056a207f8a00b001908e406f2amr2048976pzj.44.1703032455383; Tue, 19 Dec 2023 16:34:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703032455; cv=none; d=google.com; s=arc-20160816; b=RdSGDhO5oYtMXOD78t8c1zRZYU8FENHqHg6Fyy2cjTXDYkPmRodBC/U3fL4o+aHbB/ 1K3KUBCzNwsiznngJ/S3YMR5kBvbqIvvIJOyLaGKuSxxqxpgLVsyQZjAbqwwLtYFtWu9 urG1hGOOZ00kZMvfk2k7OmvmnCl/GyCF2Vya/JdF1upcoaMZ67dyXUf8QKb+lI8lQrgC NyBA0fED3H6RcN4WUgtEcL7SH+kw9KgQuW797fzAh4reefQVShJExsj/h2aCWEDJpSL4 VCbeLRs+9jvf5feOapT9Zz1p93mIdXo4TZYOJWtolkBlXfFlEYEkteJpfufzyK2qvmsx JEsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=XlDUepmJECDPJhuprnqUu3VqOzP0g1ylAOO9+Ec40Fc=; fh=M4SmwWZ/7iHrjhlTFT5OMF7TTciupAxAdgRVURl8aUM=; b=qGzuPGrpl5mgM+TAk+MzSlk2PsFBofFM+tonF2jFaeCjT9Xenji4auVA0KW3t0tjGd 4BHXhQ/19qnI7sQBvvEwuyZBzEnXKcYI6nBedbbjlizK1pycJcSAPuieKEm7llHPll0F 4Y53snB4Tt/J/gULiWsmtWYyLaYdtw471ovexOLz2G1y/1+QkX6KEYKf0yHB8ZAhOU+u 4BTfiiCaJk+vIq7BR4uRbLpXjTVx2vTeXUZfiDzO1DLa9CTThUp1gSr4KlDVz6axRP4C IRYdF+/6WWt+lYoS8W9xzj7bxAI29W3adbJoWbZrjxMPYTWNwxB8kfFHjZkI3ilMNhH7 S8xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yf1GFAWI; spf=pass (google.com: domain of linux-kernel+bounces-6175-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6175-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i24-20020a63e458000000b005cdcf8f52b8si197942pgk.414.2023.12.19.16.34.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 16:34:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6175-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yf1GFAWI; spf=pass (google.com: domain of linux-kernel+bounces-6175-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6175-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AA63AB24527 for ; Wed, 20 Dec 2023 00:32:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F056CFC07; Wed, 20 Dec 2023 00:31:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yf1GFAWI" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 5FB39AD50 for ; Wed, 20 Dec 2023 00:31:04 +0000 (UTC) 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-f42.google.com with SMTP id 4fb4d7f45d1cf-5537114380bso2434583a12.3 for ; Tue, 19 Dec 2023 16:31:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703032262; x=1703637062; darn=vger.kernel.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=XlDUepmJECDPJhuprnqUu3VqOzP0g1ylAOO9+Ec40Fc=; b=yf1GFAWIYWWfv3GfbD/FlRWVIBtciW4Ivp4yRHqDmy4CYiampwhdNv9MLN191fvQaj AUpjTX/bVH8O16ibI1xGnQ9nZl+D9JQNtYToaSuGSCMtxlaIOjhzerBL/JPSbDVnUsjP tPYJVLMnengHVtI2OvTEiz/wK/DNey7SVFvJpYNi+QLYQ5gcw75C9OLUs78VYMZl2Vrc 5D/TAN6NCeug5KkpQbK7vnFtctzdFlUSn/gzFVRh0jMKeeedl+s/v0wIvckVh9m5PoOm K66+Lx8NcS4NaxOrb84iv9qksqDHX8FQyHHHpNaG65pddMeF0HlXYf8MBbkEbZ5w3el7 g0qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703032262; x=1703637062; 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=XlDUepmJECDPJhuprnqUu3VqOzP0g1ylAOO9+Ec40Fc=; b=NmM2hqzf/1y1YYGUzZXNRh3Rkzr/WhBdBGQOfjB8X0pU9xEzVmLiUNbiRSvWFvSLZt D9t/hNKWZFDFaVrcIiwGNS67quAf4kcB46v9xSIZsJSz9Wl2c/Fqdn+KA4z9zHTMaqc+ H41Vm9x9FhsFPIM5khT16TxrVeklKop7QxarFgxI3ClqE8VXgxcJE2CG/gWUOgh8kOvB /UWAQIZeTB0fx8SXRx9fm9uDbzjWZsNPpIme7Bepr9lD8p2c9zJw45gcE2sHHIUaHAan s5dooafBVZKHKEHiMjwD4d2DIZFWbFvJ269qNYwZOBFJJvbWh3qOXt6aR1GhTMBNlD5R +8Dg== X-Gm-Message-State: AOJu0YxEvtgdn5qaurVJpdMwZSWu4EEMu42FDAL3Q9Qv4yNhsC3I/d8u I18SAnaMCDSZMJTGGcnyWq7leA== X-Received: by 2002:a50:cd85:0:b0:553:7678:a180 with SMTP id p5-20020a50cd85000000b005537678a180mr1805440edi.35.1703032262767; Tue, 19 Dec 2023 16:31:02 -0800 (PST) Received: from [10.167.154.1] (178235179206.dynamic-4-waw-k-1-3-0.vectranet.pl. [178.235.179.206]) by smtp.gmail.com with ESMTPSA id k16-20020a056402049000b00552d03a17acsm4824397edv.61.2023.12.19.16.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 16:31:02 -0800 (PST) From: Konrad Dybcio Date: Wed, 20 Dec 2023 01:30:47 +0100 Subject: [PATCH v3 06/15] clk: qcom: gpucc-sm6115: Unregister critical clocks 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: 7bit Message-Id: <20230717-topic-branch_aon_cleanup-v3-6-3e31bce9c626@linaro.org> References: <20230717-topic-branch_aon_cleanup-v3-0-3e31bce9c626@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v3-0-3e31bce9c626@linaro.org> To: Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1703032250; l=2946; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=L0PymLuHyWV4Yhgl+FgHBcte5FGcWRmHBmwI88u/f0w=; b=mb+8JyTtb5GOVdQk8pqP4Zfg7CUhUtYKZkLtfhYeejKLLAAcOcm7s6pG9xGblIhwsJ9K/MH0X iNiTWbEhf80ABEvtfKI+vRmLcu91/gYcS2T2/FnYGD9eId9kL2nwh8G X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Some clocks need to be always-on, but we don't really do anything with them, other than calling enable() once and telling Linux they're enabled. Unregister them to save a couple of bytes and, perhaps more importantly, allow for runtime suspend of the clock controller device, as CLK_IS_CRITICAL prevents the latter. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/gpucc-sm6115.c | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/drivers/clk/qcom/gpucc-sm6115.c b/drivers/clk/qcom/gpucc-sm6115.c index fb71c21c9a89..93a50431aef8 100644 --- a/drivers/clk/qcom/gpucc-sm6115.c +++ b/drivers/clk/qcom/gpucc-sm6115.c @@ -234,20 +234,6 @@ static struct clk_rcg2 gpu_cc_gx_gfx3d_clk_src = { }, }; -static struct clk_branch gpu_cc_ahb_clk = { - .halt_reg = 0x1078, - .halt_check = BRANCH_HALT_DELAY, - .clkr = { - .enable_reg = 0x1078, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gpu_cc_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gpu_cc_crc_ahb_clk = { .halt_reg = 0x107c, .halt_check = BRANCH_HALT_DELAY, @@ -336,20 +322,6 @@ static struct clk_branch gpu_cc_cxo_clk = { }, }; -static struct clk_branch gpu_cc_gx_cxo_clk = { - .halt_reg = 0x1060, - .halt_check = BRANCH_HALT_DELAY, - .clkr = { - .enable_reg = 0x1060, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gpu_cc_gx_cxo_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gpu_cc_gx_gfx3d_clk = { .halt_reg = 0x1054, .halt_check = BRANCH_HALT_SKIP, @@ -418,7 +390,6 @@ static struct gdsc gpu_gx_gdsc = { }; static struct clk_regmap *gpu_cc_sm6115_clocks[] = { - [GPU_CC_AHB_CLK] = &gpu_cc_ahb_clk.clkr, [GPU_CC_CRC_AHB_CLK] = &gpu_cc_crc_ahb_clk.clkr, [GPU_CC_CX_GFX3D_CLK] = &gpu_cc_cx_gfx3d_clk.clkr, [GPU_CC_CX_GMU_CLK] = &gpu_cc_cx_gmu_clk.clkr, @@ -426,7 +397,6 @@ static struct clk_regmap *gpu_cc_sm6115_clocks[] = { [GPU_CC_CXO_AON_CLK] = &gpu_cc_cxo_aon_clk.clkr, [GPU_CC_CXO_CLK] = &gpu_cc_cxo_clk.clkr, [GPU_CC_GMU_CLK_SRC] = &gpu_cc_gmu_clk_src.clkr, - [GPU_CC_GX_CXO_CLK] = &gpu_cc_gx_cxo_clk.clkr, [GPU_CC_GX_GFX3D_CLK] = &gpu_cc_gx_gfx3d_clk.clkr, [GPU_CC_GX_GFX3D_CLK_SRC] = &gpu_cc_gx_gfx3d_clk_src.clkr, [GPU_CC_PLL0] = &gpu_cc_pll0.clkr, @@ -488,6 +458,9 @@ static int gpu_cc_sm6115_probe(struct platform_device *pdev) qcom_branch_set_force_mem_core(regmap, gpu_cc_gx_gfx3d_clk, true); qcom_branch_set_force_periph_on(regmap, gpu_cc_gx_gfx3d_clk, true); + qcom_branch_set_clk_en(regmap, 0x1078); /* GPU_CC_AHB_CLK */ + qcom_branch_set_clk_en(regmap, 0x1060); /* GPU_CC_GX_CXO_CLK */ + return qcom_cc_really_probe(pdev, &gpu_cc_sm6115_desc, regmap); } -- 2.43.0