Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp796820ybz; Wed, 15 Apr 2020 19:18:46 -0700 (PDT) X-Google-Smtp-Source: APiQypJ6mRnZRgmDBmn5/linx56ATBRnM0X00ItXDARgxY/EpWORW0HuzjUbfQPtDw1IY7FE3jfi X-Received: by 2002:a17:907:40ec:: with SMTP id nn20mr7252744ejb.294.1587003526424; Wed, 15 Apr 2020 19:18:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587003526; cv=none; d=google.com; s=arc-20160816; b=i/7YXyhghisczjCaDRC8Q/XlnQdlZHcTkI9d202kZCLwOs8V5HMcHgsw4kDSB9zfhu ad0tiVIIkpgBj+vx1N7vLlnHWRySKf2x787Nsw22Z0L+VFHct5YWWnBe/42RmjHk21Ik XRh8ejWOC6fXS8fwCCtfuOxeFCNWhneffNkbwC2Oox2kfwErD4YOnnrYXbitiwy/JZNE 9QkUTD8z29L5BI4b4LzOLo+TeJ1xV5lzrIH2YM436nEuB1R9ma0zEnUFeiKHYNrUk7Tv 1+I5DAxXE4Rw69OOqPgs74BCrRvcklkGDJ/xamWfiOvU+aUAvIzRmEvVx+o74LHc6zrB rW3Q== 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:ironport-sdr:ironport-sdr; bh=gZe6nspy7iJBEUk7bDQxgP0r6hBFEWRh+h28MnfMboU=; b=Qf8bLPP34rNNN/Vz0bButVKr0MPu7lmXI2hP+vaRVKBz0gNxgwTtD85LcPM8zvFewW 04CNQfiJQwnF7IZNUgh++4p4Zmm04sAOfRPfE8LG+zKCVlC46q66ZhD17IlbDcMu6ee0 UibgFroGnnFmPplbBxjEseFlKUOKvzSZPo7BIjVHjgoULUB7omIe5oZg8sAjgxpwuH4E 9HOf9+E0vrVyvIKykhHzPT+vyDh08AdoNDr79Dyu1XtXXUjAKYhalZ/oCKop5lhzkLpB dnStp4iD9L0A92QO00cdXA6YuxHhEgrv++wrzWkd2RmUppOMrgfDAIDeiCN+lfcxMC6N ohTQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sb9si10666936ejb.156.2020.04.15.19.18.23; Wed, 15 Apr 2020 19:18:46 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731406AbgDPCP1 (ORCPT + 99 others); Wed, 15 Apr 2020 22:15:27 -0400 Received: from mga11.intel.com ([192.55.52.93]:24224 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728397AbgDPCPZ (ORCPT ); Wed, 15 Apr 2020 22:15:25 -0400 IronPort-SDR: 5kUEnbAvK/Mx1yZRyTG6Q2TETDkYNkp+4Jc6PS4ZVc6s/PfyQahzaHIJgcs1WYvgJlcP7QVnne w3DGibsAAfXQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2020 19:15:24 -0700 IronPort-SDR: NKlEa2tHbkW20Gfo3x7x+9Z+3A45Evl4V9/jfkTylSugrhsAx4kodqRLxGM+K9ve0DiT+boOEV 5FX8N7/4lYmA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,388,1580803200"; d="scan'208";a="245851601" Received: from sqa-gate.sh.intel.com (HELO clx-ap-likexu.tsp.org) ([10.239.48.212]) by fmsmga008.fm.intel.com with ESMTP; 15 Apr 2020 19:15:23 -0700 From: Like Xu To: Giovanni Gherdovich Cc: linux-kernel@vger.kernel.org, Like Xu Subject: [PATCH] x86, smpboot: Disable frequency invariance when it's unsupported Date: Thu, 16 Apr 2020 10:12:10 +0800 Message-Id: <20200416021210.170736-1-like.xu@linux.intel.com> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On the Intel SNR processors such as "Intel Atom(R) C6562", the turbo_freq for 4C turbo may be zero which causes a divide by zero exception and blocks the boot process when arch_scale_freq_tick(). When one of the preset base_freq or turbo_freq is meaningless, we may disable frequency invariance. Fixes: 1567c3e3467c ("x86, sched: Add support for frequency invariance") Signed-off-by: Like Xu --- arch/x86/kernel/smpboot.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index fe3ab9632f3b..741367ce4d14 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1958,6 +1958,9 @@ static bool core_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq) *base_freq = (*base_freq >> 8) & 0xFF; /* max P state */ *turbo_freq = (*turbo_freq >> 24) & 0xFF; /* 4C turbo */ + if (*turbo_freq == 0 || *base_freq == 0) + return false; + return true; } -- 2.21.1