Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5246933imu; Tue, 15 Jan 2019 14:01:43 -0800 (PST) X-Google-Smtp-Source: ALg8bN70VnuF0vSJ8yJXYHb6jzsuG0HXOlHupCj0jhsQ1MrdCob3416k8QXjYyrdD5oUdTQ23ic9 X-Received: by 2002:a63:dd15:: with SMTP id t21mr5510487pgg.347.1547589703777; Tue, 15 Jan 2019 14:01:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547589703; cv=none; d=google.com; s=arc-20160816; b=1BSohzjNm7Pf+brvj8POyd5UUBkPhPV43p/xSrTI/t5ih5bXxc37Ms4Kd7zgjD247y h4cKa+6RnvqYOVzzUfIGvyJHEESUUv2YYjIRzWpbitXZ2Hfr0PV9RKKNIcxEy8E7flvJ AsuqkLu2MGSdhoOev4C02g3b/12O0hGL86WZ4GcK19XmUqlIQ6D6aiUijlf4wOrSzlcD Zz4zaLsQWAyiDLMFXTc6hyntq2VxPMzzK/wJ/mhSQes14LWQyM0x5LyprelbFqd501JB HPL4K5hGm0oEpNY/3ZFgIZ+JzN8pTQWnv59UH7ysPbNeULTqW6AgIsdJbeKP6jeL7jPv 7NfA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dxYNqa7k2DlDuCNpIQ9TSmAGg4T/zQ9zB7AVkghS+rw=; b=YucknNEIZF3UqofSgWdz0c3eTkcqEezVeTnZXFbSIaDM+hHPPsFIqUg3sCP+xSA6J0 U4GNNo2WxdZYhWviEkihpv7tDWwgXiy8Sm9JKvJpmOM9nVOnlP67zF6jZP5mNKbSCBmn 44caxSh+byJlTVjUmx9SWr2Nq8Idt8V6sz4Qlia+vHdQ2KVaFXm04Cv0StxWpZ6SruUg vX9c00v7sTwedT/AxbsnykOmbitL08mZPKWGdHR8j0JXtSiYUePFa0StfP7oRuHa7XS9 vilI/n4FUd7eOy3ygbS7s0sEavY6N05WrOVOMoUyKOta849HTzc3Vv/BX2l/m184EtwP ktaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zAdBGpdK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si4208276pgh.195.2019.01.15.14.01.24; Tue, 15 Jan 2019 14:01:43 -0800 (PST) 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=@kernel.org header.s=default header.b=zAdBGpdK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387633AbfAOQow (ORCPT + 99 others); Tue, 15 Jan 2019 11:44:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:34362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729683AbfAOQor (ORCPT ); Tue, 15 Jan 2019 11:44:47 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3E71820859; Tue, 15 Jan 2019 16:44:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547570686; bh=NTmBDdXPRGSej3dh3gdJQhXc2efILJUEdO3ANsK+fuM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zAdBGpdK+BRf3If16Npdha2/5ng3wcoRsmjFsaadmCtuGVxp03De1a3v+kTtxCR8U OANARquo7iLVcs/hvfNiLbzbxYDlytWP8XYoo12E/OrzSYBGBS0N3+9d3C6lAxzOZw T4BQxnJY2hIhDcystwCOT23VGuWrnF234iOQriEk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quentin Perret , Viresh Kumar , Sudeep Holla , "Rafael J. Wysocki" Subject: [PATCH 4.20 07/57] cpufreq: scmi: Fix frequency invariance in slow path Date: Tue, 15 Jan 2019 17:35:48 +0100 Message-Id: <20190115154911.125770571@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190115154910.734892368@linuxfoundation.org> References: <20190115154910.734892368@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Quentin Perret commit 0e141d1c65c1dd31c914eb2e11651adcc1a15912 upstream. The scmi-cpufreq driver calls the arch_set_freq_scale() callback on frequency changes to provide scale-invariant load-tracking signals to the scheduler. However, in the slow path, it does so while specifying the current and max frequencies in different units, hence resulting in a broken freq_scale factor. Fix this by passing all frequencies in KHz, as stored in the CPUFreq frequency table. Fixes: 99d6bdf33877 (cpufreq: add support for CPU DVFS based on SCMI message protocol) Signed-off-by: Quentin Perret Acked-by: Viresh Kumar Acked-by: Sudeep Holla Cc: 4.17+ # v4.17+ Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/cpufreq/scmi-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -52,9 +52,9 @@ scmi_cpufreq_set_target(struct cpufreq_p int ret; struct scmi_data *priv = policy->driver_data; struct scmi_perf_ops *perf_ops = handle->perf_ops; - u64 freq = policy->freq_table[index].frequency * 1000; + u64 freq = policy->freq_table[index].frequency; - ret = perf_ops->freq_set(handle, priv->domain_id, freq, false); + ret = perf_ops->freq_set(handle, priv->domain_id, freq * 1000, false); if (!ret) arch_set_freq_scale(policy->related_cpus, freq, policy->cpuinfo.max_freq);