Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp409403imm; Tue, 3 Jul 2018 22:31:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfWYErAU6hP7pOx9WORGuPZq1utLeJzdOaAI9Rre0RjhDNPP8PjlXcnwgkEvTo9aA2bl1Ud X-Received: by 2002:a65:52cc:: with SMTP id z12-v6mr584516pgp.69.1530682293931; Tue, 03 Jul 2018 22:31:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530682293; cv=none; d=google.com; s=arc-20160816; b=nmd8//WVVXSAV1mcolN4ni7wB5GPF3zYfmsDvtfdCDEJITHDYguukeEhwAqV9N/xj7 gvlrmNCkL3nJjZiI8L37ThD77dpHrAaCr2eByMC+yjUR3iRAbCX8XyD7Vm+NTnvL2C3B O50Xm0Iex2IL169bb/DJ1zO+7yJPJwD5AvU29hSBew/lCECyHmW6jdmwNprO2EOoOUDN C0qU4DBzuY7c0/YBxfZA8/HKf726HueDgFHUMUbNcu3Uwr6VHOzAkDB04CcdHpkJKy7V kuPNzMgCDBZWxpIu2DENYfx9wjImnxyzfODmhSYhZV/XDwwsZz/3CaERTyMrysV1AwK9 3avg== 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 :in-reply-to:subject:cc:to:user-agent:organization:from:date :message-id:content-transfer-encoding:mime-version:dkim-signature :dkim-filter:arc-authentication-results; bh=0zfqUDPasGKo58KipvIjwtClT70iyOXRlWdIM6wfU/0=; b=sDhGX7Qjt1cQw5auhVNp/o972lIP1itP2JIqVVZie/k31fnNx2wXdMVamW/i1cSy28 rY8J3Iim73p7q9Nq3P8f22DLTHZPb1lM90Cm5LU/+vLE2D/jyX2Lp5u0NVL3GluucnIf 9gg1f9kgHZ7reA1QKiqFczuJippSOyYYb9mEuVSsBUtQmoAeLwBbQOvDQJzM96Emusa9 AMXJaH+TBGCikNtiJ9p6apfx0h8uZ0y4iZ3kXd7yThfBj4eDLV2LuRCdAiB3WgQd+oIj uwzTWz15bhHGaQsogbyPSQxnr8yTg0j4xmt0fxbrbx/uDuFsdTCsHEk5854wAZZdMzIr T23g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=uEOKH3qS; 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 13-v6si2895514plb.463.2018.07.03.22.31.19; Tue, 03 Jul 2018 22:31:33 -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=uEOKH3qS; 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 S932643AbeGDFam (ORCPT + 99 others); Wed, 4 Jul 2018 01:30:42 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:60041 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932270AbeGDFaj (ORCPT ); Wed, 4 Jul 2018 01:30:39 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20180704053037epoutp04c2dc54b64e3be779576de112935d3b7d~_E2KC3T1P2663126631epoutp04f; Wed, 4 Jul 2018 05:30:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20180704053037epoutp04c2dc54b64e3be779576de112935d3b7d~_E2KC3T1P2663126631epoutp04f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1530682237; bh=0zfqUDPasGKo58KipvIjwtClT70iyOXRlWdIM6wfU/0=; h=Date:From:To:Cc:Subject:In-reply-to:References:From; b=uEOKH3qSFbwzZLY86lj+Eb9QlYwYmxA09vDnDPjWCToVFhTQAo/izCeOxh2KIWYA8 50mSFe41LIXXUeodA34Vc/QvxZWleWvMSOvTyOEmL/eJoRZm+06PRRFoDJZT2DY85Y KMUNpFrjRT3AhZlYxHjjHwbjQMsp9Z4vtz9RMmJY= Received: from epsmges1p5.samsung.com (unknown [182.195.40.154]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20180704053034epcas1p13d1b6019a1ebb7363dbaa9eed093e362~_E2HZv3oC2004520045epcas1p1s; Wed, 4 Jul 2018 05:30:34 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 8A.9F.04203.A7B5C3B5; Wed, 4 Jul 2018 14:30:34 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20180704053033epcas1p2d843a74995846838cf572eae85ceade2~_E2HBsLYO1438614386epcas1p2L; Wed, 4 Jul 2018 05:30:33 +0000 (GMT) X-AuditID: b6c32a39-24dff7000000106b-1b-5b3c5b7ad524 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 5E.D5.03915.97B5C3B5; Wed, 4 Jul 2018 14:30:33 +0900 (KST) MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset="UTF-8" Received: from [10.113.63.77] by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PBB00E6RTYWRFB0@mmp2.samsung.com>; Wed, 04 Jul 2018 14:30:33 +0900 (KST) Message-id: <5B3C5B78.6020401@samsung.com> Date: Wed, 04 Jul 2018 14:30:32 +0900 From: Chanwoo Choi Organization: Samsung Electronics User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 To: Matthias Kaehlcke , MyungJoo Ham Cc: Kyungmin Park , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Brian Norris , Douglas Anderson , Enric Balletbo i Serra , "Rafael J . Wysocki" , Viresh Kumar , Lee Jones , Benson Leung , Olof Johansson Subject: Re: [PATCH v5 07/12] PM / devfreq: export devfreq_class In-reply-to: <20180703234705.227473-8-mka@chromium.org> X-Brightmail-Tracker: H4sIAAAAAAAAA01TbUxTVxjO6f3oRVc9u6KesSjdXRqFhMptLRw3MMThvGb8YCPZFm8M3MAJ JfYr97YE/MX8mEqGcSwTAhsfm9sIaQQBkU0mkxVxdrBIqbAwWQxmYR9xMxXUGYlt78z8dZ73 eZ/n5H2fnMNRfIhN46o8fqJ6FJfArqIHv8+wZh2U8+Ts9jYeP268YsRNtyM07rv7N4PbQ5MM nvjyMouDc6MAH/68h8UTh/4y4l+XxgCOfPMJi2MNIYC/mLluwLHeBYDn3uti8bWZGIt/DE8x +Oi3ISM+tyQV8FKwLQikR/82Aqm17jotDd08A6S+7hOs9MuNYVYa+TRolKavHmKkgegxWjo5 0A2kWN/m4tX7SJ6TKBVENRNPubeiylOZL7xRUvpaqSMnW8wSd+BcwexR3CRfKCwqznq9yhVf TTBXK65AnCpWNE3YtjNP9Qb8xOz0av58QRZFm1XMzrXabPHTvv8VmyMuKSPOxYZB2je2pmb6 Vg9dB6Kr60EKh+B2NBQ+R9eDVRwPhwAKxe5QenEfoJZIP/VUtXB55r9GL0BzE9FkwwSfRw8+ mo/bOY6C6Sg0dSBBUzADnb/YY0xgHt4E6FYTrcsz0fzSStJKQwu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lBEsICDhI39h1nh1i2 nVHiyM97YAs4BcwlprcsZ5vAKDALya2zEG6dheTWBYzMqxglUwuKc9Nzi40KDPNSy/WKE3OL S/PS9ZLzczcxAqNy22Gtvh2M95fEH2IU4GBU4uFdUWodLcSaWFZcmXuIUYKDWUmEt1PfJlqI NyWxsiq1KD++qDQntfgQozQHi5I47+28Y5FCAumJJanZqakFqUUwWSYOTqkGxtQPvmm3ZJ+L ZLd9sU05fOTqWkPOTbI/02TF7i2p+DSpIkPATyLxq0jal1UF+gJKj5ie6bzI3Wm2LF/shKDP QssDk3X+LddKibuoerOOfY1J89Pa0KBzObPlemyZSlUvLHzcJ26+/P/lXTPW28edErRZNDdT JvAXqzRLiM7utXonN615efqwoRJLcUaioRZzUXEiAHguvDDGAgAA X-CMS-MailID: 20180704053033epcas1p2d843a74995846838cf572eae85ceade2 X-Msg-Generator: CA CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20180703234837epcas5p1da751e0394c16816b95ac1956bf6de20 References: <20180703234705.227473-1-mka@chromium.org> <20180703234705.227473-8-mka@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I didn't see any framework which exporting the class instance. It is very dangerous. Unknown device drivers is able to reset the 'devfreq_class' instance. I can't agree this approach. Regards, Chanwoo Choi On 2018년 07월 04일 08:47, Matthias Kaehlcke wrote: > Exporting the device class allows other parts of the kernel to enumerate > the devfreq devices and receive notification when a devfreq device is > added or removed. > > Signed-off-by: Matthias Kaehlcke > Reviewed-by: Brian Norris > --- > Changes in v5: > - none > > Changes in v4: > - added 'Reviewed-by: Brian Norris ' tag > > Changes in v3: > - none > > Changes in v2: > - patch added to series > --- > drivers/devfreq/devfreq.c | 3 ++- > include/linux/devfreq.h | 2 ++ > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c > index 4cbaa7ad1972..38b90b64fc6e 100644 > --- a/drivers/devfreq/devfreq.c > +++ b/drivers/devfreq/devfreq.c > @@ -31,7 +31,8 @@ > #define MAX(a,b) ((a > b) ? a : b) > #define MIN(a,b) ((a < b) ? a : b) > > -static struct class *devfreq_class; > +struct class *devfreq_class; > +EXPORT_SYMBOL_GPL(devfreq_class); > > /* > * devfreq core provides delayed work based load monitoring helper > diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h > index c4f84a769cb5..964e064a951f 100644 > --- a/include/linux/devfreq.h > +++ b/include/linux/devfreq.h > @@ -206,6 +206,8 @@ struct devfreq_freqs { > }; > > #if defined(CONFIG_PM_DEVFREQ) > +extern struct class *devfreq_class; > + > extern struct devfreq *devfreq_add_device(struct device *dev, > struct devfreq_dev_profile *profile, > const char *governor_name, >