From patchwork Tue Dec 27 19:51:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 36995 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1556985wrt; Tue, 27 Dec 2022 12:00:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXvsf0BTi2aVDiE91Xz4F4XOGx6AAvWacWhcf7/kp9SrEamMNCn7XPDbq4t/RuDutztOi3s3 X-Received: by 2002:a17:902:d303:b0:189:b3bf:c0b5 with SMTP id b3-20020a170902d30300b00189b3bfc0b5mr24952491plc.34.1672171250603; Tue, 27 Dec 2022 12:00:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672171250; cv=none; d=google.com; s=arc-20160816; b=RDyw+wjTAAav8eE1vgAiponS+zS7gldjZXYY2OBcmT+9fx2uCXXYKJGvu8BC7GBNZ9 NOJRaDA9on9+wCaXd2KamC2RcoM8xxeARrFcsIE7MEzA2tGUmTtlbiVndPw2AQKe3uvR b1OSym2S9hxHjkHzEWFLLjSqU2J96kUnM7vZaHIklu1efeqeA5RJNvS7eNDVBiN+xDjH SHA/Yvkg+dcDpN8LWEHT7oibZ5/OsryCnt837zh1IS9CcmM7c3/ZlAYwfNMzfuC1uDfi DhjRivZbEAYsWECk/cLBJRAArgIDkWjpfTqQg8+OMJCmxrNItWM0CCxTfh8v94z/yfki eYNg== 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 :message-id:date:subject:cc:to:from; bh=jbobXY0IufRhIjMjqgH6VvroHlzOP8CSLt/5noAp9bs=; b=ZCtamjWCgTIGrD4yjnFgED2FavzB+k8T40ZHpfRfmiKoDSgdyG+b6pHnQXRslcS6e+ GB7cAtPspERjKY8iSGeOxAsN3JdratK3s7Lc+O5UhWv9gHyms4fpZwAANS3zZtIJHv/A oP3ndlJyOJukwsVqWO+mCWaTzMYeCnMYNapFWU9jWYMFWb3gKjaIYpMDKmRCdfqpninV Qq86fjB7C/pgn/XFo+4u92QGz/O8K4AbbEBYPpNoLFnX/g6qHjLeBvpnu8ShfRjJYTcF +9AYcHJ1ZAHUfmPMFPxtarjxQtBZf2kqHQmqEOJxNY3FDx+CdSC2KpYbZ5kEEHOayTd/ Wv4A== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c3-20020a170903234300b0018659963cdcsi15718760plh.514.2022.12.27.12.00.38; Tue, 27 Dec 2022 12:00:50 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231749AbiL0Tx6 (ORCPT + 99 others); Tue, 27 Dec 2022 14:53:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229788AbiL0Tx5 (ORCPT ); Tue, 27 Dec 2022 14:53:57 -0500 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A23E51131; Tue, 27 Dec 2022 11:53:55 -0800 (PST) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.1.0) id f43143bd2e72e6b3; Tue, 27 Dec 2022 20:53:53 +0100 Received: from kreacher.localnet (unknown [213.134.183.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 3FA3E28A34C8; Tue, 27 Dec 2022 20:53:53 +0100 (CET) Authentication-Results: v370.home.net.pl; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: v370.home.net.pl; spf=fail smtp.mailfrom=rjwysocki.net From: "Rafael J. Wysocki" To: Linux PM Cc: Pratyush Yadav , LKML , Linux ACPI , Srinivas Pandruvada Subject: [PATCH v1 1/2] ACPI: processor: perflib: Use the "no limit" frequency QoS Date: Tue, 27 Dec 2022 20:51:43 +0100 Message-ID: <12138067.O9o76ZdvQC@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 213.134.183.5 X-CLIENT-HOSTNAME: 213.134.183.5 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedriedtgddufeduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepffffffekgfehheffleetieevfeefvefhleetjedvvdeijeejledvieehueevueffnecukfhppedvudefrddufeegrddukeefrdehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudekfedrhedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohephedprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehpthihrggurghvsegrmhgriihonhdruggvpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhrihhnihhv rghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham 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?1753398641352408968?= X-GMAIL-MSGID: =?utf-8?q?1753398641352408968?= From: Rafael J. Wysocki When _PPC returns 0, it means that the CPU frequency is not limited by the platform firmware, so make acpi_processor_get_platform_limit() update the frequency QoS request used by it to "no limit" in that case and avoid updating the QoS request when the _PPC return value has not changed. This addresses a problem with limiting CPU frequency artificially on some systems after CPU offline/online to the frequency that corresponds to the first entry in the _PSS return package. While at it, move the _PPC return value check against the state count earlier to avoid setting performance_platform_limit to an invalid value. Reported-by: Pratyush Yadav Signed-off-by: Rafael J. Wysocki Tested-by: Pratyush Yadav --- drivers/acpi/processor_perflib.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) Index: linux-pm/drivers/acpi/processor_perflib.c =================================================================== --- linux-pm.orig/drivers/acpi/processor_perflib.c +++ linux-pm/drivers/acpi/processor_perflib.c @@ -53,6 +53,8 @@ static int acpi_processor_get_platform_l { acpi_status status = 0; unsigned long long ppc = 0; + s32 qos_value; + int index; int ret; if (!pr) @@ -72,17 +74,30 @@ static int acpi_processor_get_platform_l } } + index = ppc; + + if (pr->performance_platform_limit == index || + ppc >= pr->performance->state_count) + return 0; + pr_debug("CPU %d: _PPC is %d - frequency %s limited\n", pr->id, - (int)ppc, ppc ? "" : "not"); + index, index ? "is" : "is not"); - pr->performance_platform_limit = (int)ppc; + pr->performance_platform_limit = index; - if (ppc >= pr->performance->state_count || - unlikely(!freq_qos_request_active(&pr->perflib_req))) + if (unlikely(!freq_qos_request_active(&pr->perflib_req))) return 0; - ret = freq_qos_update_request(&pr->perflib_req, - pr->performance->states[ppc].core_frequency * 1000); + /* + * If _PPC returns 0, it means that all of the available states can be + * used ("no limit"). + */ + if (index == 0) + qos_value = FREQ_QOS_MAX_DEFAULT_VALUE; + else + qos_value = pr->performance->states[index].core_frequency * 1000; + + ret = freq_qos_update_request(&pr->perflib_req, qos_value); if (ret < 0) { pr_warn("Failed to update perflib freq constraint: CPU%d (%d)\n", pr->id, ret); From patchwork Tue Dec 27 19:52:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 36993 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1556423wrt; Tue, 27 Dec 2022 11:59:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXsvM9WrmSQ1juMzTxqZe4lqXLmLDkyaGSm97wmp5e29DgdRra6XuA8uI4pycICcBh4hSeAB X-Received: by 2002:a17:906:e98:b0:7c1:39e:db7e with SMTP id p24-20020a1709060e9800b007c1039edb7emr26207840ejf.59.1672171181615; Tue, 27 Dec 2022 11:59:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672171181; cv=none; d=google.com; s=arc-20160816; b=u3DlNgYjmu2qv6FBr1D+srgW6Ypxb99qEKO21QicAOv3i4xi0d+PVM8fW0MMy9XZB7 dYCNlHgrRyqZIN1TC4Sm82jTqTWmQPfDcFVQnU208AqHmoYYx6e1H3C7CcEA5ThabE0W Vi02v4uITrW8Iltxs9S9YSywvATUtWwGQEXFoWth0i8hv5ODd9T6CmdqrY3qgAUgeaWk 24+eRqjRA8Skzt4UMOxEWbDSETfcs2MObBzB/XiM6MrfjOwbAd6Y5k8bz5ya4iOQaKKY EHrCaypH0eH6/l6Wz/qtQCEikfwGe0zovlBPLU4JJGefePRDnKVmfDMxDpF9o7isdKmO Qweg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=FjwBQcmJLYYUvsZQZbuOre0DLNw9RXAPLprI+tZmh4g=; b=Uc6N2EP+5L13vLTF3V5V3D1JPHJ/tLOT5nKKjDsAlQNT+ppaRfhx8IfEruDMc9NX9w lv9dM6ISleLoouxaPZkZal4VZSXDjFYZt2+wLeRvbrPahqa4m/9XoVLyboC4JmPssKaX xk/LNxd0Ns6vM9X9KEllLGg0Cb6Jw3uPGQSleXA1pDPteO7RkUU4SjvEWxxKi+TIAdTE LSmK2G2wElAv1WFkad4Yd34IjoK00zFUS+qJT2CJgKW3zJiiokglv5zUYP5m/k2u4kz6 WYOXnBPAWUqGb7Ja3xkIm9nxajwL0tsAXgpdsdDTQBByu/U/TJBFycg2jmiNDM37afsd 1jnw== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g19-20020a1709065d1300b007c0eb33879asi12209100ejt.667.2022.12.27.11.59.17; Tue, 27 Dec 2022 11:59: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231842AbiL0TyD (ORCPT + 99 others); Tue, 27 Dec 2022 14:54:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbiL0Tx5 (ORCPT ); Tue, 27 Dec 2022 14:53:57 -0500 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17ABF110E; Tue, 27 Dec 2022 11:53:54 -0800 (PST) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.1.0) id ac6a96e2c458935b; Tue, 27 Dec 2022 20:53:52 +0100 Received: from kreacher.localnet (unknown [213.134.183.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id DA62D28A34C8; Tue, 27 Dec 2022 20:53:51 +0100 (CET) Authentication-Results: v370.home.net.pl; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: v370.home.net.pl; spf=fail smtp.mailfrom=rjwysocki.net From: "Rafael J. Wysocki" To: Linux PM Cc: Pratyush Yadav , LKML , Linux ACPI , Srinivas Pandruvada Subject: [PATCH v1 2/2] cpufreq: intel_pstate: Drop ACPI _PSS states table patching Date: Tue, 27 Dec 2022 20:52:36 +0100 Message-ID: <5908813.lOV4Wx5bFT@kreacher> In-Reply-To: <12138067.O9o76ZdvQC@kreacher> References: <12138067.O9o76ZdvQC@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 213.134.183.5 X-CLIENT-HOSTNAME: 213.134.183.5 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedriedtgddufedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppedvudefrddufeegrddukeefrdehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudekfedrhedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohephedprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehpthihrggurghvsegrmhgriihonhdruggvpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhrihhn ihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham 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?1753398568908112365?= X-GMAIL-MSGID: =?utf-8?q?1753398568908112365?= From: Rafael J. Wysocki After making acpi_processor_get_platform_limit() use the "no limit" value for its frequency QoS request when _PPC returns 0, it is not necessary to replace the frequency corresponding to the first _PSS return package entry with the maximum turbo frequency of the given CPU in intel_pstate_init_acpi_perf_limits() any more, so drop the code doing that along with the comment explaining it. Signed-off-by: Rafael J. Wysocki --- drivers/cpufreq/intel_pstate.c | 14 -------------- 1 file changed, 14 deletions(-) Index: linux-pm/drivers/cpufreq/intel_pstate.c =================================================================== --- linux-pm.orig/drivers/cpufreq/intel_pstate.c +++ linux-pm/drivers/cpufreq/intel_pstate.c @@ -452,20 +452,6 @@ static void intel_pstate_init_acpi_perf_ (u32) cpu->acpi_perf_data.states[i].control); } - /* - * The _PSS table doesn't contain whole turbo frequency range. - * This just contains +1 MHZ above the max non turbo frequency, - * with control value corresponding to max turbo ratio. But - * when cpufreq set policy is called, it will call with this - * max frequency, which will cause a reduced performance as - * this driver uses real max turbo frequency as the max - * frequency. So correct this frequency in _PSS table to - * correct max turbo frequency based on the turbo state. - * Also need to convert to MHz as _PSS freq is in MHz. - */ - if (!global.turbo_disabled) - cpu->acpi_perf_data.states[0].core_frequency = - policy->cpuinfo.max_freq / 1000; cpu->valid_pss_table = true; pr_debug("_PPC limits will be enforced\n"); From patchwork Wed Dec 28 21:26:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 37272 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2094317wrt; Wed, 28 Dec 2022 13:28:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXuEFeYgwkb0SGB19Tokv5zCK6Zn3IRHWj2mLCJ0J5RbSvkhYyoDm16uvco6rpHIDbuU/o3N X-Received: by 2002:a17:907:c202:b0:7c1:19e3:9f21 with SMTP id ti2-20020a170907c20200b007c119e39f21mr20799619ejc.7.1672262928964; Wed, 28 Dec 2022 13:28:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672262928; cv=none; d=google.com; s=arc-20160816; b=ZBPPnJ2agay62W3df8cTwriz9eisvZPNcxBioKen2aLyX8tXvWZ0gprKuA0O67LPAA gljGC/fscnVpgcIhw+ulUIGtg7kEJFayq3usk/aXwWilMh3v4q/RRvEWx4GjrmK+4Q5E j0PDKj89H9TWfCoqBEm9J6Z6s9NS4FDZAVJG7UqfGbMojBFcfNjwnJGZ2zWbM2mxVDYy 7qwE66K7jSrjMwb+qJZ/UORw0fSrqaA/4q6SxRdfZGEWqlc9/XuBsk1zYwalT2HSjb3b 2je2VVwCMu3WHIEaP7/krbAIQ7J7kBgKu2DKfuofwYUNN3hqUPp3eLkRCw8MZ3xPbIa0 Fmug== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=10UIk6D9X7SUYNOoN2MNT4q9OeCF4P0etVkIvtxGvhg=; b=ZINaL2FQfX8CC6z4g9eVVDwmc4zqGnC4gsVv7HP/aiA7ZRaRmlKDfMDFbhdZB6MWAt S7o8m8qRZz73GiyXnfxXQyOb8vroJRI3qjznqe8gp/5oXTcHDaKaBDT34DIIr6asWMGX /sT/S6PpEW27uYPCMJHeRtnERKf2EuhBJrz7kq+R6ax7t2OrQlVn/ZZ2yXzShpVIBo4o Rs7VRBzB0AzbkgNkdJfk6aD05sbqddoHShl/0BIJKFWj/g3tSPsTDhdSpgeCW8Wvn3nX ZnJr5lKXUMg17wnmXidEjOYmg5/bqd76SZjnyryB7wbsG5rIcrVccXyNb6l0bAcAEvuY V5ig== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd18-20020a1709069b9200b00711da52c6e4si15086581ejc.309.2022.12.28.13.28.25; Wed, 28 Dec 2022 13:28:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231346AbiL1V1W (ORCPT + 99 others); Wed, 28 Dec 2022 16:27:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229745AbiL1V1U (ORCPT ); Wed, 28 Dec 2022 16:27:20 -0500 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 273A8140B5; Wed, 28 Dec 2022 13:27:18 -0800 (PST) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.1.0) id 5f72451d9ceeb59f; Wed, 28 Dec 2022 22:27:16 +0100 Received: from kreacher.localnet (89-77-51-84.dynamic.chello.pl [89.77.51.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 0C8E9780AF8; Wed, 28 Dec 2022 22:27:16 +0100 (CET) Authentication-Results: v370.home.net.pl; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: v370.home.net.pl; spf=fail smtp.mailfrom=rjwysocki.net From: "Rafael J. Wysocki" To: Linux PM Cc: Pratyush Yadav , LKML , Linux ACPI , Srinivas Pandruvada Subject: [PATCH v2 3/3] cpufreq: intel_pstate: Drop ACPI _PSS states table patching Date: Wed, 28 Dec 2022 22:26:04 +0100 Message-ID: <2269998.ElGaqSPkdT@kreacher> In-Reply-To: <12138067.O9o76ZdvQC@kreacher> References: <12138067.O9o76ZdvQC@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 89.77.51.84 X-CLIENT-HOSTNAME: 89-77-51-84.dynamic.chello.pl X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedriedvgdduhedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppeekledrjeejrdehuddrkeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepkeelrdejjedrhedurdekgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohephedprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehpthihrggurghvsegrmhgriihonhdruggvpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhrihhnihhvrghs rdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham 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?1753398568908112365?= X-GMAIL-MSGID: =?utf-8?q?1753494773094342441?= From: Rafael J. Wysocki After making acpi_processor_get_platform_limit() use the "no limit" value for its frequency QoS request when _PPC returns 0, it is not necessary to replace the frequency corresponding to the first _PSS return package entry with the maximum turbo frequency of the given CPU in intel_pstate_init_acpi_perf_limits() any more, so drop the code doing that along with the comment explaining it. Signed-off-by: Rafael J. Wysocki --- v1 -> v2: * Same as the previous [2/2], no changes. --- drivers/cpufreq/intel_pstate.c | 14 -------------- 1 file changed, 14 deletions(-) Index: linux-pm/drivers/cpufreq/intel_pstate.c =================================================================== --- linux-pm.orig/drivers/cpufreq/intel_pstate.c +++ linux-pm/drivers/cpufreq/intel_pstate.c @@ -452,20 +452,6 @@ static void intel_pstate_init_acpi_perf_ (u32) cpu->acpi_perf_data.states[i].control); } - /* - * The _PSS table doesn't contain whole turbo frequency range. - * This just contains +1 MHZ above the max non turbo frequency, - * with control value corresponding to max turbo ratio. But - * when cpufreq set policy is called, it will call with this - * max frequency, which will cause a reduced performance as - * this driver uses real max turbo frequency as the max - * frequency. So correct this frequency in _PSS table to - * correct max turbo frequency based on the turbo state. - * Also need to convert to MHz as _PSS freq is in MHz. - */ - if (!global.turbo_disabled) - cpu->acpi_perf_data.states[0].core_frequency = - policy->cpuinfo.max_freq / 1000; cpu->valid_pss_table = true; pr_debug("_PPC limits will be enforced\n");