From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id E5B471A0079 for ; Mon, 30 Mar 2015 21:06:08 +1100 (AEDT) Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Mar 2015 11:06:04 +0100 Message-ID: <55192007.9090000@fr.ibm.com> Date: Mon, 30 Mar 2015 12:05:59 +0200 From: Cedric Le Goater MIME-Version: 1.0 To: Michael Ellerman Subject: Re: [PATCH v3 3/3] powerpc/powernv: remove opal_sensor_mutex References: <20150327095936.50A921400A0@ozlabs.org> <1427474362-3903-3-git-send-email-clg@fr.ibm.com> <1427681398.4218.7.camel@ellerman.id.au> <5518F258.4060308@fr.ibm.com> <1427698777.28219.3.camel@ellerman.id.au> In-Reply-To: <1427698777.28219.3.camel@ellerman.id.au> Content-Type: text/plain; charset=utf-8 Cc: Stewart Smith , skiboot@lists.ozlabs.org, benh@au1.ibm.com, linuxppc-dev@lists.ozlabs.org, Neelesh Gupta List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 03/30/2015 08:59 AM, Michael Ellerman wrote: > On Mon, 2015-03-30 at 08:51 +0200, Cedric Le Goater wrote: >> On 03/30/2015 04:09 AM, Michael Ellerman wrote: >>> On Fri, 2015-03-27 at 17:39 +0100, Cédric Le Goater wrote: >>>> The opal sensor mutex protects the opal_sensor_read call which >>>> can return a OPAL_BUSY code on IBM Power systems if a previous >>>> request is in progress. >>>> >>>> This can be handled at user level with a retry. >>> >>> It can, but how does it actually look in practice? >>> >>> It looks like the only use of opal_get_sensor_data() is show_sensor() in >>> drivers/hwmon/ibmpowernv.c. >>> >>> Because that's a sysfs attribute folks will be generally just dumping >>> that with cat, or reading it in a shell script, neither of which will >>> cope nicely with EBUSY I think? >> >> It won't, I agree but it should only happen when running concurrent cat >> commands on the hwmon sysfs files. The event should be rare enough. > > Rare enough maybe, but a real pain in the .. to cope with in a shell script if > you're trying to automate something. > >> Anyhow, this is not a big issue. We can drop that patch. The real "issue" >> is the time it takes to get some values back from the FSP. This is what >> user space has been most surprised about. > > OK. The other option would be to move the mutex into the sysfs show routine, so > only that is synchronous. That would give you nice behaviour from cat, ie. it > would sleep on contention but still be killable with ctrl-c. Let's keep it how it is and see if it is possible to the improve OPAL side first. I will send you an updated patchset shortly. Thanks for the review. C.