Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7126782rdb; Wed, 3 Jan 2024 05:38:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IEui07hTvSBRgWosyJnPrEDK30F8uylgMYq8PIniFQ20PmV6VSZ7vPG5jJW/VJAgEaix15v X-Received: by 2002:a17:90b:517:b0:28b:e74b:6c05 with SMTP id r23-20020a17090b051700b0028be74b6c05mr6228633pjz.24.1704289111828; Wed, 03 Jan 2024 05:38:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704289111; cv=none; d=google.com; s=arc-20160816; b=zqs9PbZPIFWrGD8O6WSB4uTwUkU6hQ91JuilSakEqyWyJHkBhCOeODMFXqioxkGKcZ cnn269ZURxyYaKNztiQU4mU4ziSUh2OVBCG9sTlc/oqNmKuxGCrLr0QmyC5ONWyee7MV M/4ByfY8xSgZoRzN+mcgJHVMDMITxQuOy5VsaZvzwLYgQjMLt1G3oX/XNN2BGjOP9Ymu MyCqe6EYWjwjZB6a0VyKh1/wtYjQoJYiqqVzTGgCjSu74WmHs/2JdWHOFNbi1rwd8OOV 8Y7xRqbZHzv4E7097uSIx95lPz/EXV0i5+BTq2ONANRpxu5jS+K8xtxJRMtKD3J+fY1x PVQQ== 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=Yq1JGC68uTd3cPMS7VFU/4ZnPLni1wHoKXEP4mEYH+A=; fh=/9IvASkZ5EB5zGoodRetKiJiPtH7a6iK9GbsrCyU1gk=; b=LclVcyJBu35JVGr9YwA2+Jfxa6i0cctUjSDCHJr47S3eWstusrljXqf7hFlcTvJ4xC W4bkwoXQ9LsIXlPESTsvZvq22uTfmC2X2tgDLfdno/Yx98fF0NlYzOhBFKyhxPi2s7YE qq0xO4K95vxFNhHjjY0eu9EqfZli6grPi6bGPRtoaL3hXvG0eqWxb7VY0SMmk1bT9xyF +Dk3/+grM4RLG8T/5JBub/juh5/BK8d+J9ogpUt/+1q0nEwkL4b7OnHfwEfEcR7ZzCwa e7qrsE5oCIJEiixLmknrxEPn8+UHZTvFRpezHhxVJ38Zh564Zj9bLGZSPtSWPifOaJtw k2+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PeVT9nCL; spf=pass (google.com: domain of linux-kernel+bounces-15594-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15594-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. [147.75.48.161]) by mx.google.com with ESMTPS id k8-20020a17090a404800b0028cd9c3f625si1226336pjg.137.2024.01.03.05.38.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 05:38:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15594-linux.lists.archive=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=PeVT9nCL; spf=pass (google.com: domain of linux-kernel+bounces-15594-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15594-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 BE036B21104 for ; Wed, 3 Jan 2024 13:38:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E82A91B27A; Wed, 3 Jan 2024 13:37:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PeVT9nCL" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (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 91C391A5BE for ; Wed, 3 Jan 2024 13:37:07 +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-f41.google.com with SMTP id 4fb4d7f45d1cf-556ea884968so19318a12.3 for ; Wed, 03 Jan 2024 05:37:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704289026; x=1704893826; 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=Yq1JGC68uTd3cPMS7VFU/4ZnPLni1wHoKXEP4mEYH+A=; b=PeVT9nCLH1khJbkYP+c+CYw5YfvNtBu0iEfoEnuXCAoVKrscSHWbPXStIoOF8rWrUJ VIOct8cMRpgFcA8yiS4oK5Cqbl0kkHk4utulCgEoUH2FjQloW4vUfIE47/IR+ph3RTtK 1it3nEkt4PVHgkZ56wvaJJes7rNaV7Xd7tAU1G3GPT/vHqv1R8NBTZMGfZcJWsE8xK5h YybT5lFNQPI6YYSGlGEIGFZv4ahUAHoTqhAzNHNPZJmI7sCMHctRxm4+6ouPUPJJAGfm JcxLxFZrogOatrWZQckQtwuTLRVGqEyhS8Fl9LtEcUdCpaM68ar7v3wkBGP3cgrFzJg4 56Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704289026; x=1704893826; 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=Yq1JGC68uTd3cPMS7VFU/4ZnPLni1wHoKXEP4mEYH+A=; b=abcgXLMg+AwEcUECeH4pY75coA5Ew8lqkpqOci/B+Vr8z53rFr/J5zCNFGRgFR/h0+ VVabbjGUBuQaBLfgAObpnNbSedc7/Pr0ww+jd0ZtyFDYF2fz3h74vMi+jd/QkkCtkzlv 6Ittr3/C16RKBy+7I5xSFrMh2rxF9FNMQrgu+p71grzEHMSzAGUqqiNC5SxEh7DsgqVn bNJfPX/97bOVvxQ6ZSvE1Roj5y9ckpa+skOdDtp+4rVfJ/SVc8fpslOBeYyN+E5/5plu gu0/YRj1nPQq8YcJ9q+cQoemTtvyHWmRhZw1iXky9H/cilAeXKDobjfwQzE6rHnZMJU6 spNA== X-Gm-Message-State: AOJu0Yx5fa1+M46ugoGJn3F4TjSF/vd8yOEbwCa65GxFfdoLCiROcXje JrOnCLUSAM/1fID3ApvvwmlMYwSjI8SlPg== X-Received: by 2002:a17:906:6952:b0:a28:a01:ee92 with SMTP id c18-20020a170906695200b00a280a01ee92mr2120619ejs.36.1704289025971; Wed, 03 Jan 2024 05:37:05 -0800 (PST) Received: from [10.167.154.1] (178235179036.dynamic-4-waw-k-1-3-0.vectranet.pl. [178.235.179.36]) by smtp.gmail.com with ESMTPSA id cl2-20020a170906c4c200b00a275637e699sm6474351ejb.166.2024.01.03.05.37.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 05:37:05 -0800 (PST) From: Konrad Dybcio Date: Wed, 03 Jan 2024 14:36:02 +0100 Subject: [PATCH v5 04/12] clk: qcom: gpucc-sm6375: 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-v5-4-99942e6bf1ba@linaro.org> References: <20230717-topic-branch_aon_cleanup-v5-0-99942e6bf1ba@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v5-0-99942e6bf1ba@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 , Bryan O'Donoghue X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1704289018; l=3066; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=GHhudpM9IAN/Lc38xFu1FTckBvfyQEfeLWFuAx9ceqc=; b=h//62tjk6Hx8GrQUJmei/DxNFmIbbfRVZKURbysVBxVyeHMJyfQFBjgjrNv2jR4Zg0Ug2KwY/ eZnlvruiNbTD7Ra4hNdqgmrp+1yALlDuFEdWW+HcvIfV7iTYhMJW6F6 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. Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/gpucc-sm6375.c | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/drivers/clk/qcom/gpucc-sm6375.c b/drivers/clk/qcom/gpucc-sm6375.c index da24276a018e..07ebe5e139d5 100644 --- a/drivers/clk/qcom/gpucc-sm6375.c +++ b/drivers/clk/qcom/gpucc-sm6375.c @@ -183,20 +183,6 @@ static struct clk_rcg2 gpucc_gx_gfx3d_clk_src = { }, }; -static struct clk_branch gpucc_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 = "gpucc_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gpucc_cx_gfx3d_clk = { .halt_reg = 0x10a4, .halt_check = BRANCH_HALT_DELAY, @@ -294,20 +280,6 @@ static struct clk_branch gpucc_cxo_clk = { }, }; -static struct clk_branch gpucc_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 = "gpucc_gx_cxo_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gpucc_gx_gfx3d_clk = { .halt_reg = 0x1054, .halt_check = BRANCH_HALT_DELAY, @@ -381,7 +353,6 @@ static struct gdsc gpu_gx_gdsc = { }; static struct clk_regmap *gpucc_sm6375_clocks[] = { - [GPU_CC_AHB_CLK] = &gpucc_ahb_clk.clkr, [GPU_CC_CX_GFX3D_CLK] = &gpucc_cx_gfx3d_clk.clkr, [GPU_CC_CX_GFX3D_SLV_CLK] = &gpucc_cx_gfx3d_slv_clk.clkr, [GPU_CC_CX_GMU_CLK] = &gpucc_cx_gmu_clk.clkr, @@ -389,7 +360,6 @@ static struct clk_regmap *gpucc_sm6375_clocks[] = { [GPU_CC_CXO_AON_CLK] = &gpucc_cxo_aon_clk.clkr, [GPU_CC_CXO_CLK] = &gpucc_cxo_clk.clkr, [GPU_CC_GMU_CLK_SRC] = &gpucc_gmu_clk_src.clkr, - [GPU_CC_GX_CXO_CLK] = &gpucc_gx_cxo_clk.clkr, [GPU_CC_GX_GFX3D_CLK] = &gpucc_gx_gfx3d_clk.clkr, [GPU_CC_GX_GFX3D_CLK_SRC] = &gpucc_gx_gfx3d_clk_src.clkr, [GPU_CC_GX_GMU_CLK] = &gpucc_gx_gmu_clk.clkr, @@ -455,6 +425,10 @@ static int gpucc_sm6375_probe(struct platform_device *pdev) clk_lucid_pll_configure(&gpucc_pll0, regmap, &gpucc_pll0_config); clk_lucid_pll_configure(&gpucc_pll1, regmap, &gpucc_pll1_config); + /* Keep some clocks always-on */ + qcom_branch_set_clk_en(regmap, 0x1078); /* GPUCC_AHB_CLK */ + qcom_branch_set_clk_en(regmap, 0x1060); /* GPUCC_GX_CXO_CLK */ + ret = qcom_cc_really_probe(pdev, &gpucc_sm6375_desc, regmap); pm_runtime_put(&pdev->dev); -- 2.43.0