From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viresh Kumar Subject: Re: [PATCH 2/5] cpufreq: governor: Create separate sysfs-ops Date: Wed, 3 Feb 2016 18:51:40 +0530 Message-ID: <20160203132140.GE3469@vireshk> References: <5a012e56b8404e2d07e172b6699ce02f5c5b5f26.1454410226.git.viresh.kumar@linaro.org> <20160203065839.GX31828@vireshk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: "Rafael J. Wysocki" Cc: Rafael Wysocki , Juri Lelli , Lists linaro-kernel , "linux-pm@vger.kernel.org" , Saravana Kannan , Peter Zijlstra , Michael Turquette , Steve Muckle , Vincent Guittot , Morten Rasmussen , dietmar.eggemann@arm.com, Linux Kernel Mailing List List-Id: linux-pm@vger.kernel.org On 03-02-16, 13:42, Rafael J. Wysocki wrote: > > +static ssize_t governor_show(struct kobject *kobj, struct attribute *attr, > > + char *buf) > > +{ > > + struct dbs_data *dbs_data = to_dbs_data(kobj); > > + struct governor_attr *gattr = to_gov_attr(attr); > > + int ret = -EIO; > > + > > + down_read(&dbs_data->rwsem); > > + > > + if (gattr->show) > > + ret = gattr->show(dbs_data, buf); > > + > > + up_read(&dbs_data->rwsem); > > Do we need the lock here too? > > show() is only going to read the value, isn't it? And everything u32 > or smaller is read atomically anyway. Okay, will drop it for now. > Apart from this it looks good to me. > > When you're ready, please resend the whole series without patch [5/5] > which is premature IMO. I have changed that patch a bit, and am dropping just the lock now and not governor_enable thing. That should be sane enough I believe. Anyway I will be posting 7 patches now, pick only first 4 if you aren't confident about the rest. -- viresh