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=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 30B2BC432C2 for ; Thu, 26 Sep 2019 01:03:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ED01B21A4A for ; Thu, 26 Sep 2019 01:03:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="MPMNErV2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726309AbfIZBD1 (ORCPT ); Wed, 25 Sep 2019 21:03:27 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:15677 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725768AbfIZBD1 (ORCPT ); Wed, 25 Sep 2019 21:03:27 -0400 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20190926010324epoutp03a5646df08187a725df615e7bbd7bda57~H12Bz1cOf3233432334epoutp03T for ; Thu, 26 Sep 2019 01:03:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20190926010324epoutp03a5646df08187a725df615e7bbd7bda57~H12Bz1cOf3233432334epoutp03T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1569459804; bh=Yqpkx4BCEja08YHcDCpzNi4z57TCOeCeLIIybRZTEyE=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=MPMNErV2qY1BF4t2pzdLhCBRpqxCDiloREu6f7HWZYItHSbAr2K0063jc2dhv+S8n xIcY3o3oD7cTXNXIUerBGIOxq43q9LAq0J/vXT0/LLhzFIbAWffSOc5f53Ezw1TRjq xhizmkkwJ79Q/UjlYV7JLU0Q3oEjiD66ebJl4HP4= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20190926010323epcas1p293ad50585fbf8750f02b64768785c4c3~H12BD7VLe0177201772epcas1p2V; Thu, 26 Sep 2019 01:03:23 +0000 (GMT) Received: from epsmges1p3.samsung.com (unknown [182.195.40.157]) by epsnrtp4.localdomain (Postfix) with ESMTP id 46dxWF2kbczMqYkZ; Thu, 26 Sep 2019 01:03:21 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id 55.E3.04085.95E0C8D5; Thu, 26 Sep 2019 10:03:21 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20190926010320epcas1p4cfb1f724d67da870e657f0a4483c8e3b~H11_etUap1100411004epcas1p4M; Thu, 26 Sep 2019 01:03:20 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190926010320epsmtrp15b0d05597ba8c8698e5c5dbb04c422ab~H11_dqJra1220412204epsmtrp1d; Thu, 26 Sep 2019 01:03:20 +0000 (GMT) X-AuditID: b6c32a37-e31ff70000000ff5-9e-5d8c0e59e369 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 78.1D.04081.85E0C8D5; Thu, 26 Sep 2019 10:03:20 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190926010320epsmtip2288b7d5cec1706a5df38966fe4465b17~H11_N6lDo2189421894epsmtip2a; Thu, 26 Sep 2019 01:03:20 +0000 (GMT) Subject: Re: [PATCH v8 5/6] PM / devfreq: Add PM QoS support To: Leonard Crestez , Matthias Kaehlcke Cc: MyungJoo Ham , Kyungmin Park , =?UTF-8?B?QXJ0dXIgxZp3aWdvxYQ=?= , Saravana Kannan , Krzysztof Kozlowski , Alexandre Bailon , Georgi Djakov , Abel Vesa , Jacky Bai , Viresh Kumar , Lukasz Luba , dl-linux-imx , "linux-pm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" From: Chanwoo Choi Organization: Samsung Electronics Message-ID: <48e271f5-58d3-845a-538f-6fb75eb3deb6@samsung.com> Date: Thu, 26 Sep 2019 10:08:02 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBJsWRmVeSWpSXmKPExsWy7bCmnm4kX0+swc5XAhaHjm1lt/h6+hSj xbJLRxktpu/dxGZx/vwGdouzTW/YLW41yFisuPuR1WLT42usFl2/VjJbfO49wmjxecNjRovb jSvYLFafO8hm0XXoL5vFxq8eDgIe72+0snvMbrjI4rFgU6nHplWdbB53ru1h89i8pN5j47sd TB4H3+1h8ujbsorR4/MmuQCuqGybjNTElNQihdS85PyUzLx0WyXv4HjneFMzA0NdQ0sLcyWF vMTcVFslF58AXbfMHKBHlBTKEnNKgUIBicXFSvp2NkX5pSWpChn5xSW2SqkFKTkFlgV6xYm5 xaV56XrJ+blWhgYGRqZAhQnZGf/v32At+ClV8W7Xb5YGxquiXYycHBICJhJr/qxi7mLk4hAS 2MEocWvNMnYI5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ElJ1i6GLk4hAR2M0rMmvWIGSIhKTHt4lEgmwPIFpY4fLgYouYto8T9ztUsIDXCAjYS /69+ZAOxRQRCJf50LmcFKWIWaGKV6Pp+nRGi4wmzxJsVd9lBqtgEtCT2v7gB1sEvoChx9cdj RhCbV8BOYu+WO0wgNouAqsTsmx/BrhAViJA4vGMWVI2gxMmZT8A2cwrESlx5Oh1sJrOAusSf eZeYIWxxiVtP5jNB2PISzVtnM09gFJ6FpH0WkpZZSFpmIWlZwMiyilEytaA4Nz232LDAMC+1 XK84Mbe4NC9dLzk/dxMjOKq1NHcwXl4Sf4hRgINRiYf3QFh3rBBrYllxZe4hRgkOZiUR3lky XbFCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeZ/mHYsUEkhPLEnNTk0tSC2CyTJxcEo1MPJGFJve EBSqOh2ydN+F//UnBNelFG8x/l1662iuXLUmR9UZLRvLUxbmtS/ruttLqr9/FN68bu7Muy6a 1y1dDT7d2LCZe33pn4piV6t/hZOOTrFOTGlN8vx2xPC8Wc9aXunTf7cUvRO7HGbVu6L5q03O zz3HDqkcbBIverVkeWHfJMb9zOfO/ldiKc5INNRiLipOBAAgoGxU5gIAAA== X-CMS-MailID: 20190926010320epcas1p4cfb1f724d67da870e657f0a4483c8e3b 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: 20190924192429epcas3p196a7de011d3e78508d1e643efd27e717 References: <58fdd2c226a4e76a3d9427baab7dd5c23af842ab.1569319738.git.leonard.crestez@nxp.com> <20190924191124.GJ133864@google.com> <080027a2-d807-5fa4-f148-4469678ce849@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi, On 19. 9. 26. 오전 4:40, Leonard Crestez wrote: > On 25.09.2019 05:13, Chanwoo Choi wrote: >> On 19. 9. 25. 오전 4:22, Leonard Crestez wrote: >>> On 24.09.2019 22:11, Matthias Kaehlcke wrote: >>>> On Tue, Sep 24, 2019 at 01:11:29PM +0300, Leonard Crestez wrote: >>>>> Register notifiers with the PM QoS framework in order to respond to >>>>> requests for DEV_PM_QOS_MIN_FREQUENCY and DEV_PM_QOS_MAX_FREQUENCY. >>>>> >>>>> No notifiers are added by this patch but PM QoS constraints can be >>>>> imposed externally (for example from other devices). >>>>> >>>>> Signed-off-by: Leonard Crestez >>>>> Reviewed-by: Matthias Kaehlcke >>>>> --- >>>>> drivers/devfreq/devfreq.c | 75 +++++++++++++++++++++++++++++++++++++++ >>>>> include/linux/devfreq.h | 5 +++ >>>>> 2 files changed, 80 insertions(+) >>>>> >>>>> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c >>>>> index eee403e70c84..784f3e40536a 100644 >>>>> --- a/drivers/devfreq/devfreq.c >>>>> +++ b/drivers/devfreq/devfreq.c >>>>> @@ -22,15 +22,18 @@ >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> +#include >>>>> #include "governor.h" >>>>> >>>>> #define CREATE_TRACE_POINTS >>>>> #include >>>>> >>>>> +#define HZ_PER_KHZ 1000 >>>>> + >>>>> static struct class *devfreq_class; >>>>> >>>>> /* >>>>> * devfreq core provides delayed work based load monitoring helper >>>>> * functions. Governors can use these or can implement their own >>>>> @@ -109,10 +112,11 @@ static unsigned long find_available_max_freq(struct devfreq *devfreq) >>>>> static void get_freq_range(struct devfreq *devfreq, >>>>> unsigned long *min_freq, >>>>> unsigned long *max_freq) >>>>> { >>>>> unsigned long *freq_table = devfreq->profile->freq_table; >>>>> + unsigned long qos_min_freq, qos_max_freq; >>>>> >>>>> lockdep_assert_held(&devfreq->lock); >>>>> >>>>> /* >>>>> * Init min/max frequency from freq table. >>>>> @@ -125,10 +129,18 @@ static void get_freq_range(struct devfreq *devfreq, >>>>> } else { >>>>> *min_freq = freq_table[devfreq->profile->max_state - 1]; >>>>> *max_freq = freq_table[0]; >>>>> } >>>>> >>>>> + /* constraints from PM QoS */ >>>>> + qos_min_freq = dev_pm_qos_read_value(devfreq->dev.parent, >>>>> + DEV_PM_QOS_MIN_FREQUENCY); >>>>> + qos_max_freq = dev_pm_qos_read_value(devfreq->dev.parent, >>>>> + DEV_PM_QOS_MIN_FREQUENCY); > >>>> This needs to be DEV_PM_QOS_MAX_FREQUENCY. I missed this in the earlier >>>> reviews, but stumbled across it when testing. >>>> >>>> !Reviewed-by: Matthias Kaehlcke >>> >>> I broke it in v8 while processing comments. Thanks for catching it. >> >> Did you test this patchset with v8? >> Maybe it is not working with this mistake. > > I ran some scripts which test that min_freq requests work as expected > (using imx interconnect+devfreq). They don't touch max_freq. We always have to test the code before contributing the patch. Please test all cases for these patches. > > -- > Regards, > Leonard > -- Best Regards, Chanwoo Choi Samsung Electronics