From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4018FC43467 for ; Thu, 8 Oct 2020 11:12:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A318020714 for ; Thu, 8 Oct 2020 11:12:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dark/b6d"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="ao0j86RL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A318020714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OpYxl/rqXAP8wdNttDfl+dO9VvJ0DPMaU+vkOHAnQ0Y=; b=dark/b6dnql222kTnq/nFTEi3 NqLS13MignbkkmwrfrXpX0INX4mXgVZ8Wev4lJ44/jVQGeShbYdiJEzsA9A1xs3t1zCpUbH5O4Jwk qoxISb1TsMOm8NS3/WiELpEv3mJ5nzcrhZGeWi8uJyISGPZ2STu3PU8zaKpxyEXKRn1R2UaaqV35I x8du2/taZhUcXM6lG7QitAPWSEIHodx8TbHq31WrzBFTDadF1XnLHhqEUgrLxKzO3pRMBsT81NkDo Zw2DL2naJHE8UiWLXzKTpKJHgu0d/ClNJ2/bGaijQhDwIbqiEUB7LwTHMLo/n5+peJLyBHFtDo5YR 85zHjK0ZA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQTpP-0008E5-4t; Thu, 08 Oct 2020 11:11:19 +0000 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQTpL-0008D4-OX for linux-arm-kernel@lists.infradead.org; Thu, 08 Oct 2020 11:11:16 +0000 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 08 Oct 2020 04:11:00 -0700 Received: from [10.24.37.103] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 8 Oct 2020 11:11:09 +0000 Subject: Re: [Patch 2/2] cpufreq: tegra194: Fix unlisted boot freq warning To: Viresh Kumar References: <1600276277-7290-1-git-send-email-sumitg@nvidia.com> <1600276277-7290-3-git-send-email-sumitg@nvidia.com> <20201005045414.fmntm7ejad7zxcrv@vireshk-i7> <2c0daaa5-4aec-925d-c1e3-0f15fb93cc20@nvidia.com> <20201006053856.dth6ut22pvwpgfz5@vireshk-i7> From: Sumit Gupta Message-ID: <7e285f41-e1ae-e352-9d1b-efd4d20ddfa3@nvidia.com> Date: Thu, 8 Oct 2020 16:41:06 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20201006053856.dth6ut22pvwpgfz5@vireshk-i7> Content-Language: en-US X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1602155460; bh=hR+PWuPTBEUl+VVWHX31EggS7H8qb+R7ZpsXaE0Epu0=; 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=ao0j86RLttzZX8O9MHWgexWKwOryKCi+GkFEnZRe2QUANKDxB4j9iHQca2GuGIi2w XJ/uDV6etWopwbRNTFnkne8hr1W9A4mlQS20PcAigOJgThI9o5ftRMSM6w4T8K1Z4e oz2uaH3WfUK3GZwibveyhcH/qXoctjAj/SLyvlb/RtAiTT0fX1BUxVMs6dbC+Yhk6b Z7+vBPqp8soOWkFvuGp46yYc/cDMrY7uiW4wMRrv0FsGS2muwRef2KaCtjpYelelwO E9IsNr76dARDUVjgoxofjgW8EcUdj/WDdFh+rFELLxxILtMF6jPbmfegKgjTeH0uWt VLcgWKh77tCPQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201008_071115_927371_642D81DF X-CRM114-Status: GOOD ( 23.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bbasu@nvidia.com, linux-pm@vger.kernel.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, jonathanh@nvidia.com, ksitaraman@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org, Sumit Gupta , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org >> >>>> Warning coming during boot because the boot freq set by bootloader >>>> gets filtered out due to big freq steps while creating freq_table. >>>> Fixing this by setting closest ndiv value from freq_table. >>>> Warning: >>>> cpufreq: cpufreq_online: CPU0: Running at unlisted freq >>>> cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed >>>> >>>> Also, added change in init to wait till current frequency becomes >>>> equal or near to the previously requested frequency. This is done >>>> because it takes some time to restore the previous frequency while >>>> turning-on non-boot cores during exit from SC7(Suspend-to-RAM). >>> >>> So you are trying to figure if the frequency is listed in freq-table or not, >>> otherwise setting the frequency to a value you think is appropriate. Right ? >> During boot, want to set the frequency from freq_table which is closest to >> the one set by bootloader. > > Right. > >> During resume from suspend-to-idle, want to restore the frequency which was >> set on non-boot cores before they were hotplug powered off. > > Why exactly do you want to do that ? Rather you should provide > online/offline hooks for the cpufreq driver and do light-weight > suspend/resume as is done by cpufreq-dt.c as well. > Thank you for pointer. Added online hook to avoid warning during hot-plug-on for the non-boot CPU's while exiting from Suspend-to-RAM. Will send new version with the changes. >>> >>> This is what the cpufreq core already does when it printed these boot time >>> messages. Do we really need to add this much code in here ? >> We want to avoid the warning messages. > > Hmm, okay. > >>> >>> If you really don't want to see the warning, how about fixing it the way cpufreq >>> core does ? i.e. with this call: >>> >>> ret = __cpufreq_driver_target(policy, policy->cur - 1, CPUFREQ_RELATION_L); >>> >> The cpufreq core change will help in bootup case but not during the case of >> resume. >> In this change, reading the previously stored value and restoring it will >> also fix the warning message during resume. > > You were getting the message during resume as well ? Why ? The > firmware is updating the frequency to a previous value ? If that is > so, you should just set the frequency again to some other value during > resume to fix it. Yes, it boots at a predefined frequency and then some time is taken to restore the last frequency which software requested before entering Suspend-to-RAM. We don't need to re-write the register again. > > -- > viresh > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel