Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp960452pxu; Sun, 25 Oct 2020 23:42:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbYFJorQQ9cTWsdCkW69acE7OGaG9bPOgOt4zXVz9DjiRASUYN8EjaU8uIHztLcAb2I5w8 X-Received: by 2002:a17:906:fad8:: with SMTP id lu24mr14084281ejb.486.1603694551059; Sun, 25 Oct 2020 23:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603694551; cv=none; d=google.com; s=arc-20160816; b=Z5WIA01EaGhtCLYLgypqaYX2ERTSCoLEQeNmQX0Vexs0ZhNH3QSW/hQEhpGBl5ql6z cdB8iIuQVi21WN2948u2lHzk4KiplrXHL3B7Z8p3FPB3+va6IxbtqtTrDRxTiAuvGqcf wRV12U1mnXEXPK+1DmGaZWFt2Givd8fppD+y54Xa4q5wNHNc4MTI3zu7r96ANqhXn1Yo YFDIbEzW3+BTyHW1JQw7KXzxX2pQD0cxZEHNyGS6sxj1e2YASxlp0tTwmGRC+uWC0TmN 20msixXVhqrwjd1gaBsJceqesHiycoeLIG0asrEF4nvW+pkvcz1lc/Y1ywBN/MHkdOk1 3+/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence: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=w0+opSElltRGksOeh+gd0FGjG9tPnd9xue83aNK3/9Y=; b=Jf2MvyRhhVKXkikDobqc9s5f1+Ou2lRDb8PMCqVpc9SCNkTqWxuauk1TNLbBTbNK0e 0YtUEcUDRmq3sp0UmY60R2PNUDhiykcUvcSJyb96ufmmpSAeHP+P2lJELO49NCGqGrIL keNV8mAPC8O90NK6wn/e78WxJP2OVZnPaSoEPmsdYWb02EvV2mi2uBGQiR64a42rOwSy Wxf42On5HUC7M3hxAz3JrJGo/FFiWuLDqx07r8VtjFRyoUCKCgp21NjvAOFyoSgZDIeX qN76chxBc4J4NLdr5OrvVpWSU86oFxEeGxD3tSiURv0uJWoHz5eMnQ5RU7/InaJjtPFq ImQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=kEjY0xSU; 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=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kt25si6344090ejb.438.2020.10.25.23.42.09; Sun, 25 Oct 2020 23:42:31 -0700 (PDT) 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=@samsung.com header.s=mail20170921 header.b=kEjY0xSU; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1421750AbgJZDHS (ORCPT + 99 others); Sun, 25 Oct 2020 23:07:18 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:51305 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1421745AbgJZDHR (ORCPT ); Sun, 25 Oct 2020 23:07:17 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20201026030713epoutp04f103e6d3e4a483272140f0f0414b1491~Ba-LydrKC1595015950epoutp042 for ; Mon, 26 Oct 2020 03:07:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20201026030713epoutp04f103e6d3e4a483272140f0f0414b1491~Ba-LydrKC1595015950epoutp042 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1603681633; bh=w0+opSElltRGksOeh+gd0FGjG9tPnd9xue83aNK3/9Y=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=kEjY0xSU8PdQwT/aLepCKM4EP80XJe0mDPCwHwu3MFmlIrzXTf/weYWcqXiaLdCG7 /VGcpVMWxtpsCDPTUmSHbj90m/bQLBfBfJRSVmjRo0/VrvEyTXSnmJIZV06AhyDJiL iYlaV0IcvUx8J7W893jcPt94jIWI/FF7IPWVyT/8= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20201026030712epcas1p4f8dde9c87d8eac2d981cb072cd6021ee~Ba-LRLo3U1620516205epcas1p4f; Mon, 26 Oct 2020 03:07:12 +0000 (GMT) Received: from epsmges1p1.samsung.com (unknown [182.195.40.154]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4CKKWL5kMQzMqYkb; Mon, 26 Oct 2020 03:07:10 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 35.D0.09543.E5D369F5; Mon, 26 Oct 2020 12:07:10 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20201026030710epcas1p4ba47eb39f41e4ed2398e2a9cab4720e2~Ba-ItyIsZ1634116341epcas1p4W; Mon, 26 Oct 2020 03:07:10 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201026030710epsmtrp1ab0ca966ffd00ad7f30bc54099d3d083~Ba-Is71xF0205502055epsmtrp1C; Mon, 26 Oct 2020 03:07:10 +0000 (GMT) X-AuditID: b6c32a35-35dff70000002547-72-5f963d5e97c6 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 35.17.08745.D5D369F5; Mon, 26 Oct 2020 12:07:10 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201026030709epsmtip25b44b1e4261ff29db9ecab6dac05b119~Ba-IYRlfd2418124181epsmtip22; Mon, 26 Oct 2020 03:07:09 +0000 (GMT) Subject: Re: [PATCH v6 0/2] PM / devfreq: Add governor feature and attribute flag To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Cc: digetx@gmail.com, lukasz.luba@arm.com, enric.balletbo@collabora.com, hl@rock-chips.com, thierry.reding@gmail.com, jonathanh@nvidia.com, abel.vesa@nxp.com, k.konieczny@samsung.com, b.zolnierkie@samsung.com, chanwoo@kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com From: Chanwoo Choi Organization: Samsung Electronics Message-ID: <56da5f5c-faab-3d81-c438-e17301a41bb6@samsung.com> Date: Mon, 26 Oct 2020 12:20:59 +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: <20201026025038.1480-1-cw00.choi@samsung.com> Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrEJsWRmVeSWpSXmKPExsWy7bCmvm6c7bR4g4ZdWhbLLh1ltNg4Yz2r xcQbV1gsVn98zGix5vYhRosfG04xW7TMWsRiseDTDFaLs01v2C0u75rDZvG59wijReeXWWwW C5ta2C1uN65gs/i5ax6LA7/HmnlrGD123F3C6LFz1l12j02rOtk8epvfsXlsfLeDyePvrP0s Hn1bVjF6fN4kF8AZlW2TkZqYklqkkJqXnJ+SmZduq+QdHO8cb2pmYKhraGlhrqSQl5ibaqvk 4hOg65aZA/SCkkJZYk4pUCggsbhYSd/Opii/tCRVISO/uMRWKb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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: 20201026023654epcas1p4866b7bbcb7276996500ee5c05d2c37f0 References: <20201026025038.1480-1-cw00.choi@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/26/20 11:50 AM, Chanwoo Choi wrote: > Each devfreq governor can have the different sysfs attributes and features. > In order to provide the only available sysfs attribute to user-space, > add governor attribute flag with DEVFREQ_GOV_ATTR_[attribute name] defintion. > > Also, each governor is able to have the specific flag in order to > support specific feature with DEVFREQ_GOV_FLAG_[feature name] defintion > like immutable governor. > > According to each governor, can initiate the governor feature and attribute > flags. > > [Common sysfs attributes for devfreq class] > And all devfreq governors have to support the following common attributes. > The common attributes are added to devfreq class by default. > - governor > - available_governors > - available_frequencies > - cur_freq > - target_freq > - min_freq > - max_freq > - trans_stat > > [Definition for governor attribute flag] > - DEVFREQ_GOV_ATTR_POLLING_INTERVAL to update polling interval for timer. > : /sys/class/devfreq/[devfreq dev name]/polling_interval > - DEVFREQ_GOV_ATTR_TIMER to change the type of timer on either deferrable > or dealyed timer. > : /sys/class/devfreq/[devfreq dev name]/timer > > [Definition for governor feature flag] > - DEVFREQ_GOV_FLAG_IMMUTABLE > : If immutable flag is set, governor is never changeable to other governors. > - DEVFREQ_GOV_FLAG_IRQ_DRIVEN > : Devfreq core won't schedule polling work for this governor if value is set. > > [Table of governor attribute flags for evfreq governors] > ----------------------------------------------------------------------------- > | simple | perfor | power | user | passive | tegra30 > | ondemand | mance | save | space| | > ------------------------------------------------------------------------------ > governor | O | O | O | O | O | O > available_governors | O | O | O | O | O | O > available_frequencies | O | O | O | O | O | O > cur_freq | O | O | O | O | O | O > target_freq | O | O | O | O | O | O > min_freq | O | O | O | O | O | O > max_freq | O | O | O | O | O | O > trans_stat | O | O | O | O | O | O > ------------------------------------------------------------------------------ > polling_interval | O | X | X | X | X | O > timer | O | X | X | X | X | X > ------------------------------------------------------------------------------ > immutable | X | X | X | X | O | O > interrupt_driven | X(polling)| X | X | X | X | O (irq) > ------------------------------------------------------------------------------ > > Changes from v5: > - Remove redundant code for creating syfs files. > - Move create_sysfs_files() position after completed governor start on > devfreq_add_device() > - Add reviewd-by/tested-by tag of Dmitry Osipenko > > Changes from v4: > - Rename from 'attr' to 'attrs' > - Restore the variable name in governor_store because it is enought to explain > the previous or new governor with detailed comments instead of variable name > changes. > > Changes from v3: > - Fix typo > - Rename from 'flag' to 'flags' > - Add more exception handling code and add comments on governor_store() > > Changes from v2: > - Hide unsupported sysfs node to user-space instead of checking the permission > of sysfs node. > > Chanwoo Choi (2): > PM / devfreq: Add governor feature flag > PM / devfreq: Add governor attribute flag for specifc sysfs nodes > > Documentation/ABI/testing/sysfs-class-devfreq | 54 ++--- > drivers/devfreq/devfreq.c | 187 ++++++++++++------ > drivers/devfreq/governor.h | 30 ++- > drivers/devfreq/governor_passive.c | 2 +- > drivers/devfreq/governor_simpleondemand.c | 2 + > drivers/devfreq/tegra30-devfreq.c | 5 +- > 6 files changed, 188 insertions(+), 92 deletions(-) > Applied them. -- Best Regards, Chanwoo Choi Samsung Electronics