Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3608433pxb; Mon, 24 Jan 2022 13:25:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzemm0emyFVp+AvSULEzf4GMhLDRtjd44pm4qTYymxpL900NtEbsbTSYjWmgMVRnd/YVLG X-Received: by 2002:a63:a84b:: with SMTP id i11mr12963794pgp.486.1643059528458; Mon, 24 Jan 2022 13:25:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643059528; cv=none; d=google.com; s=arc-20160816; b=V2v55P+5cOyoiMidojvGjqSQHkhEH0PeGcHBI5CWjIHQAFSIUZlDZ7hKKdEkPVcSIi e3rcLSpcGTHso/uSBSL4MgghgWz8S259wad1OjFVZLVKwliEupz65rGCX1nZWZUH0ENy 3X7eV49NPP7lY5dCpVED7BmCIe3fZzycesPM3iML2matacWzKzaHsdVc+RQpEx4IvhBI J1WTNYS3eiRunUrzSda+ZKjrawM+SOO9d5FyxNKMS3MDn3Ej6RXSexH24o6G37ABbzPJ 26B6eJz7fmocel8se/xQEju1PaxD/gBBCxGRFTNEgLbpwKRk6WSZDA1iiMH3EPxTpD2i 9qbg== 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=zAdUbBP6NUb+TAAiavT3NCy2iJCXQpILSykzEx0+w/g=; b=KU1Z7D0SJWJGORSJfmsxhNIt9DLUZE8rL+FYFpkuIhfOa3S5tZvYCPOwONIE6+v/Ps +GPpBjREA8Z00BXXohoKVQhlCN2a8llH3cXiayaBTGvkj63d4ixqOho8/AwVEdHRsduT t5ptOn96fsWG5FkqRRx5fxcDVFxRuUiXn6OidJbUK6iU4KjlP0yq6iIIc2AiS1nTa277 sMQmqsKnWx1coM7s+Ne+JgDIhfZlpb0BWsS113J3bLUkbaIa09ncZrBkZM0U0TSYa5Hh f6i/rcMoUeoZT2lU6vvtfxfQOZiCIX/VhkPPzVYEKzFhJFtnt/pToDFqu2EGXpCg40Yh oQsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ueudVyBf; 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 g7si12152458pgi.14.2022.01.24.13.25.12; Mon, 24 Jan 2022 13:25:28 -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=ueudVyBf; 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 S1444868AbiAXVBl (ORCPT + 99 others); Mon, 24 Jan 2022 16:01:41 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:33320 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380174AbiAXUiD (ORCPT ); Mon, 24 Jan 2022 15:38:03 -0500 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 dfw.source.kernel.org (Postfix) with ESMTPS id 270C861573; Mon, 24 Jan 2022 20:38:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37B5CC340E5; Mon, 24 Jan 2022 20:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056681; bh=8LKn3Qy7g+ejsWO6SkhwYjWH6L7sH2RejyfEHo5KZ5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ueudVyBfj45KNSyeyTw3zDC6Cgrl2rS8GZVP8CfH9t0UYnO+X+UhSJga27UxV4O1R 1Ms8ifbqHGfQDVziH1LmVWb3XAUY14X0wQq4tt+GxY9ERpnHwzgnXOFV7c+6kOfXC4 9puK44X+DATcJQITlH2CagbUjjsDyGIyQwaGzwB0= 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.15 565/846] cpufreq: Fix initialization of min and max frequency QoS requests Date: Mon, 24 Jan 2022 19:41:22 +0100 Message-Id: <20220124184120.526469652@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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 fcb44352623ee..eeac6d8092298 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1402,7 +1402,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 @@ -1422,7 +1422,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