From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5498C41535 for ; Mon, 7 Feb 2022 14:59:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359075AbiBGO5L (ORCPT ); Mon, 7 Feb 2022 09:57:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386976AbiBGOcD (ORCPT ); Mon, 7 Feb 2022 09:32:03 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A221C0401C1 for ; Mon, 7 Feb 2022 06:32:00 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 324FD20004; Mon, 7 Feb 2022 14:31:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1644244319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O/vlI8Ck/EbdFMfroKcsbkSEtVV0+3aQIntQIptdPS8=; b=fIVgWGgZhRWHxNbh0Zzf8hk0e6GxRrjJuFRp3J8SSXoAV3oEbl6cRaVwoUwFDf3mp2Hr2S RMi2gJ3Q+5bc9W4sjrp7VjKIeisPeR3SW9GBnZe4Mqufeqm3EQW5DV9UGkN3KToBQ6NwHo XP5Sy+kutQLHtxEl58o6UFLoShFsfS/jsmhUg/UEL9mYc/teWW74W8DXypEXHF+q7ZAnGq y6ATi74OviUf1/kv2R9IFmTH9m8TaCqrBJASoZB5fwaIXEcZkEbdnMU6d/Xc+99Vaf3wRe qPWPNDuMwYVpdH869LdtyihDCrBoDG/215yxlkXLPlJsyFdpylysE//yX8N0FQ== Date: Mon, 7 Feb 2022 15:31:56 +0100 From: Miquel Raynal To: Jonathan Cameron Cc: linux-iio@vger.kernel.org, Lars-Peter Clausen , Thomas Petazzoni , Alexandru Ardelean , Denis Ciocca Subject: Re: [PATCH v2 06/12] iio: st_sensors: Stop abusing mlock to ensure internal coherency Message-ID: <20220207153156.38b36fe8@xps13> In-Reply-To: <20220206154533.3153e610@jic23-huawei> References: <20220202140208.391394-1-miquel.raynal@bootlin.com> <20220202140208.391394-7-miquel.raynal@bootlin.com> <20220206154533.3153e610@jic23-huawei> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Hi Jonathan, jic23@kernel.org wrote on Sun, 6 Feb 2022 15:45:33 +0000: > On Wed, 2 Feb 2022 15:02:02 +0100 > Miquel Raynal wrote: >=20 > > An odr_lock has been introduced to protect local accesses to the odr > > internal cache and ensure the cached value always reflected the actual > > value. Using the mlock() for this purpose is no longer needed, so let's > > drop these extra mutex_lock/unlock() calls. > >=20 > > Suggested-by: Jonathan Cameron > > Cc: Denis Ciocca > > Signed-off-by: Miquel Raynal =20 >=20 > Obviously a different issue but all the write_raw() functions should > use the pattern used in st_pressure_core.c and do early > returns seeing as there doesn't seem to be any cleanup to do. I honestly hesitated when dropping the mlocks there. I've done it in v3, so that we don't hurt our eyes on this anymore :) >=20 > We can tidy that up in a follow up patch as I'm sure there are other > areas in these drivers where direct returns would be nicer than > what is there currently! Thanks, Miqu=C3=A8l