Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3600589pxb; Mon, 24 Jan 2022 13:13:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQgdoycJJOLq0p/Zvm46agi1ltWdptImjVQup6dxx3W+PPAHdCrmcfBza06Ujq+SaUh1W+ X-Received: by 2002:a63:b00c:: with SMTP id h12mr13055037pgf.80.1643058836531; Mon, 24 Jan 2022 13:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643058836; cv=none; d=google.com; s=arc-20160816; b=dQWyaQxWyui5MU70yiCZhk2rreSx7qcb5wYnoCciG47/GaJvxuqEZp22+zBFBD/dM1 7qz6vd+hHkMlUZkLIR88vSZghUAf4qjBxrFbWGJ/ZwtHhpNk6HgFfN36NGuFblJ4vV6k 3xIZFpJNewtgELxeAMyYNG4ZQMtBiQ2Y0GBqV/CmyhU2LtR1acxd1TVVh7yJJn4qKi81 ty+OK81BvxzFh5sDvfZ0GKINprgpIvUgIHn10EqHNMwS6Ppg2tNUHOdD8CDGlmSPPNEF 582OM9/gmimBxHinasjXkqCCoXOCsZpi/cW+U5xuK6EvahFpDUScNGCTAzR7igyP0wj1 keOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ar1K6iUYlejZScZxJ+CJe1dmlsqxSdIoBJMZ3BdGie8=; b=sn39PSHyLRpDwTNnqSVWlhEf+zEuhG3O9f15b8ChglLkoUpFPDzNrDnxpxU7Py7c7m lYSn9/xeliHKt/aJMUBgfxeMnQXg7JRlWRShDmy3opJynbC0sKN24R10oq9MG0kpcf4J 7DI2IdAZB35XycHcMRFNIblQz7PA+i8a8dw4eEH8aG0tMxKRir6ej9IODMOcaKqzhRLx nHxfEkHA2EeZWfWy6ecWf5e4GZEQbEVlg9XgyaXhaEdSRvnZT4OLAG30cMVpwAIGxPA5 +S2JvEhhBDJ8ocV02keHMp8F3ytqR44F7vvGyTZErNyaTuhrcn/j6w0UrRKloCbN9KEm ANZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W7YvEEaq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p13si14816691plo.272.2022.01.24.13.13.44; Mon, 24 Jan 2022 13:13:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W7YvEEaq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386653AbiAXUfr (ORCPT + 99 others); Mon, 24 Jan 2022 15:35:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355136AbiAXUNU (ORCPT ); Mon, 24 Jan 2022 15:13:20 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D84DC028BE4; Mon, 24 Jan 2022 11:34:23 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E8796B810BD; Mon, 24 Jan 2022 19:34:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3A8DC340E5; Mon, 24 Jan 2022 19:34:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052860; bh=6dHo04fHFiPT6f+jP1NYlQtr50rOB45dS0uHn/hwoCE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W7YvEEaqT7ho/FzM0nBmzUAIYuwvUtnEyfL7F7XX2bXkwxhlyhWMCwdmH8iHEfNLs fQiTRer3cCxTcPcia/tYFqWE4Furgts0eebbjY+AolxEIs+HlnOe8AksRvWhxz6ymP zh3e0jmOFOdlz+9O6DqXNlCj3MfF0diYbwg/POko= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Pandruvada , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.4 196/320] cpufreq: Fix initialization of min and max frequency QoS requests Date: Mon, 24 Jan 2022 19:43:00 +0100 Message-Id: <20220124184000.304813534@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki [ Upstream commit 521223d8b3ec078f670c7c35a1a04b1b2af07966 ] The min and max frequency QoS requests in the cpufreq core are initialized to whatever the current min and max frequency values are at the init time, but if any of these values change later (for example, cpuinfo.max_freq is updated by the driver), these initial request values will be limiting the CPU frequency unnecessarily unless they are changed by user space via sysfs. To address this, initialize min_freq_req and max_freq_req to FREQ_QOS_MIN_DEFAULT_VALUE and FREQ_QOS_MAX_DEFAULT_VALUE, respectively, so they don't really limit anything until user space updates them. Reported-by: Srinivas Pandruvada Tested-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/cpufreq/cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index cb7949a2ac0ca..af9f348048629 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1393,7 +1393,7 @@ static int cpufreq_online(unsigned int cpu) ret = freq_qos_add_request(&policy->constraints, policy->min_freq_req, FREQ_QOS_MIN, - policy->min); + FREQ_QOS_MIN_DEFAULT_VALUE); if (ret < 0) { /* * So we don't call freq_qos_remove_request() for an @@ -1413,7 +1413,7 @@ static int cpufreq_online(unsigned int cpu) ret = freq_qos_add_request(&policy->constraints, policy->max_freq_req, FREQ_QOS_MAX, - policy->max); + FREQ_QOS_MAX_DEFAULT_VALUE); if (ret < 0) { policy->max_freq_req = NULL; goto out_destroy_policy; -- 2.34.1