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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19FB4C43334 for ; Thu, 30 Jun 2022 09:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234309AbiF3J5W (ORCPT ); Thu, 30 Jun 2022 05:57:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234619AbiF3J5T (ORCPT ); Thu, 30 Jun 2022 05:57:19 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6B4543ACD; Thu, 30 Jun 2022 02:57:18 -0700 (PDT) Received: from [192.168.2.145] (unknown [109.252.118.164]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id E21336601948; Thu, 30 Jun 2022 10:57:16 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1656583037; bh=q8/O3O9cAhPR9Cw2/yL31YTcTztXCqBC3JyU3IRJV6w=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=CjzdPE+le26ptVF7yKxrthrH553wOh4ZGUcJWjlPN741GxPd/+Cp/8DP2Pu++2X3v 0UTM43e18ilosLAMvbE+hHdx2ZACU9wFpVjrpHvBNw//+jn2Ej/XWx0SzE+uGEDNKF HeElZTbqMEZ4Az8g2BNH/vqBjqg5YRh6dOB4myXdfOQzR6rF8jCOrLlg+//CDlI86n u0OyRLor47xOcUnTeaB0eV9lVz4Gnwc7Rhe8PzgqD38uzrvKXMcQ598GI87ooyzoEA rGOT+q0PLgfPIM+faQHKk5JQwxGK1kjr7LRPdBoDS4IqTU5goUAtLDBZtPtgycc8l4 12uyZp4FYJLrw== Message-ID: Date: Thu, 30 Jun 2022 12:57:13 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 5/8] OPP: Allow multiple clocks for a device Content-Language: en-US To: Viresh Kumar Cc: Jon Hunter , Krzysztof Kozlowski , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org, "linux-tegra@vger.kernel.org" References: <8b29fa207024dc295639f9ba52c28e45782e3baa.1654849214.git.viresh.kumar@linaro.org> <55623c12-dda3-613f-5bc9-80b3b6fec5f9@nvidia.com> <20220622141511.yzg5itkdwirpavfj@vireshk-i7> <40e616eb-22f9-19c2-8d77-20cd3c7c518b@nvidia.com> <20220630005028.fddtcbkoksbygwc5@vireshk-i7> <8367c38b-8cd3-cde1-5833-874769ef3350@collabora.com> <20220630095245.otvo53ezd4avoujw@vireshk-i7> From: Dmitry Osipenko In-Reply-To: <20220630095245.otvo53ezd4avoujw@vireshk-i7> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org On 6/30/22 12:52, Viresh Kumar wrote: > On 30-06-22, 12:13, Dmitry Osipenko wrote: >> On 6/30/22 03:50, Viresh Kumar wrote: >>> On 29-06-22, 21:33, Dmitry Osipenko wrote: >>>> Today I noticed that tegra30-devfreq driver now fails to probe because >>>> dev_pm_opp_find_freq_ceil() fails with -ERANGE. This patch is guilty for >>>> that. Could you please take a look? > >> We added memory interconnect support to Tegra and since that time only >> the memory controller can drive the clock rate. All other drivers, >> including the devfreq, now issue memory bandwidth requests using ICC. >> >> In case of the devfreq driver, it's the OPP core that makes the bw >> request using ICC. >> >> But it's the set_freq_table() that fails [2], I see >> dev_pm_opp_get_opp_count() returns 17, which is correct, and then >> dev_pm_opp_find_freq_ceil(freq=0) returns freq=1, which shall be >> freq=12750000. > > I am confused, you said earlier that it is failing with -ERANGE, but > now it is a bad freq value ? > > Which one of these it is ? > > The problem I see is here though, because of which I was asking you > the question earlier: > > - tegra30-devfreq driver calls devm_pm_opp_of_add_table_noclk(), i.e. > clk_count == 0. > > - _read_rate() (in drivers/opp/of.c) skips reading any opp-hz > properties if clk_count is 0. > > - And so you can get -ERANGE or some other error. > > Can you please see where we are failing. Also I don't see how freq can > get set to 1 currently. > The set_freq_table() gets available freqs using dev_pm_opp_find_freq_ceil() iteration. The first dev_pm_opp_find_freq_ceil(freq=0) succeeds and returns ceil freq=1. The second dev_pm_opp_find_freq_ceil(freq=1) fails with -ERANGE. I haven't looked yet at why freq is set to 1. -- Best regards, Dmitry