Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp152948lqf; Fri, 26 Apr 2024 02:36:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWIqgnKJXsXOZHFYkFmsAkzKOGjJUJQJZYEd5sRWo7CKsn6zeGrKoVYFkFefLSiovGOttIzsz10JWT/M2KDFNe7m54PG8LOObD/c8EyZQ== X-Google-Smtp-Source: AGHT+IETkoFV12BvX2UQ2PH5wEX07N05xtb8kSAYU2Y/wuqLVs/69Yinuglm9Pb1tz+QtINI9/56 X-Received: by 2002:a05:620a:4486:b0:790:8bbb:dd60 with SMTP id x6-20020a05620a448600b007908bbbdd60mr3038189qkp.3.1714124177551; Fri, 26 Apr 2024 02:36:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714124177; cv=pass; d=google.com; s=arc-20160816; b=FsHYz3ZbRhVp3ug3y2QIWjxZxpLy64eREI1JQ0tziV/ux+CY3YBpdd00raOsmwVBDp W3hjk7u5EntLlQeDwF+Z+gy/zynd4qg0iHr5bdUEtOaeP+yRWDdBiAt2gJmjfioj3qHz zajsqBSfK64xNK3jY3NzVXziK5SWKbft2ZlGNWtke6Jfg47S+WM6+cq7DY2rozSsJvvC tdaLxCn6pli8s5b5iix4Zidrq+3Godg4Ri4PC4kzRUccnwe5vx0ucwmaNLo92ri8bJwZ R2nevVFRy/q2vRw7Tc6CwKfJshAfOaPE3bJXXqAjQc05+xCOYZe3kFfC7lkzcQCiUUm6 N1eQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=G7WFcySPvcg+ldo/VhFJ6svW9p0g+/3RSWp3xt+xPYc=; fh=bGHAtK+tVj8YRqu5I3L1FCDmNdhKcDdTvpoyf1Q2WtE=; b=pcb00JyroxCLZbOjOwmH851oEn1GKD7AO85zE4xFqlmrsc35usnmAN7W9X2LPDNjk3 ex/6PuZssxmfn/Bhjqg3vWAb/v5GobFWMr61De0VOtYoNumRO+JvzU1tc35PAdCMfQDf UdcDVeRY3g/3KcBYwVDiVFBOL8Z+zgJYvOyOvjYcI0wpjYNfc78+s7Ww+9uY1if2Pgjw oYEeEPunn2tEyFmc9GZc/jT0O286WEOr2Iiz4F1a7i428a6KDa+n1jOCB6F0W+4mPKQ7 MhHeQsmXz6t1nyfSAUfnwskRpSL2rGbg133EaTSiGBjBqxmjqsOXunLkvzLWbTf3hkzU y2Kw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HktyPIZd; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-159797-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159797-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z31-20020a05620a261f00b0079097907757si4648838qko.3.2024.04.26.02.36.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 02:36:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159797-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HktyPIZd; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-159797-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159797-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 35A221C226E3 for ; Fri, 26 Apr 2024 09:36:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC37213F45D; Fri, 26 Apr 2024 09:36:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="HktyPIZd" Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) (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 5F90D13F420 for ; Fri, 26 Apr 2024 09:36:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714124161; cv=none; b=lUNTUO9gsIo0+4gOZyLbdEhfpMQJwbeaq14/MYVfrClaFFXDcNueuCtbvY7Lpn3Azepq2UUKLqu/gfl3Xg2Olp0WDKzr8pIE0iBkVrLS2ZcFs03fe+EfyvWUO1IQ9Knq8PwEQP6lLus3hZa7GJIfogr1aUb9MCvbyEv6vbGySAE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714124161; c=relaxed/simple; bh=pN3yy4CmQ4hSslxqgMrAB2AztZnKL7xpwpzx81cP/aE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ege9Sfj/sy/ktjdG5uYny0IUANtBOl/Mj5tWrxFIVQr9FZsvUOYQLOEN/MoJqjmDLU/PKWiGvll6YlyZw13FrqsFWtSjc56jRm+XoGUCeiJUaOW06z8Z7iSFywwrRm/zKwrH+9AIxC4PuqOgR+2QtJ/2qgdLtdfQ8IMYd3Bi6og= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=HktyPIZd; arc=none smtp.client-ip=209.85.219.180 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-yb1-f180.google.com with SMTP id 3f1490d57ef6-dcc71031680so1978163276.2 for ; Fri, 26 Apr 2024 02:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714124159; x=1714728959; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=G7WFcySPvcg+ldo/VhFJ6svW9p0g+/3RSWp3xt+xPYc=; b=HktyPIZddmdNrMPSXGExNh3sAJsGhQc/kPgoAn5CjQZ+QSzX5uvWofpTBpte5TlpvF rKEvE8oTnS07mnTS0PcGyd6ldLK7wJny9HCqRh4Ar006hKZcwF7L7kMpceT7AvbeEV1a J/y5Bs+1OnHNqvd9BnnFSVUTCL2X8ZndLnVHWq1bcvH1IWE69ivpgL3avN03X7qzGWr1 vNZUkQv1stl26mB5ATf0tWCeZoqMKY2uBCvd+ZUa2Yzst6/DX8rMn+yYuzzvxVm/MTAo yQ2vBTir3s+NbvkS95tMCDdRWfY79hKxARNAzF361+dxcQ1kmAwg1vc4XCl0OUSZ50B7 6T9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714124159; x=1714728959; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=G7WFcySPvcg+ldo/VhFJ6svW9p0g+/3RSWp3xt+xPYc=; b=bUXcgu+F613p5aCOvUjqoTpqLdkuVmwDbUeXzSLdjo4U3lVN/PCLBjoxErcJJDCF9p bMPMunW286+nQqK5DAICMbRBcaVDs4h1qOHe/t9bDY2xFryleIJBfYKVtlIMMBOf5ipI lRclcC/IUuW8oZpX0smDSr6cqU6KOukLv6Ffst/lUQ24mYz7lt5p5Ag6XcaWc6jdjCb1 v/NVj8/NeVFjbAqg2huhsDYWAfQVGctRRoRioqhr1Ef46KhMrKI+0+CNxeaDB5mKtJqp rjWgVO2E4TfJ4GvyGfy2DjNWvjVbqlZmVx8UP+ECuPsn2POyU1E1UCIAlKi7gipjK3xQ TCig== X-Forwarded-Encrypted: i=1; AJvYcCXd5PMlbNKQMgOzzDcx9O70KHkTNqlW4l0Xdfc0LYIMxcmIU9M6FJtnp4bcXqlGpWFPtNRKmRrJj2hdHKY1llsRslIFy8lwavo1F6Al X-Gm-Message-State: AOJu0YwMsKCL+88FhBkFFSSZ6iTmL6I7lMHjgH4wtOQkchZhrbNpkcqU HTZHQn9AkIToMGr0za1BFjoEAmhUeUm/eqWWI0vhxVfvoVv4uTe5VU9kYey8syaeC0hcmxdJiYt MnRKMXf7G8afEZ2JscMrnDIWePdLIeD5b6ca2yQ== X-Received: by 2002:a25:9392:0:b0:de5:4a94:b027 with SMTP id a18-20020a259392000000b00de54a94b027mr2063862ybm.53.1714124159108; Fri, 26 Apr 2024 02:35:59 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240416182005.75422-1-quic_ajipan@quicinc.com> <20240416182005.75422-8-quic_ajipan@quicinc.com> In-Reply-To: From: Dmitry Baryshkov Date: Fri, 26 Apr 2024 12:35:48 +0300 Message-ID: Subject: Re: [PATCH V2 7/8] clk: qcom: Add GPUCC driver support for SM4450 To: Ajit Pandey Cc: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Vladimir Zapolskiy , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Taniya Das , Jagadeesh Kona , Imran Shaik , Satya Priya Kakitapalli Content-Type: text/plain; charset="UTF-8" On Fri, 26 Apr 2024 at 12:20, Ajit Pandey wrote: > > > > On 4/17/2024 11:35 AM, Dmitry Baryshkov wrote: > > On Tue, 16 Apr 2024 at 21:23, Ajit Pandey wrote: > >> > >> Add Graphics Clock Controller (GPUCC) support for SM4450 platform. > >> > >> Signed-off-by: Ajit Pandey > >> --- > >> drivers/clk/qcom/Kconfig | 9 + > >> drivers/clk/qcom/Makefile | 1 + > >> drivers/clk/qcom/gpucc-sm4450.c | 805 ++++++++++++++++++++++++++++++++ > >> 3 files changed, 815 insertions(+) > >> create mode 100644 drivers/clk/qcom/gpucc-sm4450.c > > > > [skipped] > > > >> + > >> +static int gpu_cc_sm4450_probe(struct platform_device *pdev) > >> +{ > >> + struct regmap *regmap; > >> + > >> + regmap = qcom_cc_map(pdev, &gpu_cc_sm4450_desc); > >> + if (IS_ERR(regmap)) > >> + return PTR_ERR(regmap); > >> + > >> + clk_lucid_evo_pll_configure(&gpu_cc_pll0, regmap, &gpu_cc_pll0_config); > >> + clk_lucid_evo_pll_configure(&gpu_cc_pll1, regmap, &gpu_cc_pll1_config); > >> + > >> + /* Keep some clocks always enabled */ > >> + qcom_branch_set_clk_en(regmap, 0x93a4); /* GPU_CC_CB_CLK */ > >> + qcom_branch_set_clk_en(regmap, 0x9004); /* GPU_CC_CXO_AON_CLK */ > >> + qcom_branch_set_clk_en(regmap, 0x900c); /* GPU_CC_DEMET_CLK */ > > > > My main concern here is the AON clocks. If we don't model > > gpu_cc_demet_clk as a leaf clock, then gpu_cc_demet_div_clk_src > > becomes a clock without children and can be disabled by Linux. > > Likewise not modelling gpu_cc_cxo_aon_clk removes one of the voters on > > gpu_cc_xo_clk_src, which can now be turned off by Linux. > > Our usual recommendation is to model such clocks properly and to use > > CLK_IS_CRITICAL or CLK_IGNORE_UNUSED to mark then as aon. > > > Thanks for review, actually if leaf (branch) clock is ON, hardware will > take care of enabling and keeping the parent ON. So parent clocks won't > get turned OFF in HW as long as branch clock is enabled. > > For clocks which are fixed rate (19.2MHz) and recommended to be kept ON > forever from HW design, modelling and exposing clock structure in kernel > will be a redundant code in kernel memory, hence as per earlier > suggestion in previous thread such clocks are recommended to be kept > enabled from probe. Recommended by whom? Kernel developers clearly recommend describing all the clocks so that CCF has knowledge about all the clocks in the system. > >> + > >> + return qcom_cc_really_probe(pdev, &gpu_cc_sm4450_desc, regmap); > >> +} > >> + > >> +static struct platform_driver gpu_cc_sm4450_driver = { > >> + .probe = gpu_cc_sm4450_probe, > >> + .driver = { > >> + .name = "gpucc-sm4450", > >> + .of_match_table = gpu_cc_sm4450_match_table, > >> + }, > >> +}; > >> + > >> +module_platform_driver(gpu_cc_sm4450_driver); > >> + > >> +MODULE_DESCRIPTION("QTI GPUCC SM4450 Driver"); > >> +MODULE_LICENSE("GPL"); > >> -- > >> 2.25.1 > >> > >> > > > > > > -- > Thanks, and Regards > Ajit -- With best wishes Dmitry