From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755536AbcBCNiv (ORCPT ); Wed, 3 Feb 2016 08:38:51 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33580 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752124AbcBCNit (ORCPT ); Wed, 3 Feb 2016 08:38:49 -0500 MIME-Version: 1.0 In-Reply-To: <20160203132140.GE3469@vireshk> References: <5a012e56b8404e2d07e172b6699ce02f5c5b5f26.1454410226.git.viresh.kumar@linaro.org> <20160203065839.GX31828@vireshk> <20160203132140.GE3469@vireshk> Date: Wed, 3 Feb 2016 14:38:47 +0100 X-Google-Sender-Auth: bsvf0-Jvgyyoc1lRcvDpojvPvtY Message-ID: Subject: Re: [PATCH 2/5] cpufreq: governor: Create separate sysfs-ops From: "Rafael J. Wysocki" To: Viresh Kumar Cc: "Rafael J. Wysocki" , 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 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 3, 2016 at 2:21 PM, Viresh Kumar wrote: > 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. In any case this is not suitable for 4.5 IMO. > Anyway I will be posting 7 patches now, pick only first 4 if you > aren't confident about the rest. OK Thanks, Rafael