From patchwork Sat Dec 30 13:04:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 184000 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp3073114dyb; Sat, 30 Dec 2023 05:06:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDOxm5emAgFhXzxNe3l9CL+MxNaQOO10ZbaYFTyeYy8cOeWpCAGOBhCClw67hH2tuRMIg6 X-Received: by 2002:a05:6402:12d3:b0:555:368e:1c2b with SMTP id k19-20020a05640212d300b00555368e1c2bmr3858095edx.76.1703941589135; Sat, 30 Dec 2023 05:06:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703941589; cv=none; d=google.com; s=arc-20160816; b=RytT6fRc99HY1kI9Bp7o8P+DOtJDisv2lchuPrH5OhxhGu4fC12kORGYSAgnStvF/9 p6/UtpJzpyejz6aLJRy7d/zZ25TnjGdOFbbBPjTkzON10rtf5se0HI/fmLsrxWuwtcPx UuzAXsXLJjfRZt6WvTqparkNhDGMyYtOcavkM3G2h4nTUEtisr8RnSYCsJ/ASEt+SXA1 /wB+y4PV8/S+9vA3jrzawVQDyNOpa6riKsiwi/99Q7669VmkTzbply6YSKN1aPM32QIK 0Trk7ru+x3m0lz1S8HW66mnfMqrAWuPeO07cZsI1B5HKl4raG1WKd0zh5D/EVs34gIpJ eXIA== 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=v976SmXxRiZAGe8x+4gqFafbRMwHJbbnvfO+A1vZOV4=; fh=/9IvASkZ5EB5zGoodRetKiJiPtH7a6iK9GbsrCyU1gk=; b=cOxMxT/x5ov7UVosLF7OsQYGWRJ57MutOM9h0neHXwwcRjmvMUgSkhHRiMVc/VDi1t KxMqHLNfAXqU3qiffztWojIH3YAj+1+e0cMeSlngWAg1sn98nDWm2Ul3IlwVpTKMP5uM okY3XCnxjemwfGahYUzUllfJb51Gzf5TFIbmeD3kI4lH+ElHeIpNtymb2/lSK5kgTF7C N0rOw7dLR8au1uavkr/VKFY3mOQ+CFiPgZBPJnn0HZvEg+FyEO+M8/vhJjuIkaqHpg0C 8gkyTiLX+NihHyAoi0p8drSRSpDjWUk4F/dg7IlIbuBXVLpUYu8ls0hoXEiJJLZnJE9W EWwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VhynUyFS; spf=pass (google.com: domain of linux-kernel+bounces-13425-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13425-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j22-20020a508a96000000b00550db2b31ebsi8747735edj.294.2023.12.30.05.06.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Dec 2023 05:06:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13425-ouuuleilei=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=VhynUyFS; spf=pass (google.com: domain of linux-kernel+bounces-13425-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13425-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 am.mirrors.kernel.org (Postfix) with ESMTPS id BF6F41F20C3D for ; Sat, 30 Dec 2023 13:06:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 09E3411C8F; Sat, 30 Dec 2023 13:04:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VhynUyFS" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (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 B5EC2BA31 for ; Sat, 30 Dec 2023 13:04:35 +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-f52.google.com with SMTP id 4fb4d7f45d1cf-555f581aed9so459676a12.3 for ; Sat, 30 Dec 2023 05:04:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703941474; x=1704546274; 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=v976SmXxRiZAGe8x+4gqFafbRMwHJbbnvfO+A1vZOV4=; b=VhynUyFSj3yDmBcJo8tKbMGYqVRCjAXPIw3kNtVt10HWzc/BnZGA3JHtMFmorrSCR6 GkzH2b5cC02j13b2bLm2bXYNnnSoiEMiyIF8yxfbCZpuUaEi4Wvoy23bppOKPy88+l0g sVT78mwH3xWWpURyuKFbOPRcCU4hVo/1R9EFMIc7HK2crh7AKK0QN0hNvy0TGLft07iE TSUB+VDfjuuVSwo5jXNBa9iWvIKgIqAEXtACbMlm6b8axO0IXfTkjzKXF6INTKUM28YO 47f5yh4kPUElAU4rrKBA99BxbCJUwxrOVaDJZjW+E3MtV7UNmc46m5ek52DVe+nPrjrL ExWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703941474; x=1704546274; 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=v976SmXxRiZAGe8x+4gqFafbRMwHJbbnvfO+A1vZOV4=; b=J0qWJwEENIG3VBzING2qt4h7407JTZxMKtMvBR8aWKZPj5WUpUR6fygeu1tJcx1li8 wwHnAzwVUQPn0zx3n+p25tu9rzVwWVIsOJAfu2KJ7cMYmbrYikS4nXkvKAPwRDx+TmHD N8axC6LgEM0EX5rbowQNYLim5G8ZDMXGpnrbDF6erkvwzWZOdHTJJt7nYuCFtx3INF60 GpaICn0swJqID/WIwHPmAlY04Ww1X4pYnkqIjxv7lzpUWeoeJXr/8dv9vZLnN8tjLN5p VPv+8ukE1eyYoD0r7+Es6lQXSmPa1ZVH2VDCdvyPGzZtQXWRtyMQ/voc3WnVt94Ij/8z cHzA== X-Gm-Message-State: AOJu0YwfW1nVc2wOw5EWh2RQGcWuSu4wGd9cMHNW73Mi3tJTnVy4wHmu nQjL8V/sb112iORD0iP0g67FFGjbIY8FSN8e/ejGFZztTKs= X-Received: by 2002:a50:9357:0:b0:554:71a6:2133 with SMTP id n23-20020a509357000000b0055471a62133mr7726960eda.40.1703941473726; Sat, 30 Dec 2023 05:04:33 -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 ij14-20020a056402158e00b00554368c9ce8sm11359578edb.1.2023.12.30.05.04.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Dec 2023 05:04:33 -0800 (PST) From: Konrad Dybcio Date: Sat, 30 Dec 2023 14:04:06 +0100 Subject: [PATCH v4 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 Message-Id: <20230717-topic-branch_aon_cleanup-v4-4-32c293ded915@linaro.org> References: <20230717-topic-branch_aon_cleanup-v4-0-32c293ded915@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v4-0-32c293ded915@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=1703941465; l=3028; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=fXRoqdRlJHc5Qzabc5UfVEq2iMwhjOiaxUJ84TrgGsw=; b=vq0CGg04byY51x8KXl6tKrZv3/dNVlS9kAnwvRUtq6WonwDpwEjwI9rGvQ+OJK1BcNft9wsj+ 80LfujP6G3fDvynQrbVSd+H+QBaAgVY/UeXKYLdrT72DHqjQczMNUkL X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786712255867172972 X-GMAIL-MSGID: 1786712255867172972 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 | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/drivers/clk/qcom/gpucc-sm6375.c b/drivers/clk/qcom/gpucc-sm6375.c index da24276a018e..6d85936dd441 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,9 @@ 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); + 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);