Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp375901pxu; Fri, 23 Oct 2020 03:14:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6JDWrkeJ6J+efldfXDxtQYK1k6Z23VxmHTpXQQYeH74VX0Bctx4LQGQOFLtmIq4fcl3YA X-Received: by 2002:a50:9e87:: with SMTP id a7mr1416381edf.297.1603448074697; Fri, 23 Oct 2020 03:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603448074; cv=none; d=google.com; s=arc-20160816; b=QAdz5y9+9LQ+XY7ghCq975/IFyTBhZPDSYPDgfWsyQwUR6reT4QVCq7iXK+htTSs9m k5RFvVRbMCCeLZj+EN1TmIoPWGACCR9Zcca8gAtNtHF4/HHMMIJCgq/8kPia2bA1sfPQ 0wpVzuxe2vAvzSCFprdj/XFIJGQl+uWtKgjGQQ1MFsED4WE3oCWs86q9wOdxcZCAeZYq dVWtnOU9Dh0HI9sfwSuAHTbRDw+0Q5eX5QUBuhvADrHoM9aJWBcexvPcNyr4GWydtzaO 1g4ZMRm2g0jTaDFZQps5FR+rwgn6j2WWDxA/8a1iVTLlba+GW5jrJczWhSW7xTmEGjrb jsZA== 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:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=jX41VGP/VWJGCpMgSRB6Vy5h2OQbvXYT6fvLe8xXPrA=; b=vZfncsFm5JYVc/1NfXZ5YJe7eF7u3Te0hotg11qGPjwPw93Bg48cI5GJZWrQ3wdgDH hjzyMaXC8SxDQ7Q4FkMJtxAHIBGlYPchw07O5M7M0Z/TXY+bzv6N5R8znJMjVXN+egvn mfsni0sk2AGcQ3DHoUzlUdQOuyNrmIdn9Pao/xijdoruISuNMSyfIeIf/H4oR9vWsKHI 3gtA0GUERG9S7ek2HtdX0PsT8yB6BTyay+Vqgf1UTbg5Bkdyh7bYpR2fIdCnKq0y5vMk K8fEaBw6WE7gGunYAzP98gPwRVHdWZ81NZPqIuuoKkPEKvZVlemOB0jrM1D5s7RYNgjV jcHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="fTa/Lm4f"; 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 ec19si528691ejb.669.2020.10.23.03.14.12; Fri, 23 Oct 2020 03:14:34 -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="fTa/Lm4f"; 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 S461955AbgJWKMy (ORCPT + 99 others); Fri, 23 Oct 2020 06:12:54 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:54468 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S461849AbgJWKMy (ORCPT ); Fri, 23 Oct 2020 06:12:54 -0400 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20201023101250epoutp0439d1dc15a4fe351b5dae36a3dcfc791e~Al28CErVS2614326143epoutp04_ for ; Fri, 23 Oct 2020 10:12:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20201023101250epoutp0439d1dc15a4fe351b5dae36a3dcfc791e~Al28CErVS2614326143epoutp04_ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1603447970; bh=jX41VGP/VWJGCpMgSRB6Vy5h2OQbvXYT6fvLe8xXPrA=; h=From:To:Cc:Subject:Date:References:From; b=fTa/Lm4f+2mgzsziUTMd8Z1PwJDCixd88rshI8Q8o78rWPNTy14DtF6aojoPAj6GS WlU/bk8Tzf2EJRSINZIwN3ksM6T5N5JPN6sNbovbXVNBavk75ncfcw9JwK3/Jz8M5W dLwIVrRBrq5DfVH9TkhHHMZqfmdQVwktxkobbEcA= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20201023101249epcas1p4c63a3ba3415f6ed0c1b14492dcd77504~Al27Ukof02134021340epcas1p41; Fri, 23 Oct 2020 10:12:49 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.40.156]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4CHg5q1fqWzMqYkZ; Fri, 23 Oct 2020 10:12:47 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 91.B1.09577.F9CA29F5; Fri, 23 Oct 2020 19:12:47 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201023101246epcas1p126bb1157eb75f972786758ef1e2f6e0c~Al24llWmc2589625896epcas1p1M; Fri, 23 Oct 2020 10:12:46 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201023101246epsmtrp11886ab4476c2da84e9778c64179fda21~Al24knLu-0544405444epsmtrp1t; Fri, 23 Oct 2020 10:12:46 +0000 (GMT) X-AuditID: b6c32a39-c13ff70000002569-85-5f92ac9f7a66 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 8E.E9.08745.E9CA29F5; Fri, 23 Oct 2020 19:12:46 +0900 (KST) Received: from localhost.localdomain (unknown [10.113.221.102]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201023101246epsmtip2aefab9230fce6deb5e744410ba06159d~Al24VVNeu3177131771epsmtip2l; Fri, 23 Oct 2020 10:12:46 +0000 (GMT) From: Chanwoo Choi 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, cw00.choi@samsung.com, chanwoo@kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com Subject: [PATCH v5 0/2] PM / devfreq: Add governor feature and attribute flag Date: Fri, 23 Oct 2020 19:26:30 +0900 Message-Id: <20201023102632.740-1-cw00.choi@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjk+LIzCtJLcpLzFFi42LZdlhTT3f+mknxBle7OS2WXTrKaLFxxnpW i4k3rrBYXP/ynNVi9cfHjBZrbh9itPix4RSzRcusRSwWCz7NYLU42/SG3eLyrjlsFp97jzBa dH6ZxWaxsKmF3eJ24wo2i5+75rE4CHismbeG0WPH3SWMHjtn3WX32LSqk82jt/kdm8fGdzuY PP7O2s/i0bdlFaPH501yAZxR2TYZqYkpqUUKqXnJ+SmZeem2St7B8c7xpmYGhrqGlhbmSgp5 ibmptkouPgG6bpk5QH8oKZQl5pQChQISi4uV9O1sivJLS1IVMvKLS2yVUgtScgosC/SKE3OL S/PS9ZLzc60MDQyMTIEKE7IzOtYJFOyXqzj54hJLA+N20S5GTg4JAROJP0uXMHYxcnEICexg lDj5bisTSEJI4BOjxKWWYojEZ0aJZROnMcJ0HL+xmRkisYtR4tXER0AdHEDOF0a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GxSUnMyy1KL9O0SuDI61gkU7JerOPniEksD43bRLkZODgkB E4njNzYzdzFycQgJ7GCUeHdmFiNEQlJi2sWjQAkOIFtY4vDhYoiaT4wSC37eYgWpYRPQktj/ 4gYbiC0iEC2x+ONHsEHMAieYJFZ/2cUEkhAW8JV4fPsTC4jNIqAqceDBPbBmXgELibNX7rND LJOXWL3hAPMERp4FjAyrGCVTC4pz03OLDQuM8lLL9YoTc4tL89L1kvNzNzGCw1hLawfjnlUf 9A4xMnEwHmKU4GBWEuHdrT4xXog3JbGyKrUoP76oNCe1+BCjNAeLkjjv11kL44QE0hNLUrNT UwtSi2CyTBycUg1MBRtO2r09seZoxv7t0+Piv64Qaas4svJ//76oj1O4FwRUXXD6YzPr/aW9 Ke5ey7uY71yzZbzdJXk/4FHjmmwOn4Ny2w4GHs42fzirN+rQn33v0/5uN5T6ryov6HUoyeRQ 65bADfe1r2283PaG/1dcofCT0533FwWuOtd36HGXwQ6zoJiyA5N/Gc54ySKn9zLlot6PdT8+ r4q3uHzPtsT/KP/mZ+aKO47P8ZPfIiixTCVmlviHrdwMaWuD1L+q8J6bavFT+kqZncai/JP/ C+NyZ05NXv6R17uxoTJDZFbNzkzXiTtT1HdZvXXfztOyzO2R1Jkbu/g/izrlv6p1DZyx7EP9 hru3za0LwxjzPgmL8iixFGckGmoxFxUnAgBWj9lN0gIAAA== X-CMS-MailID: 20201023101246epcas1p126bb1157eb75f972786758ef1e2f6e0c 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: 20201023101246epcas1p126bb1157eb75f972786758ef1e2f6e0c References: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 | 185 ++++++++++++------ 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, 186 insertions(+), 92 deletions(-) -- 2.17.1