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 X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DAACC433E1 for ; Thu, 27 Aug 2020 09:03:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E881122B4D for ; Thu, 27 Aug 2020 09:03:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=st.com header.i=@st.com header.b="ubV2Bnqr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727772AbgH0JDz (ORCPT ); Thu, 27 Aug 2020 05:03:55 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:5862 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726266AbgH0JDy (ORCPT ); Thu, 27 Aug 2020 05:03:54 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07R91vfa000570; Thu, 27 Aug 2020 11:03:28 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=STMicroelectronics; bh=lx+QYBokaHHL/CwY5ofgZfT1OTJOb3G3GrKi86P18Gg=; b=ubV2Bnqr1skfZO4yPCcWRoIojbuL/jlVBuomhD2W2lLk5pDPpQ0LlyLtoQMZN/lBReaw Rdeqq8taJzY6cskIYqssKEVzEVu1cOeqjfIcxstmWnGl66DPSYT2MEhtA9cfsqWWhibQ m+rTm+oymrqq5T4fPJYXK/Wa3aeMXg10sBL7XXnlIf/2T4mIgvkmK5P5RyQcLrVc1L7r 8MfVkOQxb5vohvuLuLJHZIXpfsHOlI7yM5TifWHNP2IuR/snueCbXdBvdN4jVKlvVut8 tjOpIMszwyr/130JT8H0geA0cNpMqfhZFfvNcAiVb/pRDCexoYl//s1BiTJKOgwxZnhY FQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 333b3hn6a8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Aug 2020 11:03:28 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 827DE10002A; Thu, 27 Aug 2020 11:03:25 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag5node3.st.com [10.75.127.15]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 6AF5B221159; Thu, 27 Aug 2020 11:03:25 +0200 (CEST) Received: from [10.48.1.149] (10.75.127.45) by SFHDAG5NODE3.st.com (10.75.127.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 27 Aug 2020 11:03:24 +0200 Subject: Re: [PATCH v2] iio: stm32-dac: Replace indio_dev->mlock with own device lock To: Alexandru Ardelean , Alexandru Ardelean CC: linux-iio , , LKML , , Jonathan Cameron , , Sergiu Cuciurean References: <20200826063850.47625-1-alexandru.ardelean@analog.com> <20200826120042.200364-1-alexandru.ardelean@analog.com> From: Fabrice Gasnier Message-ID: Date: Thu, 27 Aug 2020 11:03:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG7NODE3.st.com (10.75.127.21) To SFHDAG5NODE3.st.com (10.75.127.15) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-27_02:2020-08-27,2020-08-27 signatures=0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On 8/27/20 10:55 AM, Alexandru Ardelean wrote: > On Wed, Aug 26, 2020 at 3:03 PM Alexandru Ardelean > wrote: >> From: Sergiu Cuciurean >> >> As part of the general cleanup of indio_dev->mlock, this change replaces >> it with a local lock. The lock protects against potential races when >> reading the CR reg and then updating, so that the state of pm_runtime >> is consistent between the two operations. >> >> Signed-off-by: Sergiu Cuciurean >> Signed-off-by: Alexandru Ardelean >> --- > Forgot the changelog here. > Apologies. > > Changelog v1 -> v2: > * removed whitespace change for 'common' field > * updated comment about the lock usage Hi Alexandru, Sorry if I missed it... is there an update on the comment :-) ? Best Regards, Fabrice > >> drivers/iio/dac/stm32-dac.c | 12 ++++++++---- >> 1 file changed, 8 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/iio/dac/stm32-dac.c b/drivers/iio/dac/stm32-dac.c >> index 092c796fa3d9..7a8aed476850 100644 >> --- a/drivers/iio/dac/stm32-dac.c >> +++ b/drivers/iio/dac/stm32-dac.c >> @@ -26,9 +26,11 @@ >> /** >> * struct stm32_dac - private data of DAC driver >> * @common: reference to DAC common data >> + * @lock: lock to protect the data buffer during regmap ops >> */ >> struct stm32_dac { >> struct stm32_dac_common *common; >> + struct mutex lock; >> };