Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1683561imm; Sat, 4 Aug 2018 08:30:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcubobvIpV5wzJm4/8RFfX8hdCJRKo5nIdpqaIabzJ+PgD/5omA12KosJvRBrwxurADyL45 X-Received: by 2002:a62:d24a:: with SMTP id c71-v6mr9489554pfg.242.1533396651020; Sat, 04 Aug 2018 08:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533396650; cv=none; d=google.com; s=arc-20160816; b=w3jTHvPUUv+CwSGK3CcpTTC2Dd5IFb20oMI1sSvzjpNcrhNoQUgBOMNI4m0LyczKU9 IHXoJTsBKwC7wSn+6oFl8VgU2mvAf10QOUXbYnDjftFcXzY/RwoGTqyS8NZUfj4bDhhj TRVUkt29SHPO9nX6KUwmk2pnYJ+twsrccGEV3AaY4xhuFcDwZjUcveE23gstmxn9noei +3qxM57iGBqpJQAJV0klyOn4vGtjkAoFcxy66Tjy91yTrPqY5eMjhePRiRZBCzSl3DUj GaaNkIpY1mLxMUFcD5Zcu3zFNwU9qkhKtqIDsJEKC1co1Qt73Aw2eF7zPCXyQn/gzmda qiJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=lpJLt+byTH9gBcw8Y86Rn5DsC6r5w+nJ7vwnbHXQa+E=; b=AC94C6pMAN/rRCwAbikfW3A6klH5qx/3HmYJaJxfvyZN6OnlRxRlr6ys1kxDfd7wfT j53ZI7Y4cJXJ1s33wSw8HAxPn8NGeYlPOQR94k1COBV+qc2iyB16ZIPIxyqlju/pv8QZ m2wzjh00VZ0SAExFBWYqI/Xsm511rNrOkHmN67aOZ0yfMtdAIkFwLNLKERcmPXVBVoNC X5bumbh+nBvvxAEpYXfoejwflcKn4G7XcfJaOvo42p3N/UyoGzbOkDyLjhOlCdfhjrtN 25D9mjBSmQ6FBUERo85AyS1aBooFjylbHf/QC4ZgBflcuqKiDdPDjgxrGbVOzLbKEq4F haqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vPwlevwB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d38-v6si8039837pgl.88.2018.08.04.08.30.33; Sat, 04 Aug 2018 08:30:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vPwlevwB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728882AbeHDRao (ORCPT + 99 others); Sat, 4 Aug 2018 13:30:44 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37244 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727481AbeHDRao (ORCPT ); Sat, 4 Aug 2018 13:30:44 -0400 Received: by mail-wm0-f66.google.com with SMTP id n11-v6so9538461wmc.2; Sat, 04 Aug 2018 08:29:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=lpJLt+byTH9gBcw8Y86Rn5DsC6r5w+nJ7vwnbHXQa+E=; b=vPwlevwBg4+Q+N26+cGNm3/a55Uy0qe/hul5crkByNkPVtscsVe/r8if3wkKBhpo7k abfcq59bYO+aeJuGJ79pgls9fATKW3g+ghTnCGr9FGMOnm6hjbFWVUM/lzHPE0Lw5yWG C2g5NH5um4NNp3rkXfXqlIjIdYEP7aQreziN58Awcz498lkvPZEjkdXZ+DLsRpGB/xvQ zfQn3H/4ZkcpX3MnRrsYcTngEuENgJQuQiH0Ovn1QP67dUWPqOJo1biA0RGtqbJYAFgy 2FZ1z4eJ84f3RzdgirAQJ3J5vs32BqlYoQm/g57HJa6gO2AiNzESVGzxy8CfSFRV2y72 ThMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lpJLt+byTH9gBcw8Y86Rn5DsC6r5w+nJ7vwnbHXQa+E=; b=FETctUEjxtRMijTuizckNAG7aMJ2RwZZY1RyX5N6YflgNZLjE1rnaeWXKNboMWtAvF bchWXTgemouyqwbuS8AGcP1Muf8QekGP0sv/m5Ki3soGxVVEL27JSTfjcv9OoQ1xq/0F XuseL9dfWkuWi0IaM5rzQqjgQ1BT6SBXeUmZK4rSSuZfb4K3YQUvReopGxAhG99vh7dk Rgpqyo6mgsn2maLW73KSU75hXNaNHBEergMaXD11janfKuVlkXzeEIEnZEm4WW1OtSWA 9DXzhGEbfG2Q70JhxjrKWkuUP8D/ruXl1adEXm019X4HCDR7awasahn95ZDQAsU+zOZg V5UA== X-Gm-Message-State: AOUpUlHISfQPQWF2nG32zDuXSsGY7Gsc03cspVit4JECH6QxGH+wStbH YHMvOq24K4n9h1awB8UNbxaIIFY9 X-Received: by 2002:a1c:f306:: with SMTP id q6-v6mr7416143wmq.111.1533396580823; Sat, 04 Aug 2018 08:29:40 -0700 (PDT) Received: from xps13.fritz.box (2-230-197-194.ip203.fastwebnet.it. [2.230.197.194]) by smtp.gmail.com with ESMTPSA id z8-v6sm7027923wrp.54.2018.08.04.08.29.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Aug 2018 08:29:39 -0700 (PDT) From: Gabriele Mazzotta To: srinivas.pandruvada@linux.intel.com, rjw@rjwysocki.net Cc: lenb@kernel.org, viresh.kumar@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Gabriele Mazzotta Subject: [PATCH] Revert "cpufreq: intel_pstate: Fix ->set_policy() interface for no_turbo" Date: Sat, 4 Aug 2018 17:29:32 +0200 Message-Id: <20180804152932.3861-1-gabriele.mzt@gmail.com> X-Mailer: git-send-email 2.18.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This change does not take into account that some BIOSes change MSR_IA32_MISC_ENABLE_TURBO_DISABLE depending on the power source. If the turbo is disabled when the system boots, policy.max_freq is set to pstate.max_pstate. However, if the BIOS later enables the turbo, the CPU will never be able to run at pstate.turbo_pstate. Since now intel_pstate_set_policy() does its calculations using pstate.max_freq and pstate.turbo_freq, we can always calculate cpuinfo.max_freq using pstate.turbo_pstate, thus allowing system with varying MSR_IA32_MISC_ENABLE_TURBO_DISABLE to run at full speed when the turbo is enabled. This reverts commit 983e600e88835f0321d1a0ea06f52d48b7b5a544. Signed-off-by: Gabriele Mazzotta --- drivers/cpufreq/intel_pstate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 3c3971256130..4043aae2d611 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2068,9 +2068,8 @@ static int __intel_pstate_cpu_init(struct cpufreq_policy *policy) /* cpuinfo and default policy values */ policy->cpuinfo.min_freq = cpu->pstate.min_pstate * cpu->pstate.scaling; update_turbo_state(); - policy->cpuinfo.max_freq = global.turbo_disabled ? - cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; - policy->cpuinfo.max_freq *= cpu->pstate.scaling; + policy->cpuinfo.max_freq = + cpu->pstate.turbo_pstate * cpu->pstate.scaling; intel_pstate_init_acpi_perf_limits(policy); -- 2.18.0