Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1139153ybz; Wed, 22 Apr 2020 14:22:44 -0700 (PDT) X-Google-Smtp-Source: APiQypJr7E/Qsm3QYTCnS7zXHOd+I5o/UDW8kpufabrrGGxqgrE2UDmjvtK+P3e/oibmuwgL/XWl X-Received: by 2002:a50:b966:: with SMTP id m93mr478602ede.346.1587590564370; Wed, 22 Apr 2020 14:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587590564; cv=none; d=google.com; s=arc-20160816; b=gM107tSTkIEnCLGJx6Ieba2pxTneIy/U7XG+KFgNpV6z9z/m2sDWB8AJgMRP8iAKw7 pHuyjcRZTQpDykOPnNK/nhlN9BiwK/cITvVmYZRwjBk6MOuXUybPFAaSuePplgupFKaI 4Kvfzt0dfBeqA2gEwbxAVesXRCdZlRRDBydMIEdEicayYafP+bIIbpEkf6ePBymAX6nf U9fekYkjyRPeT7pLMPFhji2GG5KJC55SbmXFkBYroBHoosQqQhHF0adHmrbCirM8y18m g5NPfhxr8g3D7sb7rPWpdEn9ahDxkWzIT1pPgtb1sG9mZQk/zfztmE3OCMhFkAbufSb/ tkuA== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=GCzD7q7A+sHevxxrp/QKighLHaqAbs+0HgqZ4JTPjfU=; b=qf4dudkQASherMbcalcAIOHgZide9r2rzHblORASHtxB5gag6fcU3o2B4drplYDrss OyWOi/vjSHIU3OfiTY7jCcIcwwXt3cns0u1IC0Bzx/kWtZO7pQ2zIfsx8CM3/my8/hUw ayitb7Vrs/ywVEuxTtJsIIfy3CjQDTxTeP2oStnxEiTa0srjtiVc2nrdcbuYPWENSSIA IJOraL59hb3weL9axn39Ishu3QYbmMESrv9cSIX/Uj1Esg2xSOxpMMAf/7E+mGL+GZrj JiVln4gobG3g4J2MArwrei4zcHChyEarpqshteYgxOl6yvS7c0UfmrHfF395EGf7BjGA WFTQ== 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 d24si234183ejc.345.2020.04.22.14.22.21; Wed, 22 Apr 2020 14:22:44 -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 S1726644AbgDVVVH (ORCPT + 99 others); Wed, 22 Apr 2020 17:21:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbgDVVUy (ORCPT ); Wed, 22 Apr 2020 17:20:54 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40A89C03C1A9; Wed, 22 Apr 2020 14:20:54 -0700 (PDT) Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jRMnY-0000O3-DW; Wed, 22 Apr 2020 23:20:48 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 11BA01C02FC; Wed, 22 Apr 2020 23:20:48 +0200 (CEST) Date: Wed, 22 Apr 2020 21:20:47 -0000 From: "tip-bot2 for Giovanni Gherdovich" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/urgent] x86, sched: Move check for CPU type to caller function Cc: Giovanni Gherdovich , "Peter Zijlstra (Intel)" , "Rafael J. Wysocki" , x86 , LKML In-Reply-To: <20200416054745.740-5-ggherdovich@suse.cz> References: <20200416054745.740-5-ggherdovich@suse.cz> MIME-Version: 1.0 Message-ID: <158759044762.28353.12681151703116026868.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/urgent branch of tip: Commit-ID: db441bd9f630329c402d5cdd319f11bfcf509fb6 Gitweb: https://git.kernel.org/tip/db441bd9f630329c402d5cdd319f11bfcf509fb6 Author: Giovanni Gherdovich AuthorDate: Thu, 16 Apr 2020 07:47:45 +02:00 Committer: Peter Zijlstra CommitterDate: Wed, 22 Apr 2020 23:10:13 +02:00 x86, sched: Move check for CPU type to caller function Improve readability of the function intel_set_max_freq_ratio() by moving the check for KNL CPUs there, together with checks for GLM and SKX. Signed-off-by: Giovanni Gherdovich Signed-off-by: Peter Zijlstra (Intel) Acked-by: Rafael J. Wysocki Link: https://lkml.kernel.org/r/20200416054745.740-5-ggherdovich@suse.cz --- arch/x86/kernel/smpboot.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index dd8e15f..8c89e4d 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1877,9 +1877,6 @@ static bool knl_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq, int err, i; u64 msr; - if (!x86_match_cpu(has_knl_turbo_ratio_limits)) - return false; - err = rdmsrl_safe(MSR_PLATFORM_INFO, base_freq); if (err) return false; @@ -1977,7 +1974,8 @@ static bool intel_set_max_freq_ratio(void) skx_set_max_freq_ratio(&base_freq, &turbo_freq, 1)) goto out; - if (knl_set_max_freq_ratio(&base_freq, &turbo_freq, 1)) + if (x86_match_cpu(has_knl_turbo_ratio_limits) && + knl_set_max_freq_ratio(&base_freq, &turbo_freq, 1)) goto out; if (x86_match_cpu(has_skx_turbo_ratio_limits) &&