From patchwork Wed Mar 8 21:35:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 66453 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp584556wrd; Wed, 8 Mar 2023 13:36:59 -0800 (PST) X-Google-Smtp-Source: AK7set8T961iFhpF1i8+M+fF0/n+2Txdg+ZyNUBqn6Mr26L1cIarlAHDOOE0ucKXZeoCxAxrnQmg X-Received: by 2002:a17:902:d2cb:b0:19c:be0a:83af with SMTP id n11-20020a170902d2cb00b0019cbe0a83afmr25639079plc.42.1678311419692; Wed, 08 Mar 2023 13:36:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678311419; cv=none; d=google.com; s=arc-20160816; b=gd9+OVB5z3e+JT0Xny0nki+HAoQqHLjSg7Vcs1hCGOsriHTTNRnQ9i2wDO429dYCxe J7klYSftZ0I+6De43kmpSGR5YhrgVCFRSupz5UgZKzeDCOqvufOA1DkN8dV7OVu69xxu isJtI03PAsZBRLwbaAj1GKaRs5hc7GURbAAocfVd9SkqPUgfE040L814coy2j6IcTV88 8UPyhzUArIiqiu0Mo3hIezljyQ0DeZ3qCkHtVL/+8xHFwXsPLAuIOIcEV1eIErQkL+He v0DFwizuS/SmGF1LbnLISsXzqYVTe9EhcgEbyotsVcbeVx7HjfHmmwDrFC/3yrrBBLq+ IgHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=QDlHCsdatk7h5R3zUsXpTRiwKW19DDuLF4HKqV/q1bg=; b=kKsIKR8PRb8/UnJ5goVCuKR8g8VCts7s5fOPQ6H/cByt87ebslPT9wRTRvjG7zIFHP sLiKNpxi2pK8CzGPkni9qqxl98VuNo60ae7RCLJ/HWcmWdh5iOZC84Tn+4XXxjQrxzl7 F9JSHwRvaRiBABfGc1NtPFNi7V4oDODlljj8i6CVDj9s7fPXoBa0voCujQai+nq8EJlL BLGJ++4yGgDyCQnWPPLFlrlVysJz70XkrL7/NaD8or+2/VUlaeN6fVJqo3ilmjya72Bz 4PYHGN+D6CVtBv5dZSgZCslLOfmHxSbzd3FOa0Rv4Bl81GYpUjpxMx1tocLdg2chLDgq kKjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=osg1Gpfi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w13-20020a170902e88d00b0019e2fb0a5ffsi18438625plg.46.2023.03.08.13.36.44; Wed, 08 Mar 2023 13:36:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=osg1Gpfi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230015AbjCHVf5 (ORCPT + 99 others); Wed, 8 Mar 2023 16:35:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230011AbjCHVfr (ORCPT ); Wed, 8 Mar 2023 16:35:47 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7462CEF9B for ; Wed, 8 Mar 2023 13:35:39 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id j11so23051380lfg.13 for ; Wed, 08 Mar 2023 13:35:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311338; 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=QDlHCsdatk7h5R3zUsXpTRiwKW19DDuLF4HKqV/q1bg=; b=osg1GpfiQPSnkCrXraQM+3UriA4cjKvMkix3J0/xqRUCIIoUUX4nnNhIrBmtBQiKnD gePP3GBZ6QMmX5q4kilek17tUpgbO1ASRe776L8tUVxqk3TmpwlNJzqKPURdyyHE/WMU BT3pPYibiXQlN6feiN2B+AInyVpl/Y9yXdo+9vMUnspdaubHww4SRB/18DqQen3eVzHC 0R/KeD5QV4ZI4LWlIg13vyRz+4oGYnfF1Ft7AH4oyqClKnkCxy8OZpYDUBzSdZq9ZffP M36yfO0hKGomA91p8WSsOY/mwYDUjVFDlVVX1y5VPQYoTYtu4tpFVSIKTcJ10eENQ1qD tQHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311338; 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=QDlHCsdatk7h5R3zUsXpTRiwKW19DDuLF4HKqV/q1bg=; b=7N1f/EA28mYtEYxM+VJhw782kqLiNMcjn47/7ckDHMtqiRalJhU6RFgOoRuRRknK4F g8uLgg4q/WNw86FucPl520khQ5XSYii66IrW58hmaeS50yZ+n9teJg4iZaqLX0k4/qBa D0xOCerZ76FymUkybC3tKW++dYl6CQcQJfS4lItkubPc8/Y5uZjHeXfLbwCeVcLoeIGt 0BTAuWxMzXYWZ+gtFWhyYBcGQ3wPQnCCR0UwuepDMkTHWYbW7zGcy5SRoeUcsLL2+8Dr 3LsRx8+w6opUBEt5VdvxL+zow1HTnaQ3xu0cClfQtSvGk2kGWZQQaQ/a0TOu1OdVPxm1 IZXg== X-Gm-Message-State: AO0yUKUPHwCAQUz+wyVZDo6Eds3IMYV2Omsv2vwrnJWCyMkSoDb+rw4N BZ6O5xGGUQs8PrHWL0hHbzW9rg== X-Received: by 2002:a05:6512:25b:b0:4dd:ab39:86e0 with SMTP id b27-20020a056512025b00b004ddab3986e0mr6214451lfo.27.1678311337931; Wed, 08 Mar 2023 13:35:37 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u7-20020ac243c7000000b004dc4d26c324sm2467479lfl.143.2023.03.08.13.35.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:37 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:17 +0100 Subject: [PATCH RFT v2 01/14] dt-bindings: clock: qcom,rpmcc: Add a way to enable unused clock cleanup MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-1-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=2006; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=kU+or0SIwjfCFe3CHtYMpTgzGECGUtYX8Fz74pRBjmw=; b=xakONkb1YLP0DXpf6jbByNh8PngvZtgp8nUR3XoamblbthS/l/94cTLlNZLqyAgOaLmx+zNacVua CppU+tiMDl4K7Y31exizgRwrFp/ZEBt95LxBUjQfHTTMDa5jS9yo X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759837075251441617?= X-GMAIL-MSGID: =?utf-8?q?1759837075251441617?= Disabling RPMCC clocks can be a bit touchy. If we can't guarantee all (or at least most) of the oneline peripherals ask the interconnect framework to keep their buses online and guarantee enough bandwidth, we're relying on bootloader defaults to keep the said buses alive through RPM requests and rate setting on RPM clocks. Without that in place, the RPM clocks are never enabled in the CCF, which qualifies them to be cleaned up, since - as far as Linux is concerned - nobody's using them and they're just wasting power. Doing so will end tragically, as within miliseconds we'll get *some* access attempt on an unlocked bus which will cause a platform crash. On the other hand, if we want to save power and put well-supported platforms to sleep, we should be shutting off at least some of these clocks (this time with a clear distinction of which ones are *actually* not in use, coming from the interconnect driver). To differentiate between these two cases while not breaking older DTs, introduce an opt-in property to correctly mark RPM clocks as enabled after handoff (the initial max freq vote) and hence qualify them for the common unused clock cleanup. Signed-off-by: Konrad Dybcio --- Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml index 2a95bf8664f9..386153f61971 100644 --- a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +++ b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml @@ -58,6 +58,12 @@ properties: minItems: 1 maxItems: 2 + qcom,clk-disable-unused: + type: boolean + description: + Indicates whether unused RPM clocks can be shut down with the common + unused clock cleanup. Requires a functional interconnect driver. + required: - compatible - '#clock-cells' From patchwork Wed Mar 8 21:35:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 66465 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp589490wrd; Wed, 8 Mar 2023 13:46:14 -0800 (PST) X-Google-Smtp-Source: AK7set8q974CFWlGsAQIlZmU/QRsLImpTfIautmGdAcX9wZnrrgpf8dr/ms1e0O5+/Uoh51p9d30 X-Received: by 2002:a62:1aca:0:b0:5e1:a3b1:966a with SMTP id a193-20020a621aca000000b005e1a3b1966amr16937330pfa.34.1678311973951; Wed, 08 Mar 2023 13:46:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678311973; cv=none; d=google.com; s=arc-20160816; b=d/JgQu2EutYtqCzlakC1f1H562Xt2QeWtYl0kcR/gFSeOjv675lgr8AZmhtYmP78xe ZDk+SWAsz0xcbUdkuNK4q++QN3OXLWw+RacsJDiEnjsGVkwJTYZwY0bH3zD6Z8A/ehRR tHmIzBcEduP1yOap2Sll51k8uTTto1Mta4YM9BCxI8z4ixHNa/Kf/Ftfs+Apx0uGtVPm FoBpF6x4NeZ8uOj1xfh1V0TYqJY6SypRr20hOCE0aKYXBgTWKCtFWkuXHiJIiObgLvTg XE9Uhd9w3NT7fkDmVhAZKtFmbV/pmJV9xn2AwWAzNhZahL50WmqUoqaJ6dwyCsdTZ8t0 6bHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=SOECaGmGmUJLrulLw8TRNrQNT4lkSkMI20VbWaQaVaY=; b=difZnGRmSmNNHXHUw2zkk4TwrRYJUzjFD2aqiBlTlbVlKjKeuqOwZG2GDX2yoiy1xv S+zhAxrkIBTN98mc4BW7p1ncUAUichCMzyyBTRxf7doGOwzIhyLs1zrizoJlw/9Oyxy0 9ZkCYavdm4+tpQMDFuc6KSgw5BlahuoJGGJNSQ6cb3cXKHeh0Is/ls017ltYfrCZZ5ZS NKeVn38lDnLhtCn1/ORi+uLFeMRXMqLE8G/HLpHSsf1CN5hAqtC2LCHRgqDnpIB5z8hI RV9/ct/SOCd1G5QyHvqhYsaSpgGGuVv3r4I52wGffH8S16lpHPm3C+EhdZOxjbcclijO 4yQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o2v3nZSR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h67-20020a625346000000b00592a19cde96si14731323pfb.369.2023.03.08.13.46.01; Wed, 08 Mar 2023 13:46:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o2v3nZSR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229870AbjCHVfw (ORCPT + 99 others); Wed, 8 Mar 2023 16:35:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230029AbjCHVfs (ORCPT ); Wed, 8 Mar 2023 16:35:48 -0500 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E69CD13CF for ; Wed, 8 Mar 2023 13:35:41 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id j11so23051442lfg.13 for ; Wed, 08 Mar 2023 13:35:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311339; 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=SOECaGmGmUJLrulLw8TRNrQNT4lkSkMI20VbWaQaVaY=; b=o2v3nZSRV6jX/ICAGftZdATJ2s6wCtxca6GFrbERkhh9MKuTWUSGF+BS2bz0fruDeY p6Tz9BBV0QTw44vdXR6hLNpREOYFMDUoklZE9yGtUmec+0noRMW7rU86LKQJHZYsyI2a rypoiclDLhzo2+DkRr9+/YTCI5syEXb71RRCosKKjs54FLmsTDaH0iBjFv2Egd7iMgqd 9RA59HOR0gQyDikhy8X/zS/Ehx+jPhm/A4bWv6UzHb4emXNMH9bxcYnDf2Hwd8N+KYcv N1kGQBANwqL8cVLv6yaMyeXFcLvUvCBlTm7c5+xOhgTnqD+cQH9f7oDL4Tpzb06icVfu 4lnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311339; 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=SOECaGmGmUJLrulLw8TRNrQNT4lkSkMI20VbWaQaVaY=; b=pl5d74STFCKn95s2ZLicQqEzYkLxFn9VCtZPA2b94FAPJtYjVGWd0I5qJhZFAn3BRs 8dvUutzpWoNG4HVhzklY7hG7XhGztbUm+mI+K1387cD3jrDVzanN1VSxZYaXznr2X8zD pTm+d5PZc7I1GJAGPb9Ng7wZ9JEFP0/EDZi9/Toyf7xotr/vksiObpkNDpPwMXB7MZrE V+jNQR9CRI/C2JTuU4lFUccypf45qiVW9XrkG35M5L3NyYs7xqEcpn3NQCcUfPLjJQfP lnj176J4xJafXm9D876G3bqYvpgc4Y3/E5L7QLSZs9FkXds293pVfmqmxVPzVqGn6/NN CgKg== X-Gm-Message-State: AO0yUKXyWMrdqb/ojh4DKTVcxn5me5vrGHD8+Q23YQIL5Oqw7oFFCGhS 3t4WfWQRVxgPkYkzk+gZvaDadQ== X-Received: by 2002:ac2:46c9:0:b0:4db:1bee:c with SMTP id p9-20020ac246c9000000b004db1bee000cmr4952816lfo.44.1678311339444; Wed, 08 Mar 2023 13:35:39 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u7-20020ac243c7000000b004dc4d26c324sm2467479lfl.143.2023.03.08.13.35.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:38 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:18 +0100 Subject: [PATCH RFT v2 02/14] clk: qcom: smd-rpm: Add .is_enabled hook MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-2-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Konrad Dybcio , Shawn Guo X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=1448; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=DkAvY529UR+RwkQzY1FO48/jck/x44pR7ssps7xiA3g=; b=bMTX86MhRue6/CH4CAoR6mX0UhkJTn6HwQaKXt995jwdXJIOSTvZ4jiIt70kDOEqeCI115aI/A1n ZdtbcESyAwGjcxMnj2Cdm9vW5rThMJ5JfMdD6oFC26GRd42RhZeu X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759837656438571593?= X-GMAIL-MSGID: =?utf-8?q?1759837656438571593?= From: Shawn Guo The RPM clock enabling state can be found with 'enabled' in struct clk_smd_rpm. Add .is_enabled hook so that clk_summary in debugfs can show a correct enabling state for RPM clocks. Signed-off-by: Shawn Guo [Konrad: rebase] Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/clk-smd-rpm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index 198886c1b6c8..ecacfbc4a16c 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -424,18 +424,27 @@ static int clk_smd_rpm_enable_scaling(struct qcom_smd_rpm *rpm) return 0; } +static int clk_smd_rpm_is_enabled(struct clk_hw *hw) +{ + struct clk_smd_rpm *r = to_clk_smd_rpm(hw); + + return r->enabled; +} + static const struct clk_ops clk_smd_rpm_ops = { .prepare = clk_smd_rpm_prepare, .unprepare = clk_smd_rpm_unprepare, .set_rate = clk_smd_rpm_set_rate, .round_rate = clk_smd_rpm_round_rate, .recalc_rate = clk_smd_rpm_recalc_rate, + .is_enabled = clk_smd_rpm_is_enabled, }; static const struct clk_ops clk_smd_rpm_branch_ops = { .prepare = clk_smd_rpm_prepare, .unprepare = clk_smd_rpm_unprepare, .recalc_rate = clk_smd_rpm_recalc_rate, + .is_enabled = clk_smd_rpm_is_enabled, }; DEFINE_CLK_SMD_RPM_BRANCH_A(bi_tcxo, QCOM_SMD_RPM_MISC_CLK, 0, 19200000); From patchwork Wed Mar 8 21:35:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 66455 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp584622wrd; Wed, 8 Mar 2023 13:37:09 -0800 (PST) X-Google-Smtp-Source: AK7set+iKUUfSVmdqQl5JzT0qcbykjKy6aAk1zqbsEJru/nqA3RAi0xCCTsGRj2GrZTKRGNfLCRF X-Received: by 2002:a05:6a20:4c0a:b0:cc:1c96:d2e3 with SMTP id fm10-20020a056a204c0a00b000cc1c96d2e3mr16033240pzb.47.1678311429668; Wed, 08 Mar 2023 13:37:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678311429; cv=none; d=google.com; s=arc-20160816; b=V0cxAZ6k/Ig3CzZG/VFFIf9pWrlMjWrBIH43ubUr1noRWqylO3TzclcuhL/rjEvHh1 CdGoDVaprTswkfaQ7bYefHi3F0pT05ofbY32dFXQQsLfYNSnF2geSLhkpaLHhVzNMDHI Ug4j3B5OpVqYEZUHnjzKvFYyLGA9vuDVP+qCD4S0Q+KUmcBheLY5F/ZO2WrQF6KKwLjw 1YNm5JVjVA2iaicLG8gMlQ9wEZneOgTtJlvTZYTPa7+yWkOvV0IW8D4NxH6uAWeii011 vqLfnFpa/K3lcvyn9ig2Eh1r2+pKkdfSGT3ZPkVJAlxhm8L35QaJ/zSdpy4s/n/clNLM 0QEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=hMJaPWZzvgr1zZRk25pniV8MNs32JGnZ0ctQITcox7M=; b=Eu3yn19blxy25s8SDQYXGfS/Pqh4mWRF9uvlPpvDyhzEO9nIEnL4J32RTA55CiVG6a Oy6t+KnvldC3oyRANH7ZYgk11IwyBmgis8ebqeN3/zkkWa2HbERn9WJx+pDM9LJuYGkJ fkGwqe0z39N8uzIuV/GlFR1jJ+qZOHy/w1GFSq/fvQ1+UTBiDS04qbu8rmBnIVXQB5mM RY7QAmQjueA9N/gDodNCEfU8jgZUYbsSao/WSxHsaCBRaSxIxY//Vsn6FLTXkB9nibgP TOLkru6VpQlusC+L6Jx4Hy3hImirgC8bhAtiNXoGqaz/zeXygofQuwcWHSkTczODSruF uWZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vKrNdtp7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z30-20020aa79e5e000000b0058bcb6283edsi15804507pfq.288.2023.03.08.13.36.52; Wed, 08 Mar 2023 13:37:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vKrNdtp7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229998AbjCHVgB (ORCPT + 99 others); Wed, 8 Mar 2023 16:36:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230058AbjCHVfu (ORCPT ); Wed, 8 Mar 2023 16:35:50 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5E60C9C2D for ; Wed, 8 Mar 2023 13:35:42 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id d36so19958906lfv.8 for ; Wed, 08 Mar 2023 13:35:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311341; 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=hMJaPWZzvgr1zZRk25pniV8MNs32JGnZ0ctQITcox7M=; b=vKrNdtp74XinQeNY4eMDGuSmvkyKQGDqeQBhsMhjY4fdPFriJ/A/gnKkP1o1Rj5hGd d17LdIQDyFuSpT2Vfj7n7jHcMdiuoTW/TlXkk2saJZraSak8jwZ4Q24GswuNvxiAG74y UIkMljkp3U+T6aBAVWMxiZCBNWyRgmu0YLRi9L8sGgJwaKegUSS8EDgULQ+IQ03gMFx6 l2fjXcX3reu/Cu0ptyee4UayN1EImRLVAhamofdEb9uEo3zSaVG7Ko97sziZIay7InL2 XuZXMX/aRgxC28XHPPNGYfZej9i+JhM/Hg2bsCWhnKvmC0bkRYhNQuyOSLjeTRXqhT5r tcFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311341; 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=hMJaPWZzvgr1zZRk25pniV8MNs32JGnZ0ctQITcox7M=; b=jjaJKtuOK7W3xl0tLfjxtD3H04x3lJp637lSPp0BEMy6QEwjr1Xp6/p2BQUw0p3p+x Ah+AxjC9tzQz8kaAFwvO/rKHnFGW0xZY5+KixKDcYEWTcprySXFlj8Yi0p7Pb7ZQuBaO O8bWvPo221T3Wpkr+nBjqEKGCgdSimYC+FsPy5sVPRNJNpCckQEwPvzL4j64uQeFOsDq ZXs8hMyCYiNfujUgqLYE4NkVMX2rvjl5C4LWwXA1CccGcEMPWtWs7SSg6lL6FTMt6GSI O9ELeJu39sK9YEjFGrP3lQG3NuLydzDangBydst+8MhLsLPjiLbbHanJTecT6bRSecfU zgNw== X-Gm-Message-State: AO0yUKVi46V9YQwV6vc6m9YciipTqDwO8YkJ+76xsu9mIn7RQevwpHYM ZccHpVJqr94ALpcxBG+ypnR2Wg== X-Received: by 2002:ac2:533c:0:b0:4dd:a7fb:1e7c with SMTP id f28-20020ac2533c000000b004dda7fb1e7cmr6210843lfh.3.1678311341007; Wed, 08 Mar 2023 13:35:41 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u7-20020ac243c7000000b004dc4d26c324sm2467479lfl.143.2023.03.08.13.35.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:40 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:19 +0100 Subject: [PATCH RFT v2 03/14] clk: qcom: smd-rpm: Add .is_prepared hook MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-3-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Konrad Dybcio , Shawn Guo X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=1482; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=IcjgjHunD3zMZaFeCfHoL5cnPI0PmUW34gmf6fJPVyQ=; b=XRRU/aPY7IT5XMd/T58u1InRETQd/B3Yhxj0yGAMrEQOfmdVugwndUVxyE9RQFkJpxKP4wWNbu/N yGcVWciwAl1WH/YY2FamRSLaf5lO4N4wNpnx5oA33Np6wonJwq7K X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759837085803508948?= X-GMAIL-MSGID: =?utf-8?q?1759837085803508948?= From: Shawn Guo The RPM clocks are enabled/disabled through clk framework prepare/unprepare hooks. Without .is_prepared hook, those unused RPM clocks will not be disabled by core function clk_unprepare_unused_subtree(), because clk_core_is_prepared() always returns 0. Add .is_prepared hook to clk_ops and return the clock prepare (enable) state, so that those unused RPM clocks can be disabled by clk framework. Signed-off-by: Shawn Guo [Konrad: rebase, don't duplicate the enable func] Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index ecacfbc4a16c..cce7daa97c1e 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -438,6 +438,7 @@ static const struct clk_ops clk_smd_rpm_ops = { .round_rate = clk_smd_rpm_round_rate, .recalc_rate = clk_smd_rpm_recalc_rate, .is_enabled = clk_smd_rpm_is_enabled, + .is_prepared = clk_smd_rpm_is_enabled, }; static const struct clk_ops clk_smd_rpm_branch_ops = { @@ -445,6 +446,7 @@ static const struct clk_ops clk_smd_rpm_branch_ops = { .unprepare = clk_smd_rpm_unprepare, .recalc_rate = clk_smd_rpm_recalc_rate, .is_enabled = clk_smd_rpm_is_enabled, + .is_prepared = clk_smd_rpm_is_enabled, }; DEFINE_CLK_SMD_RPM_BRANCH_A(bi_tcxo, QCOM_SMD_RPM_MISC_CLK, 0, 19200000); From patchwork Wed Mar 8 21:35:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 66454 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp584621wrd; Wed, 8 Mar 2023 13:37:09 -0800 (PST) X-Google-Smtp-Source: AK7set+TYKU0bFhE15T+zpqoDhR/TCZ4aFRKsj2OXJOaH+afPZemqpwMS051vZ9Mv9DeEDfrMDn2 X-Received: by 2002:a17:902:ed89:b0:19d:ab83:ec76 with SMTP id e9-20020a170902ed8900b0019dab83ec76mr14789654plj.7.1678311429493; Wed, 08 Mar 2023 13:37:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678311429; cv=none; d=google.com; s=arc-20160816; b=MyKVLGJGvHmj9rYwg09RnANPgXOnoUYK+u7dDY/342Dw896TeTyaGGCuBScO4L+dQU EV4X65ZACcVwyA3RTTbwGRFHHRoKGsHP9VkowNk1GyeDCNJpi1rIqlsdxIAEQkhCDdeJ 3pISOoekK6BqUSGm0DAbS3P06s+WjOco7yA3tu2oScSVeLLl8rJPH4TGzMzA++YEJz7C Bzsh00BUAtUXb6vFv5PX6R0ZXH46j/WfgDXxFvTtS67mZGddvuZ0s9LSWtRfCdtroIrg xsCScqTMt0fDTKZ3gZXI7CPAlKVMDIoVUN3I5zRKEZ2J8IJqu7/eFdsECCzw4OR8HWi6 cpDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=ZR8rEfH+mByVpllyIkEvGaJqUK/MTbgeGfOlnZZHumI=; b=kJo/KHxPQVDJMw+STG4bnUQboGGXe0UFgccGZwR9CvuL9GegD/CIK+ftg+JglKh23t mykXEVbawYm3iuiDYJAZFwwUVkK0V3vtza72nNn4NdZpYNs3x7fJLPKi/G3aJDa/uumh 0tiC4NQLpsT0iCobvK3VF1QuTqEUZ8snpXmHfFieg4d2RA2a9hGu/Ib7uf6SgJ5+mxL/ oB7G3G4L6//+hf47YvXpJHAOsPHdPXIXpfMywJA9xD7VvR2+pd+A3Wrw81eITPndvcEC ifYvB4dmWz9SSyRkJpPkNCvWiSlbDyvg2lBpooAOAIxIGpnshPJRezTzTjuiSWZFe550 fFyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j5mdZnIX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z19-20020a63d013000000b00502f60b85easi15377451pgf.875.2023.03.08.13.36.54; Wed, 08 Mar 2023 13:37:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j5mdZnIX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230059AbjCHVgF (ORCPT + 99 others); Wed, 8 Mar 2023 16:36:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229984AbjCHVfu (ORCPT ); Wed, 8 Mar 2023 16:35:50 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A2C4974AA for ; Wed, 8 Mar 2023 13:35:44 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id r27so23092426lfe.10 for ; Wed, 08 Mar 2023 13:35:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311342; 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=ZR8rEfH+mByVpllyIkEvGaJqUK/MTbgeGfOlnZZHumI=; b=j5mdZnIXSPZgZ84/ChHPJU3MRFTAFSRTVSFKGDnDq8LQZHHRpw6zKsGRmwb8B7nLUe t9RKmbMdGY8w7Vuotqvr2aKglsFlIJQT+BELcAjgQesTzQUek3uaoQ03uYkZh4tlSc7w 5t5FkAm8JPSG/RLCn/dV/bs6WyLPCtVd8AK3yop13ht3+3vTHA8OJOpCvBBjgfsGFZ7b ws3hIvpjUmG734VwrFACIlR7AmoXyX+i5UVoklHS+vxrKWR/jWqzvafsHQB+8Zj1OikC imP0UVpgyHObbiVoCmXO5AR8vmCo6MCHeurn973btqrBEToWyewl45YnD3T016gJ4+On oaTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311342; 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=ZR8rEfH+mByVpllyIkEvGaJqUK/MTbgeGfOlnZZHumI=; b=FHDoXgvXyeHdQaofrMRlk5dQ1jR5bzDLWDccbZlLf6g/NSQlYon4zNKJpdVWBMT/Uq 6ikeHmI2XpxulDzazuiW3aXCg0qAmmlnM97JwKBNQ8yO1EPFOp8O0/aHKCC9Fc+Oly9Z gVJ0UxOmRs+xOqjXIC5rFnF9GPkldg3ADkPRcQ3o5kIrrnGRgT/gvPl0Q0Hr/HemMmSa J0UGm7OHbDWoAmObJN3ItP2diqFwkFxnEttGfXjv01QQuw5CSWHzjXCz/fUw4yHTlSd+ Wf/3E6ayQxp6PDDs0LCStKGqDo3wAIvEaxp/Gu5ZFse6CqWFgI+EzhufXXH6uWogUEeU tlhQ== X-Gm-Message-State: AO0yUKV5KRkDtGCQnmgbS6CAdsje1JZ9xtV5TzJfOwn+VaAnmfPihKsA yn9XZOH9xy62QR2idMtc0KCxBg== X-Received: by 2002:ac2:593b:0:b0:4a4:68b7:deab with SMTP id v27-20020ac2593b000000b004a468b7deabmr5396112lfi.7.1678311342439; Wed, 08 Mar 2023 13:35:42 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u7-20020ac243c7000000b004dc4d26c324sm2467479lfl.143.2023.03.08.13.35.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:41 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:20 +0100 Subject: [PATCH RFT v2 04/14] clk: qcom: smd-rpm_ Make __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX accept flags MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-4-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=2532; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=XuAIaIbpiaJbVxAhaqMtXMVrCCmBcmYgJ4nDGrAeQno=; b=jZNigdsRXfdIB65SyKr65oVKcy+ixT8aE4ifRveJcZemRFeUe6X7/ib04zd35LNJEGWZm0kL1yI8 ug9NlicED7TK1xGd6sC07EquGHlLsUaI0XaRyQpieU97pGBPNVp6 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759837085588466534?= X-GMAIL-MSGID: =?utf-8?q?1759837085588466534?= In preparation for supporting keepalive clocks which can never be shut off (as the platform would fall apart otherwise), make the __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX macro accept clock flags for the active-only clock. Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/clk-smd-rpm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index cce7daa97c1e..72b1f010509b 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -67,7 +67,7 @@ type, r_id, key) #define __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX(_prefix, _name, _active,\ - type, r_id, r, key) \ + type, r_id, r, key, ao_flags) \ static struct clk_smd_rpm clk_smd_rpm_##_prefix##_active; \ static struct clk_smd_rpm clk_smd_rpm_##_prefix##_name = { \ .rpm_res_type = (type), \ @@ -102,12 +102,13 @@ .name = "xo_board", \ }, \ .num_parents = 1, \ + .flags = (ao_flags), \ }, \ } #define __DEFINE_CLK_SMD_RPM_BRANCH(_name, _active, type, r_id, r, key) \ __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX(/* empty */, \ - _name, _active, type, r_id, r, key) + _name, _active, type, r_id, r, key, 0) #define DEFINE_CLK_SMD_RPM(_name, type, r_id) \ __DEFINE_CLK_SMD_RPM(_name##_clk, _name##_a_clk, \ @@ -126,12 +127,12 @@ #define DEFINE_CLK_SMD_RPM_BRANCH(_name, type, r_id, r) \ __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX(branch_, \ _name##_clk, _name##_a_clk, \ - type, r_id, r, QCOM_RPM_SMD_KEY_ENABLE) + type, r_id, r, QCOM_RPM_SMD_KEY_ENABLE, 0) #define DEFINE_CLK_SMD_RPM_BRANCH_A(_name, type, r_id, r) \ __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX(branch_, \ _name, _name##_a, type, \ - r_id, r, QCOM_RPM_SMD_KEY_ENABLE) + r_id, r, QCOM_RPM_SMD_KEY_ENABLE, 0) #define DEFINE_CLK_SMD_RPM_QDSS(_name, type, r_id) \ __DEFINE_CLK_SMD_RPM(_name##_clk, _name##_a_clk, \ @@ -146,7 +147,7 @@ __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX(_prefix, \ _name, _name##_a, \ QCOM_SMD_RPM_CLK_BUF_A, r_id, r, \ - QCOM_RPM_KEY_SOFTWARE_ENABLE) + QCOM_RPM_KEY_SOFTWARE_ENABLE, 0) #define DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(_name, r_id, r) \ DEFINE_CLK_SMD_RPM_XO_BUFFER(_name, r_id, r); \ From patchwork Wed Mar 8 21:35:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 66458 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp584920wrd; Wed, 8 Mar 2023 13:37:58 -0800 (PST) X-Google-Smtp-Source: AK7set+vOMgEtZD9cP75/q1gOP6yqpvmbh6OsUUo035e+5I1TSucBpmzwpCeaUI+BpF/epwUgXG8 X-Received: by 2002:a17:902:e9c4:b0:19c:f7f2:6094 with SMTP id 4-20020a170902e9c400b0019cf7f26094mr17056000plk.14.1678311477881; Wed, 08 Mar 2023 13:37:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678311477; cv=none; d=google.com; s=arc-20160816; b=RfGoXlGnulnLikl+XgrJbnocQBqXP6PO3Xx27s4tPfHloJ4iD0YtqTN1pxYEQcrFZU TaHWm2iaKARsa+r+FRSn9GLSsBwCnaIMPFKDTb2uPxhFMbWGWdSTTA2mbu4LhJZEKAww fMMNWgFdV3mPet694nbnt8OPvkJSBEcQMI0aNnQuVjs+ifLsNDf7Jz+iQHwRpm8HA2aI aVagRphCqZ/sjRiAbYTD/pJ9jkJ+qXICW+aDcs78djxxfq8YnBWv2LPnpl5K9EpL9HMO XTMY4xQVW6UsLzD6Y6wtqf0AwIoqo9jda/W3Wv866SzszZncdJ5dJxZP//jLYqjSxzS+ 2j9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=ov5RMn4u4UzKJ3B2Go2X9BkWY6GJei++Q812Yrin8NQ=; b=gc+b64oGe6/fmh8WSICI9u5QhR/PiM6f+HhLrDjE3uR4k0BSao0qR5RyuXjtNQcTGc Q9h4HzrCfYjci4ZXruiqnA5162Ix5yAfwV4Z93/K3E+hVhe4f2qWODQ/ZyMVQbxRQ64R /OpaiICemcp4xbjZv5vKALUYSP4fDF5Nw5/Lf3hJEli1wVNLqM5ZDaTE5KFZIL4u6HN6 gJB68MMR1PTAzDRDxF2eg9PSULIDAaQYP5E9RjZU+eVOeRVPTcywn3LHrmcZ5Rsfhwd4 7skURfdkEosB98C0TQlTyYNSZ2XR49B8sDIdqqJ3fQc9kcMUYRshb7qq6hiJtr1656m6 b8Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AxhmL4Ha; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id le11-20020a170902fb0b00b0019935e9b09bsi14689650plb.29.2023.03.08.13.37.41; Wed, 08 Mar 2023 13:37:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AxhmL4Ha; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbjCHVgJ (ORCPT + 99 others); Wed, 8 Mar 2023 16:36:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229590AbjCHVfx (ORCPT ); Wed, 8 Mar 2023 16:35:53 -0500 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C5AED1AC6 for ; Wed, 8 Mar 2023 13:35:45 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id r27so23092501lfe.10 for ; Wed, 08 Mar 2023 13:35:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311344; 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=ov5RMn4u4UzKJ3B2Go2X9BkWY6GJei++Q812Yrin8NQ=; b=AxhmL4HahGAmk4iXonM1WZnW6wfLggY8ACu1c7y/UUUX50xPNa6ZMfCFXIdx9ySf9B Kp4CHTl5eVmBoqaiegAqMDHPGeA2jm281La5XN8hGZVQvfGFZPsXi/2R8Wx4Xqg8pSTL 7x2cD7elmtx62OdCkJA1uYcgy3YzpiMjMbAoD7eT5EpYnM5eBkIHm0gzGtFmbICOGZwc /pAJESYHr5wN7jd9vh8sNHflicgIO3Nt+KatIewTqS178ZSiBiquaBGAIsgUtUlZlLFf q4blRWTFq9zvFxeNLz39okmM+Fa7hlQK3WL5qijMd7pjfdcoe6xh2RrcbbRP+7fMpq2S SUvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311344; 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=ov5RMn4u4UzKJ3B2Go2X9BkWY6GJei++Q812Yrin8NQ=; b=01ZjTlXM+f3Q0w3eBbjIBPQCj+0VjU0lwEsKdEv4lcVppX4dCFDDvLmRfKO5GrBGOD 3Z842IE6C2f4mcpCeHiBqjyMi5rw1C/ppfvDwIoqI4dQ2AZ9Oyro6/fLfm4/wdw1TQRd ygjz1gJ4UwBOqdz+GryrImqdRjotEswrggNktY260C+EsdYXmiRP+zFUYOmgdz1yrKQf 6Eb4IsM+u3sbVVUNa17MIZgRjx6uUE3X6egYqznXEnbcILVfVJydVacoR5BK++GS+mR9 Z4GkQM5m21drLbCC/T3t+Ur83OsCRi21cyuc/3NsSHrJ36gJ4qzzc04rDyOLLXGa40dX oLmA== X-Gm-Message-State: AO0yUKVUbTpkUEvpFzHKlkoWoZHN6EAmNNDjAKmlnOInBGGRICzZ5cCg j5wnOSA6dkU4KFudedR+WtDl1A== X-Received: by 2002:a05:6512:38c6:b0:4db:387f:a3af with SMTP id p6-20020a05651238c600b004db387fa3afmr4619602lft.4.1678311343950; Wed, 08 Mar 2023 13:35:43 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u7-20020ac243c7000000b004dc4d26c324sm2467479lfl.143.2023.03.08.13.35.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:43 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:21 +0100 Subject: [PATCH RFT v2 05/14] clk: qcom: smd-rpm: Make DEFINE_CLK_SMD_RPM_BRANCH_A accept flags MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-5-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=1812; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=svZJYxWNeuanDoOsLpbm2ZL4k08Cxtikg953kjcomQI=; b=sWofPdTB+S2gmrrLLUFIgZQAJ2Dpw8GiAIqWBFrlUA0dFPLwJP/f1iFMOzWa5eP3iGN9mRFIVl6i PnKA34jlACMIaRLdI7hJ6pz6gH95zN0ugXHXujjpvItq48fx3w8B X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759837136120631675?= X-GMAIL-MSGID: =?utf-8?q?1759837136120631675?= In preparation for supporting keepalive clocks which can never be shut off (as the platform would fall apart otherwise), make the DEFINE_CLK_SMD_RPM_BRANCH_A macro accept clock flags for the active-only clock. Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/clk-smd-rpm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index 72b1f010509b..fec6ae4a8989 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -129,10 +129,10 @@ _name##_clk, _name##_a_clk, \ type, r_id, r, QCOM_RPM_SMD_KEY_ENABLE, 0) -#define DEFINE_CLK_SMD_RPM_BRANCH_A(_name, type, r_id, r) \ +#define DEFINE_CLK_SMD_RPM_BRANCH_A(_name, type, r_id, r, ao_flags) \ __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX(branch_, \ _name, _name##_a, type, \ - r_id, r, QCOM_RPM_SMD_KEY_ENABLE, 0) + r_id, r, QCOM_RPM_SMD_KEY_ENABLE, ao_flags) #define DEFINE_CLK_SMD_RPM_QDSS(_name, type, r_id) \ __DEFINE_CLK_SMD_RPM(_name##_clk, _name##_a_clk, \ @@ -450,10 +450,10 @@ static const struct clk_ops clk_smd_rpm_branch_ops = { .is_prepared = clk_smd_rpm_is_enabled, }; -DEFINE_CLK_SMD_RPM_BRANCH_A(bi_tcxo, QCOM_SMD_RPM_MISC_CLK, 0, 19200000); +DEFINE_CLK_SMD_RPM_BRANCH_A(bi_tcxo, QCOM_SMD_RPM_MISC_CLK, 0, 19200000, 0); DEFINE_CLK_SMD_RPM_BRANCH(qdss, QCOM_SMD_RPM_MISC_CLK, 1, 19200000); DEFINE_CLK_SMD_RPM_QDSS(qdss, QCOM_SMD_RPM_MISC_CLK, 1); -DEFINE_CLK_SMD_RPM_BRANCH_A(bimc_freq_log, QCOM_SMD_RPM_MISC_CLK, 4, 1); +DEFINE_CLK_SMD_RPM_BRANCH_A(bimc_freq_log, QCOM_SMD_RPM_MISC_CLK, 4, 1, 0); DEFINE_CLK_SMD_RPM_BRANCH(mss_cfg_ahb, QCOM_SMD_RPM_MCFG_CLK, 0, 19200000); From patchwork Wed Mar 8 21:35:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 66456 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp584752wrd; Wed, 8 Mar 2023 13:37:29 -0800 (PST) X-Google-Smtp-Source: AK7set/tS3H+Q5IARi19QNU5q988XU3+KRFBsJmZua8EBwIhbk7UcMZ4VwZtHpttlJwFeXesTNhr X-Received: by 2002:a17:902:cece:b0:196:63d0:a674 with SMTP id d14-20020a170902cece00b0019663d0a674mr23110831plg.9.1678311449657; Wed, 08 Mar 2023 13:37:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678311449; cv=none; d=google.com; s=arc-20160816; b=KFUXzR0B9a4qLVG5nXUJ/c0l1nAwTKBuGb0fOpxboIt3miK+iwAqWwWsFtlur0EiN/ WMGi6L5UZ0KpYSj4wr5LdrH5msnNajg/rJtdV9DZcwWyylZOVrBJimMBS78iVP979qi+ 2o6Tkj0hTLc7mMi072IxjW9/wUq2rOAryJG1pv5GG0WRRy9n52sQfmz+GkhOj6d7yGRu sxWoxlhux5YTlzM8DdAFVrtUO19Iii3BUbeP9b/PcRGMnQVQt23wqGqsJFqhSKtVPbFs qxajJqcAyNcul/zeXU/dgLbbCzSjqYL9j37jPxJVOxF5YXizlhQa/1sWgRIf7iyeMC++ yIOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=WwZMH96UXfkc0AccFCgdHWqtpm71+Gjc4i/Nm8NSEJg=; b=ZGZCpBlm1AB0trgtdg6kBgIYVMDgEJnMqSyyCnvQcRIVPxoWPtLzLD7Cq12GnlKCub vnlUllVeeoqwAFrtTfGCkcieA468Cxww24Y3WTxgoffwGtCHb7t8zXpIBxKWHa7PM47m Fx77zZcqNWOjMt8+L6ubdy3/+dmVdsAUcFvSCCl+zYbKUxgczkZN2RxSQcpu3DDUwkVe EjWNvfER3UBKZLciIA8abTQg0A+u7pnmn8prdGu6zzjWivgeUkZPonRYzG1aIf5Yq3rJ 0DV2kKJDVWDtXcsWqI8SiLAtgSIkJ6n46s/CkrBTTmOw7VtlGNjH6HhYNW0T/zINc+Kb 7g2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hXBEuXzG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c6-20020a170902c1c600b0019a5aa4d768si15369130plc.611.2023.03.08.13.37.13; Wed, 08 Mar 2023 13:37:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hXBEuXzG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230130AbjCHVgQ (ORCPT + 99 others); Wed, 8 Mar 2023 16:36:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbjCHVfz (ORCPT ); Wed, 8 Mar 2023 16:35:55 -0500 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DD38B856A for ; Wed, 8 Mar 2023 13:35:47 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id s20so23096163lfb.11 for ; Wed, 08 Mar 2023 13:35:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311345; 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=WwZMH96UXfkc0AccFCgdHWqtpm71+Gjc4i/Nm8NSEJg=; b=hXBEuXzGMdj72xSPbg/KZ0ZJ0aETajx9yHPyiwgOFt0X1hTP8zQd5MS0i2U5vFEwfH pPPAGpWf1GoL2gATieKsJ/f6RnWuWoSB05oiMl2XdIjnLSw6NFqKdb/tFR83zRtjPZry ayu0Y7ftEnndA1gN+kBzO+r9ThFsGWL2XiC7ylY3GhYup3b1CPA3SQTZujAX2+mwZzoJ vHhxLYUqJ+5kfO2DLCFPXLATsD+E1ZWoIETRgQ4w29wc4j8U9VkgshFBgs6nXYKiE/+1 z++PKMsRMGHzzrYxFm0ZsYGBw1wElZt3rdh7FG7mb+zk7LYiOhFskqmSkbKpdzShS5gO Hs3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311345; 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=WwZMH96UXfkc0AccFCgdHWqtpm71+Gjc4i/Nm8NSEJg=; b=zHH98M3U4Zf6ABdu5IexJeJVRF9ynp88nk7cmwSdygLvYwgEyBQqNSIyt0UOZGwnd5 dBCC6GknBl0hge/seCvn8r7kzqIdB+Bc0odOe0lyy7Ux3JDH8s0XaazKdXD2fCsK4VfY Ty5zWdEsX96ado4cWqNUghWoTDO4v1a1oFS/VkX1IlpZowmMa3Yg9IWBqpUAN/OgEz3t /GjcOpLI30dd1T4y+MM8mA3RE9guRuSeyXF1wjhc5/tpyFpsnGGMqjGU6UgAHldDvBB/ RXXloMLNpTIXyC/NhDBXYs1qZFIj9nlL0gJmlB2/ruko8VW8dHUk0jKvyGx9lcCWkNMG UqLQ== X-Gm-Message-State: AO0yUKXONstKuBNeU9RmVX09LrUMOocSBPdriY5A1c+VrGyvJS5bR5O9 R4/sdxEd6jlw3BcMSBPI94Gu1g== X-Received: by 2002:a19:f00f:0:b0:4c0:91d0:e7ab with SMTP id p15-20020a19f00f000000b004c091d0e7abmr4595915lfc.28.1678311345559; Wed, 08 Mar 2023 13:35:45 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u7-20020ac243c7000000b004dc4d26c324sm2467479lfl.143.2023.03.08.13.35.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:45 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:22 +0100 Subject: [PATCH RFT v2 06/14] clk: qcom: smd-rpm: Make BI_TCXO_AO critical MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-6-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=1209; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=TISC+Oc8V9fBm+Q+IBeIefGIjS6ebEWVyUTx7mIEAsw=; b=R+M8Tbyxgn5h+HC/KiEpepKUFCu2bNNp8TswNI/3zNht3TSAvrONTg5dU73dvGjmFn/8guhHpguL RBE7PiI7AhPCKKU6oJK30w2Zvsq0AjO1z03dGN3IB4jXAx9VGi8i X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759837106924819596?= X-GMAIL-MSGID: =?utf-8?q?1759837106924819596?= We should never let go of the active-only XO vote, as otherwise the RPM may decide that there are no online users and it can be shut down, resulting in a total, uncontrolled system collapse. Guarantee this through adding the CLK_IS_CRITICAL flag. Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/clk-smd-rpm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index fec6ae4a8989..9dc779360ada 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -450,7 +450,8 @@ static const struct clk_ops clk_smd_rpm_branch_ops = { .is_prepared = clk_smd_rpm_is_enabled, }; -DEFINE_CLK_SMD_RPM_BRANCH_A(bi_tcxo, QCOM_SMD_RPM_MISC_CLK, 0, 19200000, 0); +/* Disabling BI_TCXO_AO could gate the root clock source of the entire system. */ +DEFINE_CLK_SMD_RPM_BRANCH_A(bi_tcxo, QCOM_SMD_RPM_MISC_CLK, 0, 19200000, CLK_IS_CRITICAL); DEFINE_CLK_SMD_RPM_BRANCH(qdss, QCOM_SMD_RPM_MISC_CLK, 1, 19200000); DEFINE_CLK_SMD_RPM_QDSS(qdss, QCOM_SMD_RPM_MISC_CLK, 1); DEFINE_CLK_SMD_RPM_BRANCH_A(bimc_freq_log, QCOM_SMD_RPM_MISC_CLK, 4, 1, 0); From patchwork Wed Mar 8 21:35:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 66457 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp584790wrd; Wed, 8 Mar 2023 13:37:36 -0800 (PST) X-Google-Smtp-Source: AK7set8DWHT+GKGTKTKoxaNo66a+DQf8lk/onl/tm1x7bSbR421A5uMA20rC8jfp4q8IRee7ui8i X-Received: by 2002:a05:6a20:8f08:b0:c7:6a98:5bdc with SMTP id b8-20020a056a208f0800b000c76a985bdcmr26901730pzk.16.1678311455864; Wed, 08 Mar 2023 13:37:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678311455; cv=none; d=google.com; s=arc-20160816; b=ozVSUK7L7fT9hD2+a0k1uqrce5bri6R5BGdU3fOtFhGRfeDEkbH6yxEEVn5LnV759a n9MOFXcG/yJIrPIWQxrgneb6uw/boECXiXXCVrUF5Dzruu2R+MTCPd+OXmlHk0n2uKta RYS+wn8vEFmzgan32xw0ELlGOpz09IIRzkVkBcy+Le/S0GtjunJl+LZpmQ0WBZQ8Ytrv pPe+mLsuOzQiUL0LbUOTgooYU38EWlx1a5QwWw4kCU4JZbNuC1Fphb7XmJgXq03RRfN0 tAUv/DVong9EMeMfQ3lvVtF3oJG6/0j4gm+HQvokc4kp4E6fcfvVxRbfFdjNrLBFRe/0 rdYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=TQfh2WbVBXCGhONYJZDP8O9PA2kbZ/WsteDRJW+CEEo=; b=AoPu2RvyTAz9bfi3/Mulbrkcn1ohVYbvEm1Yc2ADnXimiDmyq1AqtB/x5/muOpS3Fn fj5AkqLmOImg6LMSIjkyU7zJQ67uC/wW3FcQWeGeQevmnLLhpWVDd3fDgFHzj7aor1AU rrA5eMkpRuIJvgoUqEXruh6YppLTp0q8PDejlUSkJeCDvmZGqMtvo5KQ5oFkwpxxoKMa KNn7aOr40AsBU8C94m+pO+HJQ0teBj2XvBjcaGfN75C4fbtStmfv8CAwlksVwuGPr6mp Y+QLpgtRm7dryup2at7TzPIvkFbuWfgKEFTcGIyWuwpFWEbsExKRChJJWCuUsfAXtfoS AF2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jlT64jGn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n127-20020a632785000000b005074d06d839si7800676pgn.249.2023.03.08.13.37.20; Wed, 08 Mar 2023 13:37:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jlT64jGn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230273AbjCHVgS (ORCPT + 99 others); Wed, 8 Mar 2023 16:36:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230107AbjCHVfz (ORCPT ); Wed, 8 Mar 2023 16:35:55 -0500 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A458DD2932 for ; Wed, 8 Mar 2023 13:35:49 -0800 (PST) Received: by mail-lj1-x230.google.com with SMTP id g18so18052390ljl.3 for ; Wed, 08 Mar 2023 13:35:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311348; 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=TQfh2WbVBXCGhONYJZDP8O9PA2kbZ/WsteDRJW+CEEo=; b=jlT64jGnX9EyFQbSCp7Bn017VtmEaLUeLCtmD5RVnxofRuyJmVNspcSNivRnK5XL5L +kBcOEEzSDuEgU7b5i/s+wlOoTNWHuiLKd4Lw5kKvZL0hG0JCt0zIbjQCb4odX3G2+tQ Z2D7WcIwQMkP+fkb81gxKNyp9oIhxobO/7OB9PYZYrKVBBoPNLcz+va9hOaC0aBhIMkJ Bkfx/OMZXVCo4A9m/mpkZka7E1WvILbGrlGC4xwN9JuOCdZ8XxWxKJ7GlNNB/Z/SWd1T 7VZBsAfX9UEgiJcCeJ519HuSqoZCQVsLfiVqCJgOhlhdSfp37F80B5hSzlbW5T7J3JmL 6yZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311348; 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=TQfh2WbVBXCGhONYJZDP8O9PA2kbZ/WsteDRJW+CEEo=; b=e/QZEZcQ4vz8P5JwhovWmN+Xucd8/9SXKthO0iNj+JYIOGApzBPngo7bhRDSeTtwYO dk77oCB1t9WfGkcxXtYdMNFXzhQLqirsHm7HowOYiy/AA520C+2rLScSriqLC6IC0/eJ SOd9vDf1NKLOb5w2SinU2DILUS/MahKeFaF2XJS6kf3DRXYYq2MzvN9nAicDkXLKOSAy rbvWGKHzqf18UJrQRJBr76ppymAVbwOh4hwDfd990gvopSLWXsQchHmdpqrWbOA/Sn+T ih87LD09CKGSo5tUjVlhlIIPzWGwwE1Qx8EZBomdEYso1TxZhxARJB9ECWWiPyRKEHb1 qoUw== X-Gm-Message-State: AO0yUKWOMrk64MXQKbWIl8OkHPXSW4JfJtm3Uufkcq5jZ0hDOxfp8NNz QY/teMA60q2tve0kz2aF8zJERA== X-Received: by 2002:a2e:7810:0:b0:295:b005:1d56 with SMTP id t16-20020a2e7810000000b00295b0051d56mr5751684ljc.17.1678311347868; Wed, 08 Mar 2023 13:35:47 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u7-20020ac243c7000000b004dc4d26c324sm2467479lfl.143.2023.03.08.13.35.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:47 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:23 +0100 Subject: [PATCH RFT v2 07/14] clk: qcom: smd-rpm: Make __DEFINE_CLK_SMD_RPM_PREFIX accept flags MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-7-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=1880; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=psKSvGQDNyeXFzjuSkxyveilkS0EXbnLPmqC1X+KBDY=; b=BNP9g6R4cFS3/Yrb9t5P/MOac0VdgbxoI+qmXh6hIoCVitEsxsgiU5LyXmHV31X+F2mf/Q0b+636 4HBTf54rCPB/sF1gXBv7ClninZknYlvqL3ULKsdw8p1TJd1D0NJV X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759837113427557661?= X-GMAIL-MSGID: =?utf-8?q?1759837113427557661?= In preparation for supporting keepalive clocks which can never be shut off (as the platform would fall apart otherwise), make the __DEFINE_CLK_SMD_RPM_PREFIX macro accept clock flags for the active-only clock. Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/clk-smd-rpm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index 9dc779360ada..ddb4268ba2a5 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -26,7 +26,7 @@ #define QCOM_RPM_SCALING_ENABLE_ID 0x2 #define __DEFINE_CLK_SMD_RPM_PREFIX(_prefix, _name, _active, \ - type, r_id, key) \ + type, r_id, key, ao_flags) \ static struct clk_smd_rpm clk_smd_rpm_##_prefix##_active; \ static struct clk_smd_rpm clk_smd_rpm_##_prefix##_name = { \ .rpm_res_type = (type), \ @@ -58,13 +58,14 @@ .fw_name = "xo", \ .name = "xo_board", \ }, \ + .flags = (ao_flags), \ .num_parents = 1, \ }, \ } #define __DEFINE_CLK_SMD_RPM(_name, _active, type, r_id, key) \ __DEFINE_CLK_SMD_RPM_PREFIX(/* empty */, _name, _active, \ - type, r_id, key) + type, r_id, key, 0) #define __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX(_prefix, _name, _active,\ type, r_id, r, key, ao_flags) \ @@ -117,7 +118,7 @@ #define DEFINE_CLK_SMD_RPM_BUS(_name, r_id) \ __DEFINE_CLK_SMD_RPM_PREFIX(bus_##r_id##_, \ _name##_clk, _name##_a_clk, QCOM_SMD_RPM_BUS_CLK, r_id, \ - QCOM_RPM_SMD_KEY_RATE) + QCOM_RPM_SMD_KEY_RATE, 0) #define DEFINE_CLK_SMD_RPM_CLK_SRC(_name, type, r_id) \ __DEFINE_CLK_SMD_RPM( \ From patchwork Wed Mar 8 21:35:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 66471 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp593645wrd; Wed, 8 Mar 2023 13:57:41 -0800 (PST) X-Google-Smtp-Source: AK7set/z7unkwU2/24059lQrVs0DzN54wqEujW2TOS+vEbMgl5qjaGp80ciJwr93L+KQCxLgMcqu X-Received: by 2002:a17:90b:4c49:b0:237:99b9:c415 with SMTP id np9-20020a17090b4c4900b0023799b9c415mr20953148pjb.38.1678312661614; Wed, 08 Mar 2023 13:57:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678312661; cv=none; d=google.com; s=arc-20160816; b=enqk8FM27WxgPkCVoQmIPlvUhRzSq8WsZlFWlA62Wd3JGAzOX4q6qJxciaCTZcOKVB D9giIEsQe8RtdEDyezOVviydfabRu1wTb1yfZ7rXDng+NjwfocYd9lQs10NqltV8E0HR MseR0jNJegJjJMhha1j7rABDkAoj6sjsKS0d+Oq0U52Flm0PdJADqM4Ay10hu2cT/EzS pQV47/z9alxXMTtNGoSYnzIGRJ65xhvKUWM2wuapwTKRNy9sPHhYayxfScrLncdNj6oR NHDsjxTprgli4+0OVPqSAxBeyBEktzT/mptnp8inxyiPUmyO68bawd0o2eKBsWgEKXm2 yF3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=fCbN4RipXloOvl8HD4CkfkOTvrEB1N/g8w5o4Jrwa+U=; b=vOd1bdp02MQmgauQobFl10YOKO6hVQRmCPJfJo/wnTko/GvsjXd9HGMkFMCGe18BHK 27FQoMnq8Azrb1kK+qCfAGjGl3nQydSfR+3UFg/0unUsl1AvVwNtOVQl+uIbjRCgqqWi fC95L2KUQVCNoDbFvl0TEmVzrCC6F7OO2R21TFHYe5iA7eeYI6co0x9ZBVv9OYoF5fqu FbjrUPW0Z6ivUEsx2gSuuZmmF+oujRPOc+EYBFmdG681bovEX9tTeZNzzFnqfYjoW21T EDasrxhqLOlb6ChwpliiucJRpiLJErJiBwvTiiQ9a+EwdB80aRbBgu5BkGO4AYr3Qfjr suHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q0uR7+OI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j7-20020a17090a694700b00233b583bf5fsi459265pjm.74.2023.03.08.13.57.03; Wed, 08 Mar 2023 13:57:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q0uR7+OI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230137AbjCHVgV (ORCPT + 99 others); Wed, 8 Mar 2023 16:36:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230110AbjCHVfz (ORCPT ); Wed, 8 Mar 2023 16:35:55 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E52FD5164 for ; Wed, 8 Mar 2023 13:35:50 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id g17so23135703lfv.4 for ; Wed, 08 Mar 2023 13:35:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311349; 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=fCbN4RipXloOvl8HD4CkfkOTvrEB1N/g8w5o4Jrwa+U=; b=Q0uR7+OINHQuP91/EZXRdbCXk+J6inz2D6xS2kFEsEupu3Hy0y/l5jff0oTzfm2Vj2 GCPpj5G8+sC4k/2Z3NQeQEQjIjnpcuMzRlPGsKC88sWR1D6s2Fx8ZUFDb+RTNrkyPYIz v7LRe7D7D5CUlrKFrGrQNC3cRKr/sJpJwri0rUCMR+YOhBhINzedx7lSLty/MHGmZ3W+ mkIUmbFfCS0RmFdhlngtGrxVgNgUuUcmWX8qMqPGpKYweg3Dkq7rlbKF4holXfiPVdLL O0UYcSvVbgUOEHGRi6oqNgxKEaPrRn/cr8ncLlMCrgB7vOAhf3yLDRgMaYeKDfX7o7+q Xq8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311349; 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=fCbN4RipXloOvl8HD4CkfkOTvrEB1N/g8w5o4Jrwa+U=; b=UkC0O7Rdv8mLL5VmiI1NG5S7i7DyiHJEvlofMpKgjsiBqXYWGebHH3n5XAmZgAGC2g Rctn0cARwbTmsphhA3ntZtrWXJhuD5UC5ruE32ojZMwI40kPgNjeQh+rvnr3Ew8XcK7i AGVCxT8jX+AhiwTzHhzQmWMTVR+9rk0HqOdOw3b7yi2eynEOInBUnToa2RjMVBgieSPh eMfkJpA0SLDnsZNtGJS+XgrvRjdjTbAYHgVGIVD7RVlkJcP/ONX8TO2eU8vp2NCKitT9 HGZqUksuq2EhgzQ33mYQHpmXeBw66FPX51u8vB7KXF/HV9NbDiHyekfz3KymiUptE3Zz 2tQw== X-Gm-Message-State: AO0yUKW2zbfNJ/5ffAKxc4k2s1dX6YlB0fezrvfOtv01Y2Ce/xxtJlO8 wLg+bt51ZEtPmxrqR6nIkjC+Hw== X-Received: by 2002:a05:6512:3c3:b0:4d8:4f53:37b0 with SMTP id w3-20020a05651203c300b004d84f5337b0mr5071270lfp.41.1678311349794; Wed, 08 Mar 2023 13:35:49 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u7-20020ac243c7000000b004dc4d26c324sm2467479lfl.143.2023.03.08.13.35.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:49 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:24 +0100 Subject: [PATCH RFT v2 08/14] clk: qcom: smd-rpm: Separate out a macro for defining an AO clock MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-8-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=1025; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=b14AEjTLwjLgGEk78F1dpInwcT5yQSs+pXHFwVDxjG0=; b=YZjjRcIZTzgaqY6x0UbgV5zzjW3IjnbHE+/bhMHyCC8csrAHASH2iqQHODhNkWPsdUYxL9opmkSO DaqekFNQAg2ytq6y+M6qXA23HqLqYCzktQv6Ua1BlvLrdvoTN2To X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759838377625673928?= X-GMAIL-MSGID: =?utf-8?q?1759838377625673928?= To declare a keepalive variant of a bus clock, it will be useful to have a reusable macro which will ease defining a keepalive variant of an AO clock with an IS_CRITICAL flag. Introduce it. Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/clk-smd-rpm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index ddb4268ba2a5..eb7781e5c8c1 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -44,6 +44,11 @@ .num_parents = 1, \ }, \ }; \ + __DEFINE_CLK_SMD_RPM_AO_PREFIX(_prefix, _name, _active, type, \ + r_id, key, ao_flags) + +#define __DEFINE_CLK_SMD_RPM_AO_PREFIX(_prefix, _name, _active, \ + type, r_id, key, ao_flags) \ static struct clk_smd_rpm clk_smd_rpm_##_prefix##_active = { \ .rpm_res_type = (type), \ .rpm_clk_id = (r_id), \ From patchwork Wed Mar 8 21:35:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 66475 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp596785wrd; Wed, 8 Mar 2023 14:04:22 -0800 (PST) X-Google-Smtp-Source: AK7set/iwnRwqUIit/qUP0hMiE5Jv+/Ts1ooIBc1D91EJaSQg6eUpxAB039nAKLosQm/THkrDX/g X-Received: by 2002:a17:903:1103:b0:19d:778:ff5 with SMTP id n3-20020a170903110300b0019d07780ff5mr23385063plh.15.1678313062215; Wed, 08 Mar 2023 14:04:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678313062; cv=none; d=google.com; s=arc-20160816; b=K6LSk9DHj1k4eM0gDuF/MNOBJ5LmokuY0TKby13k1sWG9rL+PIIpLWgXoRYAcniFb+ ZwWyAUgp8Sazp1yIR4DN0r+1Uxj/VRcNcb5V5v5J7kG3ObMq0aknBRdx8AD0uLtUek3j zhlTdgvw7/sANlVEgzsrHeBFVPuJEvD5zcVLl6puDjr9meMTHTiu5drAg+1uFD5Ai+Yx ZKs/TiU++bMHx+QnS9Ns6TKA2X/9sTeWeuGy/R5NuBF1n/sVolDjt+fgXxptcxCN90x1 YSmEOFQPgj8yu/dWNJO8zMLBAjny8QDK6YYfRXykys4a26JhnZdnWgZS77jitEiIF7ch MAyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=/go9JzzVOEsVKPzeAceWp3TS35nZ2mbESw1jgSMGm7A=; b=MBU3N9VhfthFeSHjmaOa5WjlrcuYnTU0PLdocBIYh5nofmq4ruwwB4Pxsu2kUF5p4U XFgpjVuf//TEfXHEjtDJsZQu424VKK13168tT72wLvSa9ZMymjivkLz0YEpcoLfW5cG2 WWpMUu/yzgvYQEjoE2ZmYeyqY1gt8izeMgPnjtB8fduRrvcOaG+cE2cIb4UwKuvsYORe mC6vU60RlnXmilvdUYQzu7oFMjjLYE4e8MXMpTl5C+iNdiRFY1fVc9PsBL8RjP3Le57C x3kEusFpv5Z7dfvi+HgtL+saYMyw4g9aCPFvR7GGc14ZSJm0Qe8eGUz9CM85KPsPSYFe gdZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="y1r7IR/q"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h185-20020a6383c2000000b004fb647a766dsi16286701pge.7.2023.03.08.14.04.00; Wed, 08 Mar 2023 14:04:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="y1r7IR/q"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230147AbjCHVgY (ORCPT + 99 others); Wed, 8 Mar 2023 16:36:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230091AbjCHVgI (ORCPT ); Wed, 8 Mar 2023 16:36:08 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08B28DC39B for ; Wed, 8 Mar 2023 13:35:52 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id g17so23135772lfv.4 for ; Wed, 08 Mar 2023 13:35:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311351; 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=/go9JzzVOEsVKPzeAceWp3TS35nZ2mbESw1jgSMGm7A=; b=y1r7IR/q5CFB+NwNRrjeOgw5mcgy6SiAP4aq4/6uUugMPqIEkqrjka4MJovtVPukAF KtjQCWEh9dDUBqPQA9A4S7UT+t+FBa5pSCbrC0fiZhIKlITgO622Vfmpa2RVgdFtlz/b OWGm55WlYQtq5LoEBJultPT4Tff4KXJS8GEJgbnE9rS/VN7UwD6YRqEDEecUb+A2FmWU 13pImcnL1JbaAdAdcI2QmXGce/DRUOnEhUcPUXzAOvPOx19QmeBe+BGAxEghssfzCNLn upVManq9skJmwnplxBX5CudGvJSkxVkzwloS6kvE3imD96UWE61rlEB2wDD+DGFiGr5B npFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311351; 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=/go9JzzVOEsVKPzeAceWp3TS35nZ2mbESw1jgSMGm7A=; b=jFiBeeYd8/ktYhvcRoZDdUbOHQnruy1IAYNA46j7USD1hTTM7/snW3bUXKUNtwt61w COQlg6wv5iR9DlkQHhPqqZ+wta3NonMtzb5TRLafI45Dp5qOvUCiILXLjc8DZGsMqidD ymnqvhwvl89zEdeHjW845wwLJ1fy3dUIHtP9FUkOM4kw87DQMNjoHfkSz+krameqqGLj B9QQt/rf9l+aKJyeVjjPbOqDSQutW5PxgZLY081CAPqASlvLcxuM/DIUihS6cfTv6Q88 LIwSZ8zFN+G84fy/KsXHki9XyZf/pBOMj9AsD1DXzb1ScxmcEwuu/rhqgCb+TJC8A9l1 6Yeg== X-Gm-Message-State: AO0yUKVhb2KzoyyMKwhg7tSOeUiU2lkC2TnDFAaSxPEoqNF10SzppbLO OGjxEexOYFOPzGAxqqNk/Buj5Q== X-Received: by 2002:a05:6512:401d:b0:4e7:ff1c:6030 with SMTP id br29-20020a056512401d00b004e7ff1c6030mr4353486lfb.15.1678311351542; Wed, 08 Mar 2023 13:35:51 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u7-20020ac243c7000000b004dc4d26c324sm2467479lfl.143.2023.03.08.13.35.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:51 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:25 +0100 Subject: [PATCH RFT v2 09/14] clk: qcom: smd-rpm: Add support for keepalive votes MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-9-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Konrad Dybcio , Shawn Guo , Taniya Das X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=3522; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=PET/xgo25kPZz4y++jzQYNkadiG9KbkszadHqMCSmYo=; b=U8c6gZZepRlLHsxJCUUNeNSgs2R1pXwK8Oz0lee09UzA9sQohyMnpsOokWw2mt5ez6+UA+8waarz 1XTH+4oZBjlT8ZUcGNF9pFFN0kJ4hArj/ANRqAQUEIswdP4QS8cl X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759838797497237438?= X-GMAIL-MSGID: =?utf-8?q?1759838797497237438?= Some bus clock should always have a minimum (19.2 MHz) vote cast on them, otherwise the platform will fall apart, hang and reboot. Add support for specifying which clocks should be kept alive and always keep a vote on XO_A to make sure the clock tree doesn't collapse. This removes the need to keep a maximum vote that was previously guaranteed by clk_smd_rpm_handoff. This commit is a combination of existing (not-exactly-upstream) work by Taniya Das, Shawn Guo and myself. Co-developed-by: Shawn Guo Co-developed-by: Taniya Das Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index eb7781e5c8c1..d89918f9ae60 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -45,15 +45,17 @@ }, \ }; \ __DEFINE_CLK_SMD_RPM_AO_PREFIX(_prefix, _name, _active, type, \ - r_id, key, ao_flags) + r_id, key, ao_flags, false) #define __DEFINE_CLK_SMD_RPM_AO_PREFIX(_prefix, _name, _active, \ - type, r_id, key, ao_flags) \ + type, r_id, key, ao_flags, \ + _keep_alive) \ static struct clk_smd_rpm clk_smd_rpm_##_prefix##_active = { \ .rpm_res_type = (type), \ .rpm_clk_id = (r_id), \ .active_only = true, \ .rpm_key = (key), \ + .keep_alive = (_keep_alive), \ .peer = &clk_smd_rpm_##_prefix##_name, \ .rate = INT_MAX, \ .hw.init = &(struct clk_init_data){ \ @@ -170,6 +172,7 @@ struct clk_smd_rpm { const bool active_only; bool enabled; bool branch; + bool keep_alive; struct clk_smd_rpm *peer; struct clk_hw hw; unsigned long rate; @@ -198,11 +201,16 @@ static int clk_smd_rpm_handoff(struct clk_smd_rpm *r) .value = cpu_to_le32(r->branch ? 1 : INT_MAX), }; + /* Set up keepalive clocks with a minimum bus rate */ + if (r->keep_alive) + req.value = cpu_to_le32(19200); /* 19.2 MHz */ + ret = qcom_rpm_smd_write(r->rpm, QCOM_SMD_RPM_ACTIVE_STATE, r->rpm_res_type, r->rpm_clk_id, &req, sizeof(req)); if (ret) return ret; + ret = qcom_rpm_smd_write(r->rpm, QCOM_SMD_RPM_SLEEP_STATE, r->rpm_res_type, r->rpm_clk_id, &req, sizeof(req)); @@ -438,12 +446,29 @@ static int clk_smd_rpm_is_enabled(struct clk_hw *hw) return r->enabled; } +static int clk_smd_rpm_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) +{ + struct clk_smd_rpm *r = to_clk_smd_rpm(hw); + + /* + * RPM resolves the rates internally. All we have to do on the kernel + * side is ensure that we don't accidentally put down the keepalive + * clocks, which could happen if they received a vote below 19.2 MHz. + */ + if (r->keep_alive) + req->rate = max(req->rate, 19200000UL); + + return 0; +} + static const struct clk_ops clk_smd_rpm_ops = { .prepare = clk_smd_rpm_prepare, .unprepare = clk_smd_rpm_unprepare, .set_rate = clk_smd_rpm_set_rate, .round_rate = clk_smd_rpm_round_rate, .recalc_rate = clk_smd_rpm_recalc_rate, + .determine_rate = clk_smd_rpm_determine_rate, .is_enabled = clk_smd_rpm_is_enabled, .is_prepared = clk_smd_rpm_is_enabled, }; From patchwork Wed Mar 8 21:35:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 66459 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp585271wrd; Wed, 8 Mar 2023 13:38:06 -0800 (PST) X-Google-Smtp-Source: AK7set/dJAVd4m1mjwpvwHMbz+dvtrLq46LF6Eu6aKsSYFkoAeS9qXjek0Qu2iDD0s6p1l/T2GOy X-Received: by 2002:a17:903:1103:b0:19e:6c02:801c with SMTP id n3-20020a170903110300b0019e6c02801cmr23193243plh.14.1678311485813; Wed, 08 Mar 2023 13:38:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678311485; cv=none; d=google.com; s=arc-20160816; b=T2M30/MqoURLSim1nb1vikc9PWrG3qZd+RaWhk1ZJNbLr+MkOdjCphTtqML8TQSbRd 3bly0cqMe5PjqcC+R4uA9cYEXvc6zqezyxBVe7bI4CrviWyDzZvSMcW7aqrR1c153sa8 N5z1Gg103hSSIz/C5zi3z7KR/M9ojFifdP5NpES1Dc1M6wiZ2PIQzTP2Ak7jDRTmEnOL PGdLF5cj8NhkGwT9c5Y3h+4e25T87w6kelQkKhLBdppe4/BakOnvfJ5V7btVgjPyk5DE c7bmzl1b6YGXUm4NM1LjSIFgnYOB2l1/WRPExBnfH/HXy7DJlTuJAW9NwtI8Bfc9YEQf qzwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=tTT9T3ZA8o58JTVSfKP4mFmGSY9L0FD5ME/SSc1VeoA=; b=ignU+8dUN/XskTVbx8IMxkP1NvSnv+jS/awvjzQOqFEXY+2a4Zov4ivb8JaQvYKgVi WsYIiUecgCvOkk57ZgeU6jDy6QDr6nKyMMOKjJPW2KtCXdWjsLsiNmG9DlJeF5bGUObO dB86CO0OBbAEJBqDoQ7+1B2s8ztuLUZ/8NHc8Zmy7hV+tqgpcTvevZrrk7BX8SmayABH we5TR83d/kCUsKYHK39T6xe8BPuj0xFdBGd2Yowdo3CR6IOoLtDMF5cHdQip05SQ1mEz oeR59PDVacZGvNhjw72ZXjewU3OUY/u41aVHpmjKVppOrfZYSvLYt4uBstIb2wK6szv7 C6Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vDB0yPgj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id je6-20020a170903264600b0019d20f88171si14999700plb.54.2023.03.08.13.37.50; Wed, 08 Mar 2023 13:38:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vDB0yPgj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230221AbjCHVgl (ORCPT + 99 others); Wed, 8 Mar 2023 16:36:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230205AbjCHVgP (ORCPT ); Wed, 8 Mar 2023 16:36:15 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84CE8D309C for ; Wed, 8 Mar 2023 13:35:55 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id i9so23108028lfc.6 for ; Wed, 08 Mar 2023 13:35:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311353; 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=tTT9T3ZA8o58JTVSfKP4mFmGSY9L0FD5ME/SSc1VeoA=; b=vDB0yPgjLPPWoTfMKifxuDN4HA99g3FORK5nE8C+hMr23QT6TbTSkc93JcR4QJQJXo xMy6pMK1XQF3QCwSt20pIVEDfCojiR89iEAfcYrCoNfxoA2Uds6l16egXmaVEZ+qhrHx HeLIVr09bSo/s5T8qCGIG0x1ySnvTj8lGAd0Gp9lBbmMab/qKlDDMXFQdnyHph5PvSli 2BqFj9mx9yUF55GRgi98PM//GKYe2jAFboQxvgxSfESsP+VeA9+9oAEl38SywOZXP94i r+RWaDCKPwmI/Fr7Kj5qVV9gAehpAJ34H73pcqSAyzzog0lvH6Nq2G9m3vXy17xE9AJs Tocg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311353; 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=tTT9T3ZA8o58JTVSfKP4mFmGSY9L0FD5ME/SSc1VeoA=; b=RKK6OuTZlZNykwMXC1/kDVZFgGhVrVtfpln+E2y3eZFvihmaPq73KjddgtOeubw8G1 x3pRTAk5wSgiE30BDUGX6jx/xYVwYPkN/VzRNXSnsBoXzpOYdlLvAzJPx2geNH1zTkol uoa5Jr2pVZJI8OkHONzBp2jxLPpTE6mhPkdD936Dt4AavLxAGzNqiYt9wuoo9SB6jaCx yGh48Db2aBlETy43Lyp8R63IS0ILukWYoX0qIyCUvSPISQ6SbBPHeJJQkq0p/t39katS MSY0Rbd8467kLW/xp59xm5KxzpNY17qXBbPaXTAETEjKviftAgn8S15yxlPlpQI7/+rj frgQ== X-Gm-Message-State: AO0yUKXVU3F4G0VGxRfyN4I7thW9b0g5MAUajqCCdL46Bu7Ok9Ittg32 qF4VrGJvcyYKPiaPW4viVLnxEw== X-Received: by 2002:ac2:599b:0:b0:4dd:98c6:ee1 with SMTP id w27-20020ac2599b000000b004dd98c60ee1mr5249370lfn.61.1678311353641; Wed, 08 Mar 2023 13:35:53 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u7-20020ac243c7000000b004dc4d26c324sm2467479lfl.143.2023.03.08.13.35.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:52 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:26 +0100 Subject: [PATCH RFT v2 10/14] clk: qcom: smd-rpm: Introduce DEFINE_CLK_SMD_RPM_BUS_KEEPALIVE MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-10-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=1045; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=nCVLU2bNG/XRlQstVOXJbHVfkx/oThdOe+b2OVKuu+k=; b=B6Pkn3UBt2p7iNXjBVL9wZ8vkQaA5HPLUlt+T/OKBYmMnH6RlhWe8h/cFssu4XFxmJLlBJ7CH7O2 xSMGSQqQB2wzWwXbOGfExpBIxd25+iI8Q6c3zWdHhSZstBUckuKw X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759837144264096777?= X-GMAIL-MSGID: =?utf-8?q?1759837144264096777?= In preparation for supporting keepalive clocks which can never be shut off (as the platform would fall apart otherwise), add a macro for defining such clocks. Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/clk-smd-rpm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index d89918f9ae60..8e25b3d7d30c 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -127,6 +127,11 @@ _name##_clk, _name##_a_clk, QCOM_SMD_RPM_BUS_CLK, r_id, \ QCOM_RPM_SMD_KEY_RATE, 0) +#define DEFINE_CLK_SMD_RPM_BUS_KEEP_ALIVE(_name, r_id) \ + __DEFINE_CLK_SMD_RPM_AO_PREFIX(bus_##r_id##_, \ + _name##_clk, _name##_a_keep_alive_clk, QCOM_SMD_RPM_BUS_CLK, \ + r_id, QCOM_RPM_SMD_KEY_RATE, CLK_IS_CRITICAL, true) + #define DEFINE_CLK_SMD_RPM_CLK_SRC(_name, type, r_id) \ __DEFINE_CLK_SMD_RPM( \ _name##_clk_src, _name##_a_clk_src, \ From patchwork Wed Mar 8 21:35:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 66473 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp594255wrd; Wed, 8 Mar 2023 13:59:36 -0800 (PST) X-Google-Smtp-Source: AK7set/ecEop9lIcv6D5maOKH0WVYm+N2csAiwryMWCdnQLK04gi8bDuCwxNUrGCmmhv7IarVUmS X-Received: by 2002:a17:902:b684:b0:19e:7f6f:8c32 with SMTP id c4-20020a170902b68400b0019e7f6f8c32mr15760709pls.48.1678312776484; Wed, 08 Mar 2023 13:59:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678312776; cv=none; d=google.com; s=arc-20160816; b=yeqyhDxHgaSX9J31Swe8vnLsH99/VtFLpfBxaDsh0EMyr1SuYMtjqFfb2xbShOhSLK 9IJTFZ1Cr8gyBgyScnIeNOW1LDMfkv1V+HQfuG4VCJYuBrLBI4OLpj57K4r7jCUBER1m wSEAx4gv7ZLfn9DTRDVzIRteGK63kLzqkhndnNc1SH4+Bzm7TdWthjt71DJdwANLYTgh k/T6iwsuLy46n3j6dFHjko87lNL3NfZRP5jVo5Wj7KH3dTP8qeTa8Uh3mrKiEgUAuuVt yZrtY2DfWq3VPydyuoJ4wuMaDhT+tRZ3fxp/8yyVepCnG4N9aR/1V2JjfWXyRiCdIpL9 Oy4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=18sKuiUZ5qcOhA0BPqaLsV7V9u6MXywtAtqfprvdNpA=; b=aeE8vudplMbbaRT8YYgg9Xjfsu0ghb53T0Weij5bNYf6n4vd3i1A8hBel+73Txa7NT QD15JX/jxXs9m4so+msjZOTcpT0K5C2MIo0XgyFHSykDJ4tmfH7HnFWv/tYmfQHQw/38 Cr0t9sZld0cL0ezSYSZsx795i+PyRoLs2RE0ON1YrFgHk4YAMzpe6mRTCQQsml9KOvDr EFnkVOw0K4d6tZjMkaE10BoJ7CEmnjz3OjYK9qOO41xyMbRD20wVpm/jEzZSESjFfnrB WOS6MJh432T6sj/fYAaF1BBbgLdj8yZodiNU4tBUcidWRtI3I9vHYNw91ZPBXkPFyw4S P8Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kuEZA5WB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v10-20020a1709028d8a00b0019e6b514d54si15051313plo.160.2023.03.08.13.59.23; Wed, 08 Mar 2023 13:59:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kuEZA5WB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230347AbjCHVgo (ORCPT + 99 others); Wed, 8 Mar 2023 16:36:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230219AbjCHVgQ (ORCPT ); Wed, 8 Mar 2023 16:36:16 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B25DFD30A8 for ; Wed, 8 Mar 2023 13:35:55 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id s20so23096613lfb.11 for ; Wed, 08 Mar 2023 13:35:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311355; 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=18sKuiUZ5qcOhA0BPqaLsV7V9u6MXywtAtqfprvdNpA=; b=kuEZA5WBA7SdWEEPArS0NM4NxQySePTy4hToYIWbXUWY7BIyxK5OQOkExJoqS37sqJ ksUsiRFu6luv9pWWU7g/iArQgc+tvBiEtwQ2zIllLO2sp3mUvM+eiTTEg1BRiyR33bAj 4Z3ghgRDlyXwUbcVOqv/J4VZUv/mG9OiBFzkVCegd/+ZWI9y43yRNm2mL5QKdVsX+r7N RGfKC9CnAcucB2u8kLgPifyNjkRP3Szmv29xF2jztYOY1Ip2kfqH0k4jMn08jH6leefy jTFnLaMu8kAWVjtBt0aii740oa0lU8Y2I/lGP+1P9y7CoK4zqvjWKDuBV8wiAOH7hjyq 2aVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311355; 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=18sKuiUZ5qcOhA0BPqaLsV7V9u6MXywtAtqfprvdNpA=; b=KRoGNTt7Kwkztrgo/1wIUDXusUpI3dx6gzoydTdhgUcrV8IdhFVL3Fa+eCrX9nff9k yCd6clDbU3p213hxwaVylVIILy44kgCQ6b46APgRkKTwkBq98B95DrC3Px981HHr6mIT vGjhJ3ZeUGyhlOD76OeqObicjyrSrK/PHSdvvJId63MuV2u1PJxuAne/vTn/AXrneTfe ljFxKaTqpmSRkK5ZkRk6sWY5praVBuMe+C/CKzErULy0Xgqwg1Mpn2/nw5yZ9Y5Vwv/y pttMrL/iYBypgMD7stz39JbFwyRlvvLbHyX20jPxWqFiPxA1+l5a55FvgFuFUgfa2pxj Mttw== X-Gm-Message-State: AO0yUKXD1S8HGet3YB/mXLcfsVKrTrEjWnu36nVxOp/KJdfRjv1IpBSG 3HfdG2cpKOI5EOR/NgDPLuAhvQ== X-Received: by 2002:ac2:50c9:0:b0:4a4:68b7:d64b with SMTP id h9-20020ac250c9000000b004a468b7d64bmr5468773lfm.50.1678311355132; Wed, 08 Mar 2023 13:35:55 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u7-20020ac243c7000000b004dc4d26c324sm2467479lfl.143.2023.03.08.13.35.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:54 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:27 +0100 Subject: [PATCH RFT v2 11/14] clk: qcom: smd-rpm: Hook up PCNoC_0 keep_alive MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-11-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=7589; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=ht1r9OGUoEseRFNQ9l7Gc9DH17HBnASp+IBgQCKWpG4=; b=w8IKPEIDXvKB2pFy9RLASr+KNH5tUDGfcQhHLgRHnGVwcpV2nKhRVeQEXX36aZ3QdUHn0lcvbqYr ZRlBn1P1D7uMDgi/2kj3Lyqx1PRn0SQ0zldTs02q2hUdgHshrcZi X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759838497738060051?= X-GMAIL-MSGID: =?utf-8?q?1759838497738060051?= 14 [1] of our 18 supported platforms need an active keepalive vote on PCNoC_0 so as not to cause havoc on the entire SoC. Guarantee that. [1] there are 13 changes to driver data, but 8226 reuses 8974. Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/clk-smd-rpm.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index 8e25b3d7d30c..a44b52bd0c83 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -500,6 +500,7 @@ DEFINE_CLK_SMD_RPM(aggre1_noc, QCOM_SMD_RPM_AGGR_CLK, 1); DEFINE_CLK_SMD_RPM(aggre2_noc, QCOM_SMD_RPM_AGGR_CLK, 2); DEFINE_CLK_SMD_RPM_BUS(pcnoc, 0); +DEFINE_CLK_SMD_RPM_BUS_KEEP_ALIVE(pcnoc, 0); DEFINE_CLK_SMD_RPM_BUS(snoc, 1); DEFINE_CLK_SMD_RPM_BUS(sysmmnoc, 2); DEFINE_CLK_SMD_RPM_BUS(cnoc, 2); @@ -558,7 +559,7 @@ DEFINE_CLK_SMD_RPM_XO_BUFFER(div_clk3, 13, 19200000); static struct clk_smd_rpm *msm8909_clks[] = { [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, @@ -592,7 +593,7 @@ static const struct rpm_smd_clk_desc rpm_clk_msm8909 = { static struct clk_smd_rpm *msm8916_clks[] = { [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, @@ -626,7 +627,7 @@ static struct clk_smd_rpm *msm8936_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, @@ -660,7 +661,7 @@ static const struct rpm_smd_clk_desc rpm_clk_msm8936 = { static struct clk_smd_rpm *msm8974_clks[] = { [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, @@ -712,7 +713,7 @@ static struct clk_smd_rpm *msm8976_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, @@ -746,7 +747,7 @@ static struct clk_smd_rpm *msm8992_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_OCMEMGX_CLK] = &clk_smd_rpm_ocmemgx_clk, [RPM_SMD_OCMEMGX_A_CLK] = &clk_smd_rpm_ocmemgx_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, @@ -804,7 +805,7 @@ static struct clk_smd_rpm *msm8994_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_OCMEMGX_CLK] = &clk_smd_rpm_ocmemgx_clk, [RPM_SMD_OCMEMGX_A_CLK] = &clk_smd_rpm_ocmemgx_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, @@ -864,7 +865,7 @@ static struct clk_smd_rpm *msm8996_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, @@ -918,7 +919,7 @@ static struct clk_smd_rpm *qcs404_clks[] = { [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, @@ -948,7 +949,7 @@ static struct clk_smd_rpm *msm8998_clks[] = { [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, @@ -1010,7 +1011,7 @@ static struct clk_smd_rpm *sdm660_clks[] = { [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_2_cnoc_a_clk, [RPM_SMD_CNOC_PERIPH_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_CNOC_PERIPH_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_CNOC_PERIPH_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_MMSSNOC_AXI_CLK] = &clk_smd_rpm_mmssnoc_axi_rpm_clk, @@ -1052,7 +1053,7 @@ static struct clk_smd_rpm *mdm9607_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QPIC_CLK] = &clk_smd_rpm_qpic_clk, @@ -1074,7 +1075,7 @@ static struct clk_smd_rpm *msm8953_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, From patchwork Wed Mar 8 21:35:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 66461 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp586208wrd; Wed, 8 Mar 2023 13:39:09 -0800 (PST) X-Google-Smtp-Source: AK7set8jWlE3bn0I/1aw0eUKtqVGO/wQuKRaMTye5adjsOgnLXeDFiaBnLfoL6WaVOH7bCdX9fvE X-Received: by 2002:a17:90a:7:b0:23a:6be8:9446 with SMTP id 7-20020a17090a000700b0023a6be89446mr20635840pja.48.1678311548744; Wed, 08 Mar 2023 13:39:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678311548; cv=none; d=google.com; s=arc-20160816; b=DFzjFG+o/WExNUx0DV3YcyYJ1b6T3U5VjPiW9CfSDaZpkyqTIeiBABNOUSEhlk2Vnl PQ1ySOVocS7+tTrf22tw5ONj+Uuj89DlIPU9n4+RZVt2RUz9xBA8nVqh45gPUIEGBw8j nOJW2Xe8jOgFVbjkQv6PZ9Z6zYaeIsG7DrvEAduVu3H26zAckeZxzfwwbVn3/GA25bXX K0uopHqtNxNJZZD6YF847Zt8eFwoz8BPwE4AWMrK5XuKpSQO5ZwPV3/aXd+e7up8z/je Vo99s7Gd+Y7Ff2DogVcJMWS5WcMVyxB2T8MPO2hfO8JAcpJjIbHF6Jdx9/CuJa614xw8 w2eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=D4XnwTKK+r/ENEsY5xL5W4CAtIX7vncEORsdYqk3zz8=; b=Y/EY3C1oVMV6+FVlwgpoowRtnTKfObLsPaMB6ef8BeZ0BuLduvmtLRgxh8TMlgju9W /9efkdKR7WmB19YiLBBG20svRBjQemLlW/8QjuZw3reelwC/u+6Rc8GOAXEPhC2rfjQ4 CNxdSbYx7O2Whcq8mi3jLaveqx3tMcBpEJs+Zu+xjRpEMHSoTyr+XcyZLAYbK87csCow 8jE4YwEMggbWLczns6TIbdA3JX5f/IR+cAnERzLY1+Jz4frrDQLveA0JbWMutA1538J9 r03OtRhMEPaKr/zDzFTCK32lNjSHoV5PjYv7mAT8ZfpZo+m0hNJHaVhSaQw8gD79JfCd Oc5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gX777jL/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 6-20020a630106000000b004fbd4eb35dcsi15594788pgb.474.2023.03.08.13.38.53; Wed, 08 Mar 2023 13:39:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gX777jL/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230355AbjCHVgr (ORCPT + 99 others); Wed, 8 Mar 2023 16:36:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230248AbjCHVgR (ORCPT ); Wed, 8 Mar 2023 16:36:17 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A634D3088 for ; Wed, 8 Mar 2023 13:35:56 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id bi9so23154457lfb.2 for ; Wed, 08 Mar 2023 13:35:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311356; 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=D4XnwTKK+r/ENEsY5xL5W4CAtIX7vncEORsdYqk3zz8=; b=gX777jL/5l6kIjI27QmqsyX79SF8nW8A0qVANxM9lSgrvA8+n6GoLs/Yv5v0fxKza+ 0MP40fOz85b2O+zV1XDcRsBXKqL8MH2QhoSYNWwyS6DU2nEsoRhpSiLQu8TzK5fxUt8z jvYebb9QXjQ5m2e80f7aRscvKrspADRTmI0iRXPdhs8Tnm3Dkpp998ZsV5tYMjbTzTKo r0oZR/UvRX5lZBAMNO+xJjhrwc2Co1YG1384CWujXk+ZTEvCeXemwCafgZAv8BAsxiTE NBixBt2VTokQiO3QMXgzP7PQV1kxX2JkP28T6Dkh8D0AUeSrSar8rGAqgiY4wnfYqp2L fflA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311356; 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=D4XnwTKK+r/ENEsY5xL5W4CAtIX7vncEORsdYqk3zz8=; b=bpOqxAvNXvZi3VVlC6uHelNlBzFnBwpoSo6jgvqPiSYmzjrof7KHRzJ9p8+jiC3StL IcLAQsU9iFnWsfKE6Mnh8RzDzXJHUS1G1HCfd3SxN9oHUR35yhpkQVP1dAlGTZHx1tkv 9sdUwy27dLoD0MysmUP2MHFPs9zzoidKr4KIA9i2OZkNkdLiWrVCs79FE7nemrjUERQL avtO8/3+jk1ZkV2kvkSgjnIiLuKwV4OPI2P/UM4e7mL0DCHGSIoRyvqPX00CSZTTW2Rx ztyElWILKX3J8zrtt8MFNyaEOkZsSuI2yiluFcyAdwyTrFaHuyJ/WhNYeYUil1gGysH0 xQ6g== X-Gm-Message-State: AO0yUKVj9nVoF62wHI8Y7pxBmHb2uhAhZiRF/G2ELE5kwBy6EdSWMXTa 5+9L3O+w5GzqKBxN2UMlZuBkKA== X-Received: by 2002:ac2:5a45:0:b0:4cc:8682:ec5c with SMTP id r5-20020ac25a45000000b004cc8682ec5cmr5076161lfn.34.1678311356522; Wed, 08 Mar 2023 13:35:56 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u7-20020ac243c7000000b004dc4d26c324sm2467479lfl.143.2023.03.08.13.35.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:56 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:28 +0100 Subject: [PATCH RFT v2 12/14] clk: qcom: smd-rpm: Hook up CNoC_1 and SNoC_2 keep_alive MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-12-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=4801; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=bvsdJLy7tgag7pJIG/YhqythrBFn4s7xKZ0bdeefut8=; b=J7M28LAzUYEMYIao58B7D+APzztZRI1TsQUe1Yors/2XpeGwGjVfdXjMHBiYHvyvbLpjaLGKin5g lGpXKd06B4R8gu/XE9vn+KOlp5fJ1ZS1P/6FK2MWGQOr2N9+4kFD X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759837210634466176?= X-GMAIL-MSGID: =?utf-8?q?1759837210634466176?= 4 of our 18 supported platforms need an active keepalive vote on CNoC_1 and SNoC_2 so as not to cause havoc on the entire SoC. Guarantee that. Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/clk-smd-rpm.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index a44b52bd0c83..ef3157fd29d5 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -507,7 +507,9 @@ DEFINE_CLK_SMD_RPM_BUS(cnoc, 2); DEFINE_CLK_SMD_RPM_BUS(mmssnoc_ahb, 3); DEFINE_CLK_SMD_RPM_BUS(snoc_periph, 0); DEFINE_CLK_SMD_RPM_BUS(cnoc, 1); +DEFINE_CLK_SMD_RPM_BUS_KEEP_ALIVE(cnoc, 1); DEFINE_CLK_SMD_RPM_BUS(snoc, 2); +DEFINE_CLK_SMD_RPM_BUS_KEEP_ALIVE(snoc, 2); DEFINE_CLK_SMD_RPM_BUS(snoc_lpass, 5); DEFINE_CLK_SMD_RPM(bimc, QCOM_SMD_RPM_MEM_CLK, 0); @@ -1111,7 +1113,7 @@ static struct clk_smd_rpm *sm6125_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, + [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_keep_alive_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, @@ -1121,7 +1123,7 @@ static struct clk_smd_rpm *sm6125_clks[] = { [RPM_SMD_RF_CLK2] = &clk_smd_rpm_rf_clk2, [RPM_SMD_RF_CLK2_A] = &clk_smd_rpm_rf_clk2_a, [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, + [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_keep_alive_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_CE1_CLK] = &clk_smd_rpm_ce1_clk, @@ -1154,7 +1156,7 @@ static struct clk_smd_rpm *sm6115_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, + [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_keep_alive_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, @@ -1164,7 +1166,7 @@ static struct clk_smd_rpm *sm6115_clks[] = { [RPM_SMD_RF_CLK2] = &clk_smd_rpm_rf_clk2, [RPM_SMD_RF_CLK2_A] = &clk_smd_rpm_rf_clk2_a, [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, + [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_keep_alive_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_CE1_CLK] = &clk_smd_rpm_ce1_clk, @@ -1194,13 +1196,13 @@ static struct clk_smd_rpm *sm6375_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, + [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_keep_alive_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_branch_qdss_a_clk, [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, + [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_keep_alive_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_QUP_CLK] = &clk_smd_rpm_qup_clk, @@ -1231,7 +1233,7 @@ static struct clk_smd_rpm *qcm2290_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, + [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_keep_alive_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, @@ -1241,7 +1243,7 @@ static struct clk_smd_rpm *qcm2290_clks[] = { [RPM_SMD_RF_CLK3] = &clk_smd_rpm_38m4_rf_clk3, [RPM_SMD_RF_CLK3_A] = &clk_smd_rpm_38m4_rf_clk3_a, [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, + [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_keep_alive_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_QUP_CLK] = &clk_smd_rpm_qup_clk, From patchwork Wed Mar 8 21:35:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 66463 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp589153wrd; Wed, 8 Mar 2023 13:45:34 -0800 (PST) X-Google-Smtp-Source: AK7set/i7BFhq4EYTKCMdDoP8VmGg5oaUXASWeF6cXrPN2wWhhC6FjDEIOC7ynryZsXWR1dEFc+P X-Received: by 2002:a05:6a21:6da9:b0:d0:3eb7:4189 with SMTP id wl41-20020a056a216da900b000d03eb74189mr6633076pzb.3.1678311934191; Wed, 08 Mar 2023 13:45:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678311934; cv=none; d=google.com; s=arc-20160816; b=MPSFMqsF+MrswRHx5ve48RMHkOQ/f5g7M6tOcwmsr0mvdc3AUCd73f90J9hEuDJWLh NQogYyrFmy5lVoxSayfOtqrXtG0IzZ4UaPrxJ1stgADtfOVYwahjgiJ3c+VAur/ET0yl ul7cbC2hVuSonqVB3/EnwQPXOBr9ZCnIvUze3ZwswqND3F3SInuy5WXWZYYjtJXXx3wV izt4zcXEh5akHAXiRhkKm1CyUOLUd1zmyvpKawYr6p0gF4CqDFiRJDtNMqTwl+bvZh6K 9GY3q3ze2ZOpNDgZ7cLaREkuvRsnrxaBMbNKY2yr4WeSPh2xezDdSM/1G3+wglYKOXZR XPqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=urmGJAPgwAGGBM7URg5kN0SEKagUfLPIGhnTYX/DEYE=; b=FzCzkmgN81y96v21kvlIO5picymy+hbyOOGNEkTvJS5r3ePrbDGPWrxuaLuuV5RzJk gScYzc9Pr9RYRkD4zACKtm9ZztPABByXdxjH6WxMcartsZVD89id1/Q//BCmAHkuhlnQ 1+qKfvfgXBYP9ULwAlYG6s29N1qOjI3GmoE+ZxwfrODEf631tQf2upejnGrnl9P2fM6b DdHO2/FXmRXRUwtwAiCqiq4IHEwxUb0UitATWAa3TxjxIyAC8gArbDWfAxmMMaUqP8MJ IZmWZr+ghO6YaM6TTmlBH1iatJj8Dxu6i9EuXe0JZMf4qxIYPZwnmh93d8Tb10BMqLYn McVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GNVYLg9o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e129-20020a636987000000b00502ffff6ee0si15223810pgc.17.2023.03.08.13.45.20; Wed, 08 Mar 2023 13:45:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GNVYLg9o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230387AbjCHVhE (ORCPT + 99 others); Wed, 8 Mar 2023 16:37:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230041AbjCHVg2 (ORCPT ); Wed, 8 Mar 2023 16:36:28 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D21D9D1ADC for ; Wed, 8 Mar 2023 13:36:00 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id m6so23121219lfq.5 for ; Wed, 08 Mar 2023 13:36:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311358; 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=urmGJAPgwAGGBM7URg5kN0SEKagUfLPIGhnTYX/DEYE=; b=GNVYLg9ohWuW/v3/mcICnAg/PJu6Qnk0xgBCKATX+YqfrOteGWMKGJ6x2aceFAPe+U Eed8PXwSoxFpmiVN64rjRWJCRU4k0CZZV3JTs8KNCf3rlju0OR7Pe/RM8iHNny+MHlcZ ac30gMHU6JmSL0Gmcs5I8CfOmSBO9yR6xlMdCsnK60NVq/mPpA8Cc9lXcPe8tAFTJ9Oh 6vTBMrNGJE+6OoKu5hdaDu0kId4/ovnbOYzOvuq9HVk0eL43NavA8x86S0STXaWghkML eGGrsZP/41ehBnZ3m2XjFF61XJSVMQ2pzIG52PjgPBszQmxmbrSWjh6z7KPliEGGANkt 2B+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311358; 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=urmGJAPgwAGGBM7URg5kN0SEKagUfLPIGhnTYX/DEYE=; b=gOL7qh7QPfbHcM8pBxSR1PA+enkbHACU9j0QAVW047nZneZyLjdOvRKtHx9Or4jxNf R2X5ms3uIj3pGvUsFN7oIuyaK/iCeqe6TAgFZmxEhyIBKysqJQJzO2OoScZaYlN8mo2P DzQND1tsUN/0Wh2l10PBO4Pl/RnGYvV4Yj2Qc0nFYxXSgd/zDEWLqmB/uZ5XMgmsxxHO qW5HG0OSJzMlLpLPXGkz1TRQCNZNn/H0dTZ2XRVpz4gm9r6DEUPHGk4bNf1icanMdOrJ +MHM0lOKPSCEBStuL1x4yS9DBwRt1wgSBrsyPU3aU0YDmbUK5DzMO9sYFpw0EzvUpcQ+ kEYA== X-Gm-Message-State: AO0yUKVYeZSGlF/m8wZHn5UcO1yTRJgzTMNfDC22GVEqGJAM1ojJdNRc +x0iWw4sIj7hJowJNFzIZQ4ycg== X-Received: by 2002:a19:7609:0:b0:4dd:9931:c4f6 with SMTP id c9-20020a197609000000b004dd9931c4f6mr5223428lff.16.1678311358070; Wed, 08 Mar 2023 13:35:58 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u7-20020ac243c7000000b004dc4d26c324sm2467479lfl.143.2023.03.08.13.35.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:57 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:29 +0100 Subject: [PATCH RFT v2 13/14] clk: qcom: smd-rpm: Mark clock enabled in clk_smd_rpm_handoff() MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-13-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Konrad Dybcio , Shawn Guo X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=2789; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=ptSW3wZBetlXgOZ2HWII0h2GkDDWkHkQylreBSIoYDE=; b=pVN/1pfoxRb/PkVrgLyzANO7P40tBDrd+dWqphNKXRPek7PH4uHm0+pV220EEBj+mIfB6GdTztpy +YM8AiROBnYjd+FexpLOMnYZNLdFEZt3JQjhi/s2TTFeEEiQoQHd X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759837614901149190?= X-GMAIL-MSGID: =?utf-8?q?1759837614901149190?= From: Shawn Guo The result of clock handoff is that the clock is voted by APSS and enabled by RPM. So it should be marked as enabled. This, combined with .is_enabled/prepared will ultimately cause RPM clocks that were enabled by the bootloader to actually be shut down if unused. We can only afford to do so if we have a functioning ICC driver. An immediate thought to test for that can be to provide an ICC path to the RPMCC node, however that would create a couple of circular dependencies between GCC/DISPCC/.../RPMCC and ICC. The next best thing to do without breaking older device trees is to add an opt-in DTS property. Do just that. Signed-off-by: Shawn Guo [Konrad: make conditional, explain the consequences] Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index ef3157fd29d5..6736e53e607a 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -197,7 +197,7 @@ struct rpm_smd_clk_desc { static DEFINE_MUTEX(rpm_smd_clk_lock); -static int clk_smd_rpm_handoff(struct clk_smd_rpm *r) +static int clk_smd_rpm_handoff(struct clk_smd_rpm *r, bool disable_unused_clks) { int ret; struct clk_smd_rpm_req req = { @@ -222,6 +222,10 @@ static int clk_smd_rpm_handoff(struct clk_smd_rpm *r) if (ret) return ret; + /* Marking clocks enabled here will trigger unused cleanup */ + if (disable_unused_clks) + r->enabled = true; + return 0; } @@ -1319,6 +1323,7 @@ static int rpm_smd_clk_probe(struct platform_device *pdev) struct qcom_smd_rpm *rpm; struct clk_smd_rpm **rpm_smd_clks; const struct rpm_smd_clk_desc *desc; + bool disable_unused_clks; rpm = dev_get_drvdata(pdev->dev.parent); if (!rpm) { @@ -1326,6 +1331,14 @@ static int rpm_smd_clk_probe(struct platform_device *pdev) return -ENODEV; } + /* + * We can only really park unused clocks if we have a sane interconnect + * driver. Otherwise, the platform may (and probably will) try accessing + * IPs that are hosted on unclocked buses. In an effort not to break + * older DTs, make this an opt-in through a DT property. + */ + disable_unused_clks = of_property_read_bool(pdev->dev.of_node, "qcom,clk-disable-unused"); + desc = of_device_get_match_data(&pdev->dev); if (!desc) return -EINVAL; @@ -1339,7 +1352,7 @@ static int rpm_smd_clk_probe(struct platform_device *pdev) rpm_smd_clks[i]->rpm = rpm; - ret = clk_smd_rpm_handoff(rpm_smd_clks[i]); + ret = clk_smd_rpm_handoff(rpm_smd_clks[i], disable_unused_clks); if (ret) goto err; } From patchwork Wed Mar 8 21:35:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 66460 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp586005wrd; Wed, 8 Mar 2023 13:38:42 -0800 (PST) X-Google-Smtp-Source: AK7set9c0997g7em2U8jVsAT/jer/yKC4MUq6w7t5jdPUxGEC1tWnzUDgOMUJBGHkkmHbzPnX5g4 X-Received: by 2002:a05:6a20:7d88:b0:cd:9b0:b287 with SMTP id v8-20020a056a207d8800b000cd09b0b287mr23582912pzj.24.1678311522115; Wed, 08 Mar 2023 13:38:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678311522; cv=none; d=google.com; s=arc-20160816; b=OEhhoKGYzPHDqfMheTkvgF+xL8prKQjbfwMqS1pnHyirNZJLGsaTszo8tDmvMny3yY hBW+IzyTN4WTNstcEfLAEvoqnkATAu4pRaM8vkF9Wym5yp7AoUdfOaKmwZwZhxS52x2Q oOpxUrJH/Kl+aUqFhSWQ7B9qJn9HcY7p+jLnD9KQVoJ+6u20apU3czE2WAEASHDw25+8 cdaZXSXm8NUObE7eRk8mszj9jToo10mqZo6JDqIAJqc6gscu8qqKs7uY+r4DWao4VLUd jC6buxYxEDYGW/Nlfcd6KIpgD5WmLz8gyfVOjqK8ChB4l8V3L6JUL/pCRQRe9CGcI2uW L4dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=ZubkqDM02FAiEq3eW9W/hQGkoIRi+LbMNFc2dkt329w=; b=HA/kTw1udaSSUujyHK2Ki5+wPSSpMDl3BBbAQxC/MT1eMH2Z5f3ZleOuK0fUpXnFRc PJiS6siCsf9J6xIySiCQqkBuwQg1TRo3fdy3lP9VQIkxUKhtr2gtj4cyU9iNI7v1h4a0 OOUDen9NF0D3txj4gRI40ndTi236qCTepdAFZF8l0jTCcdRuy0436mAdA8kVIQ8GIBsW PUVnrIc1JMXV7OwVW3w7PZdCY+sEUGsZJMos72WAe1mbLh1/wKln3ZxswWmSQMgTmw/S 3ivnh3EdL+stolSwVU3lLaRE40ko0HAUWEXXkiZEmABLM6M+6RavYuspUrNh4dYqEoYG rz5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U2+2EA4Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 16-20020a621810000000b00576fca27d92si13989760pfy.206.2023.03.08.13.38.26; Wed, 08 Mar 2023 13:38:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U2+2EA4Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230027AbjCHVhB (ORCPT + 99 others); Wed, 8 Mar 2023 16:37:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229878AbjCHVgY (ORCPT ); Wed, 8 Mar 2023 16:36:24 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E90A3D30AB for ; Wed, 8 Mar 2023 13:35:59 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id k14so23110948lfj.7 for ; Wed, 08 Mar 2023 13:35:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311359; 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=ZubkqDM02FAiEq3eW9W/hQGkoIRi+LbMNFc2dkt329w=; b=U2+2EA4Y3hZZ4IySjfJI7Rl8yoiGa46ugFf4hmN9QuuP8TmiomTY4CaHr6rB8HomBu 1d58zX7S00aWHBBZPR/9Qn0NTAtJnx4USs+nIOvlr4IZkdCbpiqX2iFUgWZhVmtjwMhF HwjoziRqgFYuPmfsOT0ZS+HAnLTHRS9MNFAqStOd4lVU8TSR8VgUBKPsgLLnr5hZOL/p aQQzjQFknH52GZKA90Mjip+qHUNF15Q2GKbuq3ZeRxgpOBgMZ742kRiF0mDniqN3ygUL PRE7HiM63+DplQpxJGy+qf4hW3UYDcYevICm0uYsosmmjnr9HSLo2RoMKZKCsi2leuyV cWJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311359; 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=ZubkqDM02FAiEq3eW9W/hQGkoIRi+LbMNFc2dkt329w=; b=4Cq47RqE7wGbG090LzKSNF2hOmNz6NNl+RNFH5b7iaAqbF19JL/i6j0dr5fywSbp6W FpNpEwes688G3FdJRn1ncLOrvDV7cDPAYm3pnUHA93apK/1eM5ue/sD4bLtU4ntlepbR 7Az34rsZyrPbFPVu7odSJXWd/uYbFkVP6k+/VeAy9JZ1t5H4+ve+auAqFxJjdBJufSPZ JDYyu0NXzR6ofsXLKetBLe3EpM5VkkoVZdOSaDmyp2c6TLdUYslejA9+S3Ta2qbZcd+m vtmSh5dZQSCxiWyz6l+j611gAdrsJxr9IJZkujZra7LLBUaTXHtMNLnxsh0hp5QNZoPq Vxkw== X-Gm-Message-State: AO0yUKVct9V8zKZ+WPIgjEkfN/QIlD9NNJU4PyfnMwDIN3/E1VGHB9/K dWPPYefez7ynHia1jlIwnIUw2w== X-Received: by 2002:ac2:508f:0:b0:4dd:a5aa:accb with SMTP id f15-20020ac2508f000000b004dda5aaaccbmr5350543lfm.44.1678311359487; Wed, 08 Mar 2023 13:35:59 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u7-20020ac243c7000000b004dc4d26c324sm2467479lfl.143.2023.03.08.13.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:58 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:30 +0100 Subject: [PATCH RFT v2 14/14] arm64: dts: qcom: msm8996: Enable rpmcc unused clk disablement MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-14-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=658; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=ymIRVOgSTZj4llDzbcFS8Jduc30n2FcF0wczQdKvVS8=; b=7LtP5xJlOff5hrptxWCmxeFmHS62ygyBcYYVTgt92Z6PwhXkfshXJ2lTCW00E24p6ufcwyRA44Pe zx7PeJN/D0AhenvXl0rkAAO1hHKJfYaoWqp532nuqUb1Ua8I72gw X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759837182653007207?= X-GMAIL-MSGID: =?utf-8?q?1759837182653007207?= MSM8996 is in a good enough state to shut down unused RPM clocks. Do it! Signed-off-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/msm8996.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi index 905678e7175d..59451d87cfbf 100644 --- a/arch/arm64/boot/dts/qcom/msm8996.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi @@ -488,6 +488,7 @@ rpmcc: clock-controller { #clock-cells = <1>; clocks = <&xo_board>; clock-names = "xo"; + qcom,clk-disable-unused; }; rpmpd: power-controller {