Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2906550rdd; Sat, 13 Jan 2024 06:52:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IHEGXB/sUcVJUzfq08FroH9SdWdeRP6hYy+O213KHfmst5gRVF8S56T+OiSUCQ1s5wIw5lr X-Received: by 2002:a17:90a:d490:b0:28c:3e:8bbf with SMTP id s16-20020a17090ad49000b0028c003e8bbfmr2025651pju.56.1705157535265; Sat, 13 Jan 2024 06:52:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705157535; cv=none; d=google.com; s=arc-20160816; b=Yht2VAL4/WyCQDwQCfciChNba3SSTP0lHRaQtAzIvRaha3PKv3m0bWlZ3OqWCaiHQc 7Vl+VF8rWys/zNO5gVWjhj//C/sqWWboXkRBKPlDiomUUTncAcBBtzE+udpEtDCi4ib/ lW2sKycpUPZr65fwkOS7T2AzYskINsNl4U7yAAsS947pBH/Goxc5sYVIS1eSf5kLW90j F4bR0LTiGPseIuObLrYQC7S1JFv17yDi9sXVb1AIrXnRX2P94ecmibrOchJzUC0uYN/r vvoO5B+gOC6bnFeSeByozTJN+uuW3MOhmnc8V8P0xQDKVpalb5h2Zc8a1utwO7GZt2pw 0gPg== 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=mvtiMhCMMI0gsyaGarBZfVTVyEw+qIGqQVk4M0KEADgPquA8hsu8ko50QagYuOMlHH YEB4zOxs+h5rmseKE4JoXgi1y2lIc/i1etq6UwQBz5lKtU6/qepMDQMFOb8yDDIEiw8G 4n9K/aq8WWusbUOwPOHB/FKVT83aDDBO2UHud+P4TGxhjyt9kYb23PJ8KptBB/MT5Kuq InhUGdfTtL8n8OQ3XaCteLUYkSQca1DRFmeUqM9leOc7dSQbtS+Yqw4pWFALjU6zNGbw QZZMZiVh5SQ1UPgKOnXR0to00HdK+ySlJiWgTaxZsMfGSeK7/JQCK4aFuKiJ2Ti0CGNY 85HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j12XmNP7; spf=pass (google.com: domain of linux-kernel+bounces-25302-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25302-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 a11-20020a17090ad80b00b0028c94ef778esi5495011pjv.9.2024.01.13.06.52.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 06:52:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25302-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=j12XmNP7; spf=pass (google.com: domain of linux-kernel+bounces-25302-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25302-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 57A1FB22D19 for ; Sat, 13 Jan 2024 14:52:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F23E569C; Sat, 13 Jan 2024 14:51:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="j12XmNP7" Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 A212F4C83 for ; Sat, 13 Jan 2024 14:51:05 +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-wm1-f49.google.com with SMTP id 5b1f17b1804b1-40e6a94affdso6944085e9.3 for ; Sat, 13 Jan 2024 06:51:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705157463; x=1705762263; 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=j12XmNP7T+CDHjfhVqEBYwXwaHs8rDOsXnqWvV9eLMmFPqraR5aY8ZiZFoGfeNBmZn NUx8FGrxKuqvbDoDLkBaiSw2MPadPi+NYpc2izI6aJdcBT/rOqfNEBZ4y2z3ewnv5y+Z C6svQSq37aI/FnZdcF2bww9x/9NxzqwDTKbax8AGLCHHopqOQeDkMPbO6wS6Th6rfpg4 0/q0CC/qpurMVO4C5jN0LTlYETQIjc/Hd8ZibVdcLcMTf3/OINko4RBZDMV5mlN9joOH L23UJECavZBOBBVbzVUKKXXWNsj3r5gglYavXCDHT44BLNLamdC2j/VFzLPgJNxsx2uH Occg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705157463; x=1705762263; 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=hTofvPCmpwp7rxvpbzkjRdd18eGW13HEOP+qqD/HG9A8VpPHYvUJX9IjWvG569zf9J TzAJC4wWTNwqvwFjkgNjYw48iZbHJLip4ij2I69wYPjonJfo3GALooSd1LiGukHvyE+1 iBr49ff9Kaa3Sl7+k1fIhDBWXAYOz7VA0uCdbw+5+DLYQH8glbQdjzTyIpUxXMk0CjhM azUvIEBsHUt7XBz/NlCJBzIXU+m71DSczux8EQmPJBggeDDwbpJw9DoM0IKvG6LxTM1H TlQFkoHQMxJl0CRLBgS8JgbUSy0MMa095FfDoJkT+1ZcisB/pfcL8iHwsFPsUT2i894Z qfRg== X-Gm-Message-State: AOJu0Yy2kkVGhSuK/ZiFKvk4byPjcdBM7BC3joSOlTCUXKzJQrV7wqAE clDXDgX04WX2Tvkos/b4n3cPzg0OivXtJOk9FxDKCmqXyq0= X-Received: by 2002:a7b:cbc8:0:b0:40e:5f07:8179 with SMTP id n8-20020a7bcbc8000000b0040e5f078179mr1667876wmi.55.1705157463564; Sat, 13 Jan 2024 06:51:03 -0800 (PST) Received: from [10.167.154.1] (178235179017.dynamic-4-waw-k-1-3-0.vectranet.pl. [178.235.179.17]) by smtp.gmail.com with ESMTPSA id es18-20020a056402381200b00554b1d1a934sm3014593edb.27.2024.01.13.06.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 06:51:03 -0800 (PST) From: Konrad Dybcio Date: Sat, 13 Jan 2024 15:50:53 +0100 Subject: [PATCH v6 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-v6-4-46d136a4e8d0@linaro.org> References: <20230717-topic-branch_aon_cleanup-v6-0-46d136a4e8d0@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v6-0-46d136a4e8d0@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=1705157455; l=3066; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=GHhudpM9IAN/Lc38xFu1FTckBvfyQEfeLWFuAx9ceqc=; b=7oE4smrkZnOkrEHHwNnNDswIemR83jy9lAxpc3eCf2/ledvT52eVWjmnEk7MKLoeymLRkn+2H Igs3i9hFDqxD6by9/u36RhN6cPE0GcvaRaarFWx+Om6I0Zvq08J6sdP 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