From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id B65771A11C2 for ; Sat, 28 Mar 2015 03:40:06 +1100 (AEDT) Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 27 Mar 2015 16:40:03 -0000 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH v3 3/3] powerpc/powernv: remove opal_sensor_mutex Date: Fri, 27 Mar 2015 17:39:21 +0100 Message-Id: <1427474362-3903-3-git-send-email-clg@fr.ibm.com> In-Reply-To: <20150327095936.50A921400A0@ozlabs.org> References: <20150327095936.50A921400A0@ozlabs.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Stewart Smith , benh@au1.ibm.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Neelesh Gupta , skiboot@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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. Signed-off-by: Cédric Le Goater --- Changes since v2 : - removed a goto label arch/powerpc/platforms/powernv/opal-sensor.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) Index: linux.git/arch/powerpc/platforms/powernv/opal-sensor.c =================================================================== --- linux.git.orig/arch/powerpc/platforms/powernv/opal-sensor.c +++ linux.git/arch/powerpc/platforms/powernv/opal-sensor.c @@ -19,13 +19,10 @@ */ #include -#include #include #include #include -static DEFINE_MUTEX(opal_sensor_mutex); - /* * This will return sensor information to driver based on the requested sensor * handle. A handle is an opaque id for the powernv, read by the driver from the @@ -40,11 +37,9 @@ int opal_get_sensor_data(u32 sensor_hndl token = opal_async_get_token_interruptible(); if (token < 0) { pr_err("%s: Couldn't get the token, returning\n", __func__); - ret = token; - goto out; + return token; } - mutex_lock(&opal_sensor_mutex); ret = opal_sensor_read(sensor_hndl, token, &data); switch (ret) { case OPAL_ASYNC_COMPLETION: @@ -70,9 +65,7 @@ int opal_get_sensor_data(u32 sensor_hndl } out_token: - mutex_unlock(&opal_sensor_mutex); opal_async_release_token(token); -out: return ret; } EXPORT_SYMBOL_GPL(opal_get_sensor_data);