Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9949128pxu; Tue, 29 Dec 2020 09:18:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWIPO4IMEIG1UOgJ47ViRKg+/m1NfRoEtzpGQesHxmDcw4x4zyf5guCepjOFliO/B+SnOs X-Received: by 2002:a50:ce13:: with SMTP id y19mr47237522edi.241.1609262285960; Tue, 29 Dec 2020 09:18:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609262285; cv=none; d=google.com; s=arc-20160816; b=yUWDZJJ07AuzSJLFSio4A5jAF5ivQHSPRrc3axuQhfnbweSO1B2Bd/7lCZs7iU1pQO +fgjtEAl0nSuDaMUYKmm4yP+G9Tk2CorrjcjpgbJ5N+A6OxMgDc/0kfRU9pZGFzOjLgQ t3WwGEAhPdh/fjWvc5i0emwaDSHJ+j7GitR3hWHmIfr8HW0BlelqrBKL6ozjmjxwofpo Hui8PHKLDipOdvMNCvuRIFv7GTg9YLzLe5u6+zrhkQ4xxEc04YuPrWStrV3RCDFZd4bM 9/D6Czs5PPO1TbXvj4YjYM0A+UdSqFCevaPEMSdDD8L42eC8dgABAxDy1Be9dgH1hRmU lLJQ== 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=rAZoJvC1l5EZc8iBS38/h+xn+xUTjKvig0d5qdRND6I=; b=zMFi3Z2mYOXtZDL1zi8838AWkguf9smiLW7TdRnX7qjnMaWudypZfkYiWkNEfmSCwN 8fXedVXHH0ceW0dAfqgBfAe+PUf15irAZgH5nhT3DJ9k21iPz0Laj2QvK2rvN3YkU39Y nqXyAu5TfmXko0NgYx7aHvBWL8pqu7YQtfWBRhfs36tY/WLh4ZUGLhHU13EgA7AlL57t VDoc2m8d81r9WbS0SzJFlJyPA8XD2EEZHXP/DA+mb1oe+OUy6lILcL4A33ADmGaemZ2r pQZVne+5sbOZIvkk8nLcukCs8Obe5zZ2dNQEQeiUE1WkX+k2XZiqoC0Bpz4NReuhcVp2 aqrw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p5si9679207edt.50.2020.12.29.09.17.43; Tue, 29 Dec 2020 09:18:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726356AbgL2RQH (ORCPT + 99 others); Tue, 29 Dec 2020 12:16:07 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:56434 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726144AbgL2RQH (ORCPT ); Tue, 29 Dec 2020 12:16:07 -0500 Received: from 89-64-79-59.dynamic.chello.pl (89.64.79.59) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.537) id 49482a060e45e105; Tue, 29 Dec 2020 18:15:24 +0100 From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Srinivas Pandruvada , "Kenneth R. Crudup" Subject: [PATCH] cpufreq: intel_pstate: Fix fast-switch fallback path Date: Tue, 29 Dec 2020 18:15:23 +0100 Message-ID: <2586979.mvXUDI8C0e@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki When sugov_update_single_perf() falls back to the "frequency" path due to the missing scale-invariance, it will call cpufreq_driver_fast_switch() via sugov_fast_switch() and the driver's ->fast_switch() callback will be invoked, so it must not be NULL. However, after commit a365ab6b9dfb ("cpufreq: intel_pstate: Implement the ->adjust_perf() callback") intel_pstate sets ->fast_switch() to NULL when it is going to use intel_cpufreq_adjust_perf(), which is a mistake, because on x86 the scale-invariance may be turned off dynamically, so modify it to retain the original ->adjust_perf() callback pointer. Fixes: a365ab6b9dfb ("cpufreq: intel_pstate: Implement the ->adjust_perf() callback") Reported-by: Kenneth R. Crudup Signed-off-by: Rafael J. Wysocki --- drivers/cpufreq/intel_pstate.c | 1 - 1 file changed, 1 deletion(-) Index: linux-pm/drivers/cpufreq/intel_pstate.c =================================================================== --- linux-pm.orig/drivers/cpufreq/intel_pstate.c +++ linux-pm/drivers/cpufreq/intel_pstate.c @@ -3088,7 +3088,6 @@ static int __init intel_pstate_init(void intel_pstate.attr = hwp_cpufreq_attrs; intel_cpufreq.attr = hwp_cpufreq_attrs; intel_cpufreq.flags |= CPUFREQ_NEED_UPDATE_LIMITS; - intel_cpufreq.fast_switch = NULL; intel_cpufreq.adjust_perf = intel_cpufreq_adjust_perf; if (!default_driver) default_driver = &intel_pstate;