Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp22827ybb; Tue, 31 Mar 2020 16:14:10 -0700 (PDT) X-Google-Smtp-Source: APiQypKGi0SLXUzH2LuPsH80hkj0pXjzc56XEH8Xqb+S5CZrZ3vc82d1IhhhSP3aOsTiyhWT/5Ol X-Received: by 2002:aca:cf87:: with SMTP id f129mr862891oig.109.1585696449971; Tue, 31 Mar 2020 16:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585696449; cv=none; d=google.com; s=arc-20160816; b=fCqurkIHaOAwM0MacB40EarbA3TZ42OnNjQq8u/cQ1AAKrjPX+XKA9RpiCx8BKPKuN d5/lJCH/NDl2WXawo4SKn6BmH7MXajO8Tpzh1uZXqvdePICvBcTxdW+n5K2eNi8nBxHV WTGpWNI5fhNlrxmHhx7oXnMOl8d1UnTWjxDpepEYfDV/Ff68uNy1v1DasXlJ+YWfy8Oz gn1EFDvRlUOGIBZUIh8ejk3b+8SFExaWVMRday4Pch0XKDnP9+FY5+Uda1qI4CcIdHrK 47rqF12wa7lU3l1I91FCMA3D/MHLa06Ybh8E3v7UtwMaSrD8TtZktolUoKduM+MalC5a fOug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:cc:to:subject :dkim-signature:dkim-filter; bh=NT/waN1WxKqs2OMuNZobwvVMLut5DpCIlxECcN/KHs0=; b=quFEqcq7I4chwvWMnZmrU6OetoeNQ86JBXga2NSUg+gu5pktrSpH5nJyzarAp9kokd 7Y66Z16TPV1OTmlh0G/aUNQWavb6wSBu5vjAtvvaGbTJTwjkx2ILvczyN9FDwTYRNmyB oZcs8Ie5gGAD5MrvwKYuB1Xzu254i5NOb9wMrYxQAokrrA1BKjn8bi6bwSEGm7lEXtf/ BhlRWy0Q6ovXieaEbpDRZUOlwG+tUXlFWtu/NjI00/qVo1vaFZV5cvqw+mkd4d1qs++q 694iEkueb+oU22hVpWUI1eqmqvS5lO0Tsme+mLltbHFJzfldlW8eCmIRWW92X6MiuuRe 4NbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Wh1USzc6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s27si5969otg.229.2020.03.31.16.13.56; Tue, 31 Mar 2020 16:14:09 -0700 (PDT) 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=@samsung.com header.s=mail20170921 header.b=Wh1USzc6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731457AbgCaXNc (ORCPT + 99 others); Tue, 31 Mar 2020 19:13:32 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:22904 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731364AbgCaXNc (ORCPT ); Tue, 31 Mar 2020 19:13:32 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20200331231329epoutp0409ef0ce612d8745e0b9b6e5ac64d0da3~BhnudbO5K1873418734epoutp047 for ; Tue, 31 Mar 2020 23:13:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20200331231329epoutp0409ef0ce612d8745e0b9b6e5ac64d0da3~BhnudbO5K1873418734epoutp047 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1585696409; bh=NT/waN1WxKqs2OMuNZobwvVMLut5DpCIlxECcN/KHs0=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=Wh1USzc6K5Cq5VY3/SaExiSMwnBKyIG8DR2kf7ozo6wA3l9DtQ/fRy/EpnirIqxZS KuYJDeaaCMDaoMNv/YglOxEFa5FZat69bW/Z7WOBg1c7dtFsMFZR/Pl0IwmUCgNe58 7AiZ08UmV4aqT/w+xzFFtoPR2Br9zKlmwMgiypTg= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20200331231328epcas1p1983b8a4359a003aaff08e227300747da~BhnttF8Bx0986009860epcas1p1R; Tue, 31 Mar 2020 23:13:28 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.40.157]) by epsnrtp1.localdomain (Postfix) with ESMTP id 48sQ9f1dbpzMqYm2; Tue, 31 Mar 2020 23:13:25 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 43.1E.04074.59EC38E5; Wed, 1 Apr 2020 08:13:25 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200331231324epcas1p107bfd3412b713677290a810bbdf776b1~BhnqJCqrN0419604196epcas1p1-; Tue, 31 Mar 2020 23:13:24 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200331231324epsmtrp2bb9b1fac3fa31042f76e8f77007f4b50~BhnqH3Kma1277512775epsmtrp2u; Tue, 31 Mar 2020 23:13:24 +0000 (GMT) X-AuditID: b6c32a39-58bff70000000fea-b2-5e83ce956bf4 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 96.A5.04158.49EC38E5; Wed, 1 Apr 2020 08:13:24 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200331231324epsmtip2644286e363c458a2eea854e47e02c2d3~Bhnp54owu1925719257epsmtip21; Tue, 31 Mar 2020 23:13:24 +0000 (GMT) Subject: Re: [PATCH v1 3/5] PM / devfreq: tegra20: Use clk_round_rate_unboundly() To: Dmitry Osipenko , Thierry Reding , MyungJoo Ham , Kyungmin Park , Jonathan Hunter , Michael Turquette , Stephen Boyd Cc: linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org From: Chanwoo Choi Organization: Samsung Electronics Message-ID: <8e62e4ac-081c-a1ac-f0a9-b4e882fcd3b5@samsung.com> Date: Wed, 1 Apr 2020 08:22:30 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Thunderbird/59.0 MIME-Version: 1.0 In-Reply-To: <20200330231617.17079-4-digetx@gmail.com> Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNJsWRmVeSWpSXmKPExsWy7bCmnu7Uc81xBh/mG1is/viY0aJl1iIW i7NNb9gtPvbcY7W4vGsOm8Xn3iOMFp1fZrFZXDzlanG7cQWbxb9rG1ksfu6ax+LA7fH+Riu7 x85Zd9k9Nq3qZPPobX7H5tG3ZRWjx+dNcgFsUdk2GamJKalFCql5yfkpmXnptkrewfHO8aZm Boa6hpYW5koKeYm5qbZKLj4Bum6ZOUDnKSmUJeaUAoUCEouLlfTtbIryS0tSFTLyi0tslVIL UnIKLAv0ihNzi0vz0vWS83OtDA0MjEyBChOyM9b1vmQp2MNfMfvDVpYGxgs8XYwcHBICJhLH Fjp2MXJyCAnsYJQ42svSxcgFZ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xRA1bxkl rp7dxApSIywQLDG7fwoTSEJEYCmTxIqbX8CamQVKJE48+wc1dSujxLqFc5lAEmwCWhL7X9xg A7H5BRQlrv54zAhi8wrYSfTfnAhmswioSCxeNgmsRlQgTGLnksdMEDWCEidnPmEBsTkFzCSW T+pmhFimLvFn3iVmCFtc4taT+UwQtrzE9rdzmCcwCs9C0j4LScssJC2zkLQsYGRZxSiZWlCc m55bbFhglJdarlecmFtcmpeul5yfu4kRHIFaWjsYT5yIP8QowMGoxMOraNUcJ8SaWFZcmXuI UYKDWUmEl82/IU6INyWxsiq1KD++qDQntfgQozQHi5I4r3z+sUghgfTEktTs1NSC1CKYLBMH p1QDo8qG9Ctqu9TrJ3PohP++qpaVb88aFFIvcetN2J1qZhZZmaMWkqf36zteZ+7w0H1zYdss scXnUoJP+24y/O6iermG62p0RBnn7/4LorNXRmWcfzLp1TTDg5or4q45CoS0HH9voHfWWTa2 8eyy8p/83OfePj5w972ar4ndmzjNhgk+BpwXJLY7KbEUZyQaajEXFScCAIZvho+8AgAA X-CMS-MailID: 20200331231324epcas1p107bfd3412b713677290a810bbdf776b1 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200330232035epcas1p4dc533fd4e30d543a1cd12ebb5c5e80b3 References: <20200330231617.17079-1-digetx@gmail.com> <20200330231617.17079-4-digetx@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dmitry, On 3/31/20 8:16 AM, Dmitry Osipenko wrote: > The clk_round_rate() doesn't work for us properly if clock rate is bounded > by a min/max rate that is requested by some other clk-user because we're > building devfreq's OPP table based on the rounding. > > In particular this becomes a problem if display driver is probed earlier > than devfreq, and thus, display adds a memory bandwidth request using > interconnect API, which results in a minimum clock-rate being set for > the memory clk. In a result, the lowest devfreq OPP rate is getting > limited to the minimum rate imposed by the display driver. > > Let's use new clk_round_rate_unboundly() that resolves the problem by > rounding clock rate without taking into account min/max limits imposed by > active clk users. > > Signed-off-by: Dmitry Osipenko > --- > drivers/devfreq/tegra20-devfreq.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/devfreq/tegra20-devfreq.c b/drivers/devfreq/tegra20-devfreq.c > index ff82bac9ee4e..1bb10ef11dfe 100644 > --- a/drivers/devfreq/tegra20-devfreq.c > +++ b/drivers/devfreq/tegra20-devfreq.c > @@ -149,10 +149,10 @@ static int tegra_devfreq_probe(struct platform_device *pdev) > > tegra->regs = mc->regs; > > - max_rate = clk_round_rate(tegra->emc_clock, ULONG_MAX); > + max_rate = clk_round_rate_unboundly(tegra->emc_clock, ULONG_MAX); > > for (rate = 0; rate <= max_rate; rate++) { > - rate = clk_round_rate(tegra->emc_clock, rate); > + rate = clk_round_rate_unboundly(tegra->emc_clock, rate); > > err = dev_pm_opp_add(&pdev->dev, rate, 0); > if (err) { > Firstly, patch1 have to be reviewed for this patch. I have no any objection. It looks good to me. If patch1 get the confirmation from clock maintainer, feel free to add my acked tag: Acked-by: Chanwoo Choi -- Best Regards, Chanwoo Choi Samsung Electronics