From patchwork Sat Dec 30 13:04:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 184001 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp3073297dyb; Sat, 30 Dec 2023 05:06:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IF68kHLwcboj+QCQeX7GXD7rHCnwLlrKZv/ZGCILfagyMAX3rCAn8a0Yx+IFhRNFB5zpMF6 X-Received: by 2002:a05:620a:d4b:b0:781:7232:d4ac with SMTP id o11-20020a05620a0d4b00b007817232d4acmr4372477qkl.118.1703941605779; Sat, 30 Dec 2023 05:06:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703941605; cv=none; d=google.com; s=arc-20160816; b=oSLGZu58rESAFBq62HUdsMxZuABSG9R3jW8JEPQtnYEqXlBpdNqM1rp4qEWSZcgTeD J+xJABeR2FWkXF2ej5YaURwgws6geSMjygS2/pD+4vLO7zna+uNdE9+S3vxVI6whYQVO 20hVD4HuUYV8yFnujwXOTSmIEoZ7L3pnXyxDBhx7Oy+2Y+Jm5zLdiIOghN/CEHqM+jcB /E6QWTy4wmWEha0ErYluEea8V76LDQcU2/gPn0G4X+Ew9XkC0ZVnt6LhtkeSi28pJY55 iv9gqwUJYucGhXJ0KrlaAoPAqoJgAsLy7apv8sbjGmTN2BxsGSMo4xlH6SNurmT9g3sR 5RkA== 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=ByfBEaxVbdUVIAdrCz7N1NJpJgYMz8zu6EVn/I7XhAjNdTYxXbmetj6kmd++zqRHYs z5SCVmrJvPDNcdYD+5IC/Vu/Xo2d7a1NFkIGyysICLCQYMJlQrWfiiXLVmJvd5mW2K50 /RIBJvAujCtKsii2kgcaMnYrKtEE/iUI3JRXlI1JyUA2VfTM71A59vzDHmkr+TfJLpfQ O+blp8V7e5nYV6FPgCh70cTIe65oDc5HvR9s2mdJf1n79Fa7VdA4QT30j4sBi9vsvehL aCJAnZFT6tKXZWBq/mvUiBuo0ZHfuq55uG6rVrY9BtsBrxggabuUWty3jVOyHwcIQtXt CwPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LJgghZDX; spf=pass (google.com: domain of linux-kernel+bounces-13426-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13426-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a14-20020ab0668e000000b0078f11fb588csi2679782uan.145.2023.12.30.05.06.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Dec 2023 05:06:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13426-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LJgghZDX; spf=pass (google.com: domain of linux-kernel+bounces-13426-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13426-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8B5601C211C0 for ; Sat, 30 Dec 2023 13:06:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 88B1514A85; Sat, 30 Dec 2023 13:04:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LJgghZDX" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (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 6BF31C133 for ; Sat, 30 Dec 2023 13:04:37 +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-f53.google.com with SMTP id 4fb4d7f45d1cf-5537dd673e5so6056681a12.0 for ; Sat, 30 Dec 2023 05:04:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703941475; x=1704546275; 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=LJgghZDXv6d5qWUD1N03zTs52x1TGZzgJ1Go/n368EMILtdWv/A37FcIQIiwYj7CiD SwDnDQ6vpVXdOnPLm9Z31tRDdi3VebHL9QZJm9GZ/oP1vjdq2oNzJbbWxgmXBg9J+BC8 rGlzLpaNm4AaByAuLyVTE8siZnLYZsVOP6vN2ZLfIYoQulU59+HGukOdnW6Jfus6fcCX s3Xnsvv2IIHnpI0WZULrKDKrsEFZX1mlSIVCeIoF1Eyu/2SbvJj+lpfntRWsVgSJ3na7 EDX7zzeV871g7j8zQZ45olYEBzyA8QJPdhA9h4fNt3iR/B2npEZco5dTBGngdwrYk0Di pBfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703941475; x=1704546275; 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=glXbX/hOZmnPZot0xjJI+z9qjC8Ankrrd1Erio3VtOFU4v1QD/aSjJTRQ8EIRDqeq+ kI9xbKRxVciqM1oGMINeiSGH2PkDayyF57dJmG8c+5Z9fcIwAAFwL97iJubLp78NESyj 9eNUwAD2vaU9pXkyAfwP+nNNisEwaY6KhVtGx9X9R8MK4icdI5xs0A3IDO6i11M/WOXW 5ehJtrI1/Keun9GeXygACx01d9BXcJ8fTC4A76U7jOVBfQYzeqCNiMcC46DsnVTyx5gM iwOk8Y2yV3PnsZqc43nl7quRRowSQyoQRn+Iby68lfS+5LbcwBkMhyjBKCoCwTZ0WG/f sZ2A== X-Gm-Message-State: AOJu0Yya/cLuTq6oBMFWl0UFPPiy7KHLEJibXhB16KQKI05/9ZohZjUM PMSw+CvxvKNBPfNaV0uEktQW33Y8R9kzohanSpkQWskjCK8= X-Received: by 2002:a50:8a9c:0:b0:554:4ad0:9374 with SMTP id j28-20020a508a9c000000b005544ad09374mr8805626edj.52.1703941475622; Sat, 30 Dec 2023 05:04:35 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Dec 2023 05:04:35 -0800 (PST) From: Konrad Dybcio Date: Sat, 30 Dec 2023 14:04:07 +0100 Subject: [PATCH v4 05/12] 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 Message-Id: <20230717-topic-branch_aon_cleanup-v4-5-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 X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1703941465; l=2946; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=L0PymLuHyWV4Yhgl+FgHBcte5FGcWRmHBmwI88u/f0w=; b=zn5w5Kq0gwr7YIyeiDqrng0yuHBpQ5FsIjCfT1XUkP9pP7zWK16ejFxqKT/dPTevzwYfIp6m6 hBsmV56536EBgHvT/7hs0b6Mv12QCpU0aaW65eAHAW34Tre6L5MIj6T X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786712273277570130 X-GMAIL-MSGID: 1786712273277570130 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); }