Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1000975ybh; Mon, 13 Jul 2020 07:00:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw87YIjWJLu0Ll3s5waevNYSR8gOyq4FJpfCl05SuCn21lYcrtOW/npdEoIGHV71xdvvbva X-Received: by 2002:a17:907:94d3:: with SMTP id dn19mr7993633ejc.18.1594648803907; Mon, 13 Jul 2020 07:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594648803; cv=none; d=google.com; s=arc-20160816; b=eGvU1GWRbIN+235l0mywcSOm1Yue4G4gBasSRsKzM0GqsyRzPA6GA6ezfmVggchSxY Lb92uTGROQeJfz6lyz+hoI/smL7w5n9TT3OLsp3rVcbJtlVyQW7bkdfoW6PV1eL/3D6M juGMIK4q2iRFAABDygrRzdChcTrXwk66jXwUEkYY/UN79yrF/3LCguIUqgvGxzq/ULUO mGZY56fXha2IHC8qczjhOJa9tjzYaxFFdSnDp4o4tvNXRfaZbWpBOtCN7YbOcu5K3QN4 gjG9/t+3DHjoBeAU1mDFMcobMxseJjWLPQi61qHNPT6k31I+4TxWgilH8/agE2fi3RYa 7LsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=b2UWecRLy+Rercjm5sZrh0tL+DA7MM2QwAk3+mn1x/k=; b=oN3K21R4bARihC98yIYVfdcbi6wzXkyALYBYLVYGBucrDiza7dzW3gi6NvQErimTno DJi1gRrJOWJRgja6nBNH2Rio+PppAfce5490pNt78a2X+0pPIjg0Ep+c9fDp748wwZX8 G2iXMnJJjEkoPyB9MfFTpXCSAc+niZkBWD19aap9Hc6gUR92xOak0RcmqYvxbcnPMvEG x0haQzv54+zztNG4a0NPiSodwxl9fmvIjSc0xCAg0H3NvxFYQ/1Af44Oqs7ZOOiGxm9S EnYMVL8LlfeZReU4yk9RfbpSpb20LzN+FQUY2MZ0EKy3aJaCOsZ/IB1UjsLkrdDrVNbN 6Ttg== 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 m3si9597901edv.382.2020.07.13.06.59.40; Mon, 13 Jul 2020 07:00:03 -0700 (PDT) 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 S1729796AbgGMN6l (ORCPT + 99 others); Mon, 13 Jul 2020 09:58:41 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:64980 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729457AbgGMN6l (ORCPT ); Mon, 13 Jul 2020 09:58:41 -0400 Received: from 89-64-85-181.dynamic.chello.pl (89.64.85.181) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.415) id 68383a73e20a7f42; Mon, 13 Jul 2020 15:58:39 +0200 From: "Rafael J. Wysocki" To: Linux PM Cc: Doug Smythies , LKML , Srinivas Pandruvada Subject: [PATCH] cpufreq: intel_pstate: Fix active mode setting from command line Date: Mon, 13 Jul 2020 15:58:38 +0200 Message-ID: <2265724.DSYBgs0BIW@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki If intel_pstate starts in the passive mode by default (that happens when the processor in the system doesn't support HWP), passing intel_pstate=active in the kernel command line doesn't work, so fix that. Fixes: 33aa46f252c7 ("cpufreq: intel_pstate: Use passive mode by default without HWP") Reported-by: Doug Smythies Signed-off-by: Rafael J. Wysocki --- drivers/cpufreq/intel_pstate.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) Index: linux-pm/drivers/cpufreq/intel_pstate.c =================================================================== --- linux-pm.orig/drivers/cpufreq/intel_pstate.c +++ linux-pm/drivers/cpufreq/intel_pstate.c @@ -2534,7 +2534,7 @@ static struct cpufreq_driver intel_cpufr .name = "intel_cpufreq", }; -static struct cpufreq_driver *default_driver = &intel_pstate; +static struct cpufreq_driver *default_driver; static void intel_pstate_driver_cleanup(void) { @@ -2828,6 +2828,7 @@ static int __init intel_pstate_init(void hwp_active++; hwp_mode_bdw = id->driver_data; intel_pstate.attr = hwp_cpufreq_attrs; + default_driver = &intel_pstate; goto hwp_cpu_matched; } } else { @@ -2845,7 +2846,8 @@ static int __init intel_pstate_init(void return -ENODEV; } /* Without HWP start in the passive mode. */ - default_driver = &intel_cpufreq; + if (!default_driver) + default_driver = &intel_cpufreq; hwp_cpu_matched: /* @@ -2899,6 +2901,8 @@ static int __init intel_pstate_setup(cha if (!strcmp(str, "disable")) { no_load = 1; + } else if (!strcmp(str, "active")) { + default_driver = &intel_pstate; } else if (!strcmp(str, "passive")) { default_driver = &intel_cpufreq; no_hwp = 1;