Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp548122rwb; Mon, 26 Sep 2022 02:39:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4mgO2Sl8C17gMFy0D4wxyYRdEA1ZcEsvffK5wiG6j9oV4oaIxfO8JIxgL3DVGY+3ubX2EF X-Received: by 2002:a17:90b:3909:b0:203:a4c6:32b8 with SMTP id ob9-20020a17090b390900b00203a4c632b8mr35485166pjb.5.1664185148926; Mon, 26 Sep 2022 02:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664185148; cv=none; d=google.com; s=arc-20160816; b=QkOB5/osP+nIzki2CrwZ2oXQX7i328k6+DS+B6NRHj46NSHvojEFw7y0zFB6LJ/UYl H3tvPvAoETcV0y/2VsoFBPwQRrkkT97NNZLdOpPpaRiKrXhjr4QchFc+uPZpotaIKygh qsJAAz3OqwrOLc25X/xi8q4DaNlMgIVuBavvOsvwYl9HkFM3aS5AF0C9HdVWKvrxmdpY oURsRm52fpCqxUXzXljQXhlmdXEuFh1WihGzpgbqV5UrjZy1W+U0syELQ3uz+4QVqZx5 1rKSF5V4Us3KEuPhfU3pME0Nh3T289h8f+rlVBImkl2VoLiUWxuHH4IMu2hvjXOxTbSH LuKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=S3YpF0J9PK0ijK5OVv062WDbUS2SECLrB4bPkgAYd/0=; b=zuZ0o3sIdzdE5hnSO0nQhPG7MxNCytDzzQBASU8tOYwZ6q+27F17P8FvrsUYfR7CdI KOoQ1BVJ4l22SQOD0AvYmyaElyU20pXB8CpWsU39m8VQ9gC4fEIVJMIUP+BarAYz7U0N h0qv8dKu2P57vFki9OnHewXc3Skt2RrCWfcSFWOY71NTzqR6tJmRU9Xudt5RXOe4ExZc X9nax1i1K9Rua1dMgjiI6zewCAjVa3/b+YQSP9b1mlM0qmsJLGAkmQEv/Vi/kdkQ3OZc JBE9VIqW954PFVTAoIb1J2OO+1crMBxU4YKRSQszEnL1GMFqWETVDoYxEYb2U0iJZ9oV viXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KYWKxmq1; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 9-20020a630509000000b0043c8cfee1f3si6930827pgf.243.2022.09.26.02.38.57; Mon, 26 Sep 2022 02:39:08 -0700 (PDT) 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=KYWKxmq1; 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 S234434AbiIZIgP (ORCPT + 99 others); Mon, 26 Sep 2022 04:36:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234431AbiIZIgN (ORCPT ); Mon, 26 Sep 2022 04:36:13 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D63B21805 for ; Mon, 26 Sep 2022 01:36:09 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id w20so5553159ply.12 for ; Mon, 26 Sep 2022 01:36:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=S3YpF0J9PK0ijK5OVv062WDbUS2SECLrB4bPkgAYd/0=; b=KYWKxmq162iix/heLHpM0iiyJ+z2PHlMRbsxX3Ie4ZH30ZFBXFnrwTO7nTwzlOggqY QaJDsuwxiPBjnApUhY3dAuCjh0SaYozYOw+2n4HdmNs/2kSwYLERAcfnpeIsmd6ka6J/ P652G+fWhEbPCBow1woX69hmjKg6+sxxBHU/KZX6dqaNLOKBJOPMacTLPGeVhIV2V3zd zKwxCTgz/ZlB7vb/P8CwQCcA2xNZZeu6heFHZY77ztqxH9H3YoZc2/xfdGrOBksTi86L sU5radxCmYaApM5VHHGhlPfGH9P/6hJCqJWNQAy12RWLHS92Be96CgUJIvBW6JLnFsD/ DJ+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=S3YpF0J9PK0ijK5OVv062WDbUS2SECLrB4bPkgAYd/0=; b=nVUM0pW8PMvVyWmaWKgCoys6EXpKsoCljJSkGb/G71tpdFFyFxVSSJkCbMaQAj6aII FaulGivMHz9FehEKmNFvJ17+VXDUXHan3WvcOLQOxtYjTGtm5iHKeZ0m2xeVNZUKSafj 9N6K1fxvywdlVhQSavID4MrBsa4PKQGEvDRzk7tSdOPzAuYJmNAztys7My4frN3TFk1k fpyjwmcwww1SyY5mSa2XusSnDI6lgfGISTBljacXF+sGRzNZMz/S86l0N1ZctEDCghSv 3vtYLQLhFS4ZFYtoafe8qizGqi0KCKz6K0qCGqWXHAUN5MIBpBImMn9F2wx23J7g+rQA OhZg== X-Gm-Message-State: ACrzQf2lyV3jENoNxnlTyfjj2UUcG/tYRhkON25DBRjUENZNwyrEH3UN n7aFZhaZ8IAyLpiBRyAMcGjSmw== X-Received: by 2002:a17:90b:1b51:b0:203:25f0:c25e with SMTP id nv17-20020a17090b1b5100b0020325f0c25emr24194880pjb.65.1664181368829; Mon, 26 Sep 2022 01:36:08 -0700 (PDT) Received: from localhost ([122.172.85.153]) by smtp.gmail.com with ESMTPSA id w19-20020aa79553000000b00540fee4a680sm11428866pfq.41.2022.09.26.01.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 01:36:08 -0700 (PDT) Date: Mon, 26 Sep 2022 14:06:05 +0530 From: Viresh Kumar To: Xuewen Yan Cc: agross@kernel.org, bjorn.andersson@linaro.org, konrad.dybcio@somainline.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rafael@kernel.org, di.shen@unisoc.com Subject: Re: [PATCH v2] cpufreq: qcom-cpufreq-hw: Add cpufreq qos for LMh Message-ID: <20220926083605.b6vjrvg3a4u3rxxi@vireshk-i7> References: <20220926055130.yr67653e52vyuutv@vireshk-i7> <20220926083405.7801-1-xuewen.yan@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220926083405.7801-1-xuewen.yan@unisoc.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On 26-09-22, 16:34, Xuewen Yan wrote: > Before update thermal pressure, the max cpufreq should be limited. > Add QOS control for Lmh throttle cpufreq. > > Signed-off-by: Xuewen Yan > --- > v1->v2: > reabse to cpufreq/arm/linux-next; > --- > drivers/cpufreq/qcom-cpufreq-hw.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c > index bb32659820ce..833589bc95e4 100644 > --- a/drivers/cpufreq/qcom-cpufreq-hw.c > +++ b/drivers/cpufreq/qcom-cpufreq-hw.c > @@ -13,6 +13,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -56,6 +57,8 @@ struct qcom_cpufreq_data { > struct cpufreq_policy *policy; > > bool per_core_dcvs; > + > + struct freq_qos_request throttle_freq_req; > }; > > static unsigned long cpu_hw_rate, xo_rate; > @@ -321,6 +324,8 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data) > > throttled_freq = freq_hz / HZ_PER_KHZ; > > + freq_qos_update_request(&data->throttle_freq_req, throttled_freq); > + > /* Update thermal pressure (the boost frequencies are accepted) */ > arch_update_thermal_pressure(policy->related_cpus, throttled_freq); > > @@ -413,6 +418,14 @@ static int qcom_cpufreq_hw_lmh_init(struct cpufreq_policy *policy, int index) > if (data->throttle_irq < 0) > return data->throttle_irq; > > + ret = freq_qos_add_request(&policy->constraints, > + &data->throttle_freq_req, FREQ_QOS_MAX, > + FREQ_QOS_MAX_DEFAULT_VALUE); > + if (ret < 0) { > + dev_err(&pdev->dev, "Failed to add freq constraint (%d)\n", ret); > + return ret; > + } > + > data->cancel_throttle = false; > data->policy = policy; > > @@ -479,6 +492,7 @@ static void qcom_cpufreq_hw_lmh_exit(struct qcom_cpufreq_data *data) > if (data->throttle_irq <= 0) > return; > > + freq_qos_remove_request(&data->throttle_freq_req); > free_irq(data->throttle_irq, data); > } > Applied. Thanks. -- viresh