Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3186470pxb; Mon, 16 Nov 2020 07:58:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFaK6YrOJIsjNLj3e7SCuijAEl/Soltj8HkIVWou8RjIDbDgRxsm+y/JSEJvn23L8icpZY X-Received: by 2002:aa7:ccd2:: with SMTP id y18mr16415969edt.11.1605542313461; Mon, 16 Nov 2020 07:58:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605542313; cv=none; d=google.com; s=arc-20160816; b=QiZRfKL4uFsr2/TseJJ+n0ODhtoPARZqDR/BN3DLvhiXp/LsNn5SoSX+AOJGzsHfUZ 1vHXW0UZRL3jC55w0/RATkYfk4E6QZt45dPZ32VzrAbuiGdd1HhFOjXo4P3yP28WNleA I2LQKDzai//U9rRZwvlJpMQsaaJQnxK8OYEtZMu9HDm87lUGyhB01F6Yggj8sqxjw8qJ RuutuQcB8fXWpVR56fT0vFKb7LysRm6w5SPsFTYFZo1MrOyY73T4dCqb2QS1szTc+5c3 q/3psFNcH6oEgXLOg1pMmyE4ahOBmoXxtiQX10dgLTEOSzYmLxB82skVImT92aVlm56q WIhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=prnEH1LcsAwXu7hHuEMMYjPWoCkjQia/rAmzh/Hqu/I=; b=jtejycTnujx9zpQ+oposDQgcZxztS74TgemJ2WG9xWS53ZgbJ/CIvzWMosZ9kLDX9K VK3JsSpdwo+/cowKF0KOQC/FOopB287kGX1Vf6mbwTgHvhH+PXnWpvkbz+8CQ6OUN8KP Qu74qRWVXa8n2x3/TXoUO7Htzok3UqfWB7N4RlH6qAqRuVFPyEad4ZBgtOU/gDKssq12 pK8ckBwrGgtZVFoO/nkeh5a61apV6pKWwbp+rGC0PRqGHLYQgrfNdqcLNi88HvzCBaL1 A/Yh7gm6TI34lw3O85H0S3gICWlOi3jSlbiJf+EknMKO8GGqbPlRctYB9EVUYRZfzdjm 7IYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=cnzTumrN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gu3si9363913ejb.641.2020.11.16.07.58.10; Mon, 16 Nov 2020 07:58:33 -0800 (PST) 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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=cnzTumrN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731640AbgKPPz2 (ORCPT + 99 others); Mon, 16 Nov 2020 10:55:28 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:12832 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730305AbgKPPz1 (ORCPT ); Mon, 16 Nov 2020 10:55:27 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Mon, 16 Nov 2020 07:55:31 -0800 Received: from [10.26.75.250] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 16 Nov 2020 15:55:25 +0000 Subject: Re: [PATCH] cpufreq: tegra186: Fix get frequency callback To: Viresh Kumar , "Rafael J . Wysocki" CC: Thierry Reding , Sumit Gupta , , , References: <20201103115514.547047-1-jonathanh@nvidia.com> <20201104093349.l3r3eftwyvaoqjf2@vireshk-i7> From: Jon Hunter Message-ID: Date: Mon, 16 Nov 2020 15:55:23 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201104093349.l3r3eftwyvaoqjf2@vireshk-i7> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1605542131; bh=prnEH1LcsAwXu7hHuEMMYjPWoCkjQia/rAmzh/Hqu/I=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=cnzTumrNVjfPzHypZW9c1rPcTi06Rp1UkpXmERZtXndKM4iBoFvFQwti5imoRl98O vCtILSa5k4EILJAqQkvHuOnYuYVNo0gw6Mbi8i0I52pbMNpGssMnsLmIFUJnepJclt GTpK+geDVI5SPAzPQVtJunGM1UJitW/bxSby0zFWbzosvrxrSaU7NcH/MV49K5/XJQ zJH0tYvtgHZ5+YXpj22+MFrb6Dz+DsWYJDWcx10/JFiyIhsyHNoRaWoL1mzkqEfnB0 D6vy3JnAFL7LMY4vBUJJYQH9Pp1kyk1P6IJ2DQequk9sEZkTIaeLQ+CZ62WSsTvAwd PaQjSgoJoqaJw== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rafael, On 04/11/2020 09:33, Viresh Kumar wrote: > On 03-11-20, 11:55, Jon Hunter wrote: >> Commit b89c01c96051 ("cpufreq: tegra186: Fix initial frequency") >> implemented the CPUFREQ 'get' callback to determine the current >> operating frequency for each CPU. This implementation used a simple >> looked up to determine the current operating frequency. The problem >> with this is that frequency table for different Tegra186 devices may >> vary and so the default boot frequency for Tegra186 device may or may >> not be present in the frequency table. If the default boot frequency is >> not present in the frequency table, this causes the function >> tegra186_cpufreq_get() to return 0 and in turn causes cpufreq_online() >> to fail which prevents CPUFREQ from working. >> >> Fix this by always calculating the CPU frequency based upon the current >> 'ndiv' setting for the CPU. Note that the CPU frequency for Tegra186 is >> calculated by reading the current 'ndiv' setting, multiplying by the >> CPU reference clock and dividing by a constant divisor. >> >> Fixes: b89c01c96051 ("cpufreq: tegra186: Fix initial frequency") >> >> Signed-off-by: Jon Hunter >> --- >> drivers/cpufreq/tegra186-cpufreq.c | 33 +++++++++++++++++++----------- >> 1 file changed, 21 insertions(+), 12 deletions(-) > > Acked-by: Viresh Kumar > > Rafael: This needs to go in the next rc and so I am not applying it > in my tree as this is the only fix I have for now. Are you able to pick this up for v5.10 fixes? Thanks Jon -- nvpublic