Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp804423ybh; Mon, 13 Jul 2020 01:22:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVFZMZoWFfnPh0IHVUhE5wFc/0MJxVsn6yNhBebe9B3VPz10mXVWuV9P9mHTPbTRy5VCiJ X-Received: by 2002:a50:d0dc:: with SMTP id g28mr87143731edf.169.1594628545887; Mon, 13 Jul 2020 01:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594628545; cv=none; d=google.com; s=arc-20160816; b=cPBeGnOCuO/Vu8P36mAFlCTfKz0U9aUOZBtqqugoO4/Gf7PEhaRcneHKRn/G1Nbo94 Tr7xNU8aM7cRYrTDWgpRbF1dzId9n/1ehIkmZVol1YKJ55ZqcLUIH4dnb/2f2HH7JIbH jFrJuG/VsPU1TnADDkcyh4gnJnsQ4oQgNLcgLI/QU+EmCSptliK6OJQXkOma1jGNez7k OZDsU63MVn4eGm4V5ryhKC6bR5RIu84/YTYDjK4zvw0/Xa+ddNZaSX7fNWNPs2fq9C3c 9tFXBvsm5kSi+labk9Y1EXORfa2acz1RJZOkl1tvHjbPWmztJ2VZTTBgCaCNKUgXn1CB DEBQ== 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:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=yu6itZWiAmcUaJ+QXSa0fa211Ngc9QUGJ4KMoZyhcMQ=; b=lyrP/vV2eVrH9ZVsrwx6Ld5e1BMDNUjYe6zJKpN4TEKhEF55RWsRjKQvoZxtYzlqAk s2f+FA5hCHfPaNKOceOtM6WUmG5cfIfrd9j2bdMay/KxKCUtveRim4E85mCa7spN+yQ+ 6kH5GYH8OqbhyENxY7hsjBI5VzTYKM55zNWD4xBf/JgA5YbtkiwsbzsfrITmDYu6zjH1 DSDkjkknIPdpCTt7yEJiqyRVErXNnkQ/wmsFKPYIL35vunL0BFakTXgWagCZ+Zu04Gce 1uOEO+7+XcANjwxSV+QpQjwVS3TtpVqOIH0tuO1nuv7m6YplcwG/x3VBHhIn09oH9ZY7 5Nhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=kdkwnrwz; 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 cy15si8255299edb.22.2020.07.13.01.22.03; Mon, 13 Jul 2020 01:22:25 -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=kdkwnrwz; 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 S1729211AbgGMITw (ORCPT + 99 others); Mon, 13 Jul 2020 04:19:52 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:61061 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725830AbgGMITv (ORCPT ); Mon, 13 Jul 2020 04:19:51 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20200713081947epoutp02a8b2db4d4c760e3c47dd65b94ce0c205~hQhHfmSfA2077920779epoutp02w for ; Mon, 13 Jul 2020 08:19:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20200713081947epoutp02a8b2db4d4c760e3c47dd65b94ce0c205~hQhHfmSfA2077920779epoutp02w DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594628387; bh=yu6itZWiAmcUaJ+QXSa0fa211Ngc9QUGJ4KMoZyhcMQ=; h=From:To:Cc:Subject:Date:References:From; b=kdkwnrwzYsksIqXYZ0mU020jdOx6pqrrVpPmCu0gYO5I6wsZ4hCLWXeSnuUIusQo3 iTClZi2Sv0LUhPol5T4pbcFqjL2F2skU+rKDwZFMl/EaIRF0xhcBXMme/oWbUdQ7zH GJQm1wfE02VyqvAmJuWg8NxCRpF2J1+XakzDYLWM= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20200713081947epcas1p32422b17ad8f84d8ef9bb2e67caf9216b~hQhG8793o2571125711epcas1p3k; Mon, 13 Jul 2020 08:19:47 +0000 (GMT) Received: from epsmges1p2.samsung.com (unknown [182.195.40.156]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4B4xQS2V6TzMqYkp; Mon, 13 Jul 2020 08:19:44 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 31.20.19033.0291C0F5; Mon, 13 Jul 2020 17:19:44 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20200713081943epcas1p451280630c83a47b2687ab84d28ccdea0~hQhD8Rjgo2871028710epcas1p4U; Mon, 13 Jul 2020 08:19:43 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200713081943epsmtrp21084a2aade8c8ce5db93c132e8577fe5~hQhD7YNmK2276722767epsmtrp2c; Mon, 13 Jul 2020 08:19:43 +0000 (GMT) X-AuditID: b6c32a36-16fff70000004a59-ff-5f0c19209e19 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 8D.F3.08303.F191C0F5; Mon, 13 Jul 2020 17:19:43 +0900 (KST) Received: from localhost.localdomain (unknown [10.113.221.102]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200713081943epsmtip269a92944d6051baa2df175ffac540b2d~hQhDtGyjk2539325393epsmtip2E; Mon, 13 Jul 2020 08:19:43 +0000 (GMT) From: Chanwoo Choi To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: leonard.crestez@nxp.com, lukasz.luba@arm.com, enric.balletbo@collabora.com, hl@rock-chips.com, digetx@gmail.com, thierry.reding@gmail.com, jonathanh@nvidia.com, abel.vesa@nxp.com, cw00.choi@samsung.com, chanwoo@kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com Subject: [PATCH v2 0/2] PM / devfreq: Add governor flags Date: Mon, 13 Jul 2020 17:31:11 +0900 Message-Id: <20200713083113.5595-1-cw00.choi@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplk+LIzCtJLcpLzFFi42LZdljTQFdBkifeYN1JHotll44yWky8cYXF 4vqX56wWqz8+ZrRYc/sQo8WPDaeYLVpmLWKxONv0ht1ixd2PrBaXd81hs/jce4TRYmFTC7vF 7cYVbBY/d81jceDzWDNvDaPHjrtLGD12zrrL7rFpVSebR2/zOzaPje92MHn8nbWfxaNvyypG j8+b5AI4o7JtMlITU1KLFFLzkvNTMvPSbZW8g+Od403NDAx1DS0tzJUU8hJzU22VXHwCdN0y c4CuV1IoS8wpBQoFJBYXK+nb2RTll5akKmTkF5fYKqUWpOQUWBboFSfmFpfmpesl5+daGRoY GJkCFSZkZ7RtXstasFywYmv/FaYGxh6+LkYODgkBE4l7q5hBTCGBHYwSmxW6GDmBzE+MEq+f VHcxcgHZnxkl/rxczwaSACk/s2I9K0RiF6PErCvb2CCcL4wS/W3fmEGq2AS0JPa/uAHWISJg JXH6fwczSBGzwDwmicW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uRk4OCQETiTMr1rN2MXJx CAnsYJR4t/ocG0RCUmLaxaPMXYwcQLawxOHDxSBhIYFPjBIrn3iD2GwCWhL7X9wAKxcRsJG4 u/gaC8gcZoE1TBLvth9iAkkIC1hIbLm/CKyIRUBV4nzHDRYQm1fAUuLa71VMELvkJVZvOMA8 gZFnASPDKkbJ1ILi3PTcYsMCo7zUcr3ixNzi0rx0veT83E2M4JDV0trBuGfVB71DjEwcjIcY JTiYlUR4o0U544V4UxIrq1KL8uOLSnNSiw8xSnOwKInzfp21ME5IID2xJDU7NbUgtQgmy8TB KdXA5OT0K/Lnfentt/gkF618uYF77hmFQ5+m7imQCF+SF1Mffthn1wyHBIFJHsadISsF+6+1 bzdMqjDt75WIk9m755TOxHMyYTN1Zj9J1bFlKXT6VfbB7MX6u06z57Zavvu16AvD5C4+422Z f3+dsOd+vO/tgdXuTBcrm50aRfYsMb12qvy3j/EByxmqxyeHf1WN5ov1ffRBxy/Ya8Llw8qO O9/F1X4+73i5UHX1XtENUa57dTLqhU7OX8R+hKn06N+Js64db2f/9PhTV3x/I+8C0+u5j27P t9X4811p8XapPz/XyrxP7LLQFE2pan6Ufp6fR+u9Yudux8uh0hvfnY822/JlfW64mJKGSl/k D8GVq5VYijMSDbWYi4oTAejwnufIAgAA X-CMS-MailID: 20200713081943epcas1p451280630c83a47b2687ab84d28ccdea0 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: 20200713081943epcas1p451280630c83a47b2687ab84d28ccdea0 References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Devfreq provides the multiple governors and sysfs interface for user. But, some sysfs attributes are useful or not useful. Prior to that the user can access all sysfs attributes regardless of availability. So, clarify the access permission of sysfs attributes according to governor. Provide the governor flag to specify what is necessary or not. When adding the devfreq governor, governor can specify the available attributes with DEVFREQ_GOV_ATTR_ATTR_* defintion as following. [Definition for sysfs attributes] - DEVFREQ_GOV_ATTR_GOVERNOR - DEVFREQ_GOV_ATTR_AVAIL_GOVERNORS - DEVFREQ_GOV_ATTR_AVAIL_FREQUENCIES - DEVFREQ_GOV_ATTR_CUR_FREQ - DEVFREQ_GOV_ATTR_TARGET_FREQ - DEVFREQ_GOV_ATTR_MIN_FREQ - DEVFREQ_GOV_ATTR_MAX_FREQ - DEVFREQ_GOV_ATTR_TRANS_STAT - DEVFREQ_GOV_ATTR_POLLING_INTERVAL - DEVFREQ_GOV_ATTR_TIMER Also, the devfreq governor is able to have the specific flag as follows in order to implement the specific feature with DEVFREQ_GOV_FLA_*. For exmaple, the devfreq deivce using passive governor cannot change their own governor because passive governor requires the 'immutable' feature with DEVFREQ_GOV_FLAG_IMMUTABLE. [Definition for governor 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. Changes from v1: - Rebase it on latest devfreq-next branch - Fix typo issue of tegra30-devfreq.c and test it with COMPILE_TEST Chanwoo Choi (2): PM / devfreq: Clean up the devfreq instance name in sysfs attr PM / devfreq: Add governor flags to clarify the features drivers/devfreq/devfreq.c | 186 +++++++++++++++++----- drivers/devfreq/governor.h | 44 ++++- drivers/devfreq/governor_passive.c | 3 +- drivers/devfreq/governor_performance.c | 1 + drivers/devfreq/governor_powersave.c | 1 + drivers/devfreq/governor_simpleondemand.c | 3 + drivers/devfreq/governor_userspace.c | 1 + drivers/devfreq/tegra30-devfreq.c | 6 +- 8 files changed, 192 insertions(+), 53 deletions(-) -- 2.17.1