From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755002AbcBCNVr (ORCPT ); Wed, 3 Feb 2016 08:21:47 -0500 Received: from mail-pf0-f176.google.com ([209.85.192.176]:32797 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753616AbcBCNVo (ORCPT ); Wed, 3 Feb 2016 08:21:44 -0500 Date: Wed, 3 Feb 2016 18:51:40 +0530 From: Viresh Kumar 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 Subject: Re: [PATCH 2/5] cpufreq: governor: Create separate sysfs-ops 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 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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