Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp691954rwl; Wed, 29 Mar 2023 07:18:19 -0700 (PDT) X-Google-Smtp-Source: AKy350aiEpKFeGVGg2bAclbonkbIyX0d+0c9UWRUA1T5JXJsDc21gI10XLjw0jHFiMv57wK5xkd5 X-Received: by 2002:a17:906:c355:b0:929:e5a8:63f7 with SMTP id ci21-20020a170906c35500b00929e5a863f7mr2525114ejb.28.1680099499625; Wed, 29 Mar 2023 07:18:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680099499; cv=none; d=google.com; s=arc-20160816; b=IdOCFG2Y2jRke3ReLw6LdyFQdCHMFlHbHJ45jB4GQkSxLVqucPSCFEstFmBbi9idF2 45Ps0VG87at5qLvLj62C0ZL543E4gfHFbG/UIUgFIwcn0nL87SGteMr5xsmt4RpAhqIP oHhhNNWd+uHXoQ3Lyphh8sxrUZZG++51a1ZKLmkIj3OiJ2LS1bAFzeV8lj4sx8f7Cbkr vEqlAz4cAO0wn7mgCSM+G0BKijKO/Z7rfxdnwG/1XdufPY+e9nEssjW5XplaLXshW81L 5pJXhh5l0fLjfR0cg8UOV/NpkZiHkIAdJq07JEtU1LAD9nC3xRNIWB2U2Oa1/LF/ZwcU UIJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=biP/Sc11oUwDdu/5+92WJKKehzeYaVyxlwpnIxQF78I=; b=JmgdK26LOLZjZHZM2AKs8f4EGcBLrT+oZl6AdfE3g+EJPKgXkitDCRn4Lu3pN+q9I9 qX/LfFnG2oJnT11mH1+cQGkfc9to/9RNrfL00K5Gi1VUka/LSTyqCkqS81RwyuAWHwNE l53PLvLLRvmjVjmG36leVouBR09FwBtd4O7BDtnCOTNbKMx1Pv22lGV+aQ+c0NkN64g/ xr0Rpq8Cpy+AXJPk5YQChS1x98vFvhk2gRLmluvlK9HhN8Ow4X0Hs4PLuK2vkXIrIX3U bkeVIjrFJweZ8TfJjvMlmDX2YwVTSCy+FQfC/BVMxLzN1LXLZiLTHcDLoeC9MTooKS8O JhDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=O2xupxpT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q24-20020a1709066b1800b0092bf1091806si31636670ejr.748.2023.03.29.07.17.54; Wed, 29 Mar 2023 07:18:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=O2xupxpT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230467AbjC2ONE (ORCPT + 99 others); Wed, 29 Mar 2023 10:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230268AbjC2OMZ (ORCPT ); Wed, 29 Mar 2023 10:12:25 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F21B5FD9; Wed, 29 Mar 2023 07:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680099103; x=1711635103; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=uqRixI+rCRUn5ojNLm8F/UrKpimmbseAK3K5c/AtPKI=; b=O2xupxpTWc403nesMbIbqSBhTiF/+boII9BxVuiejMdhab7M5ARk8RDS aOtRjoRkrtAHWnlXtOqjv+8TtQpddkTd7VmKrSCAgLph4iie0qgva0ytq LgXbGlkjpuox22As/bK0qGqVbX2wRM2KFjl+o6QrAnn6kmNzsRPINVi8k +gNi/gE7MbSz35WiDYSegBbN4QS+BWjZ3RDMVxeD+iUe1Ohz74vrZlIKe EYCMj6lb0QIiGda82CNHjtbhhFHI55qsttmJk36dneWIffAsJbHMUkNdD cFE3hP3UhJ9kSnZkmyjMmQB2JDsvHhtzuJS8xSEhkEo3XJPNctP3D5w9J g==; X-IronPort-AV: E=McAfee;i="6600,9927,10664"; a="342480942" X-IronPort-AV: E=Sophos;i="5.98,301,1673942400"; d="scan'208";a="342480942" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 07:06:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10664"; a="684280183" X-IronPort-AV: E=Sophos;i="5.98,301,1673942400"; d="scan'208";a="684280183" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga002.jf.intel.com with ESMTP; 29 Mar 2023 07:06:31 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1phWRZ-00A3Kf-03; Wed, 29 Mar 2023 17:06:29 +0300 Date: Wed, 29 Mar 2023 17:06:28 +0300 From: Andy Shevchenko To: Nuno =?iso-8859-1?Q?S=E1?= Cc: Mark Brown , "Sahin, Okan" , Lee Jones , Rob Herring , Krzysztof Kozlowski , Liam Girdwood , Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Stephen Boyd , Caleb Connolly , Lad Prabhakar , "Bolboaca, Ramona" , ChiYuan Huang , "Tilki, Ibrahim" , William Breathitt Gray , Arnd Bergmann , ChiaEn Wu , Haibo Chen , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-iio@vger.kernel.org" Subject: Re: [PATCH v6 5/5] mfd: max77541: Add ADI MAX77541/MAX77540 PMIC Support Message-ID: References: <20230315175257.GJ9667@google.com> <60bbad1b38b8e3c9c3efefb0fb7b8d3cad7fa98c.camel@gmail.com> <9ba3c559e2fb685c941b02fcfddaeb82aefed6f7.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9ba3c559e2fb685c941b02fcfddaeb82aefed6f7.camel@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 29, 2023 at 09:01:30AM +0200, Nuno S? wrote: > On Tue, 2023-03-28 at 18:47 +0300, Andy Shevchenko wrote: > > On Tue, Mar 28, 2023 at 04:51:18PM +0200, Nuno S? wrote: > > > On Tue, 2023-03-28 at 17:35 +0300, Andy Shevchenko wrote: > > > > On Tue, Mar 28, 2023 at 04:18:30PM +0200, Nuno S? wrote: > > > > > On Tue, 2023-03-28 at 14:46 +0100, Mark Brown wrote: > > > > > > On Tue, Mar 28, 2023 at 03:26:44PM +0200, Nuno S? wrote: > > > > > > > > > > > > > IIRC, regmap_read() is not really reentrant and it is used > > > > > > > in > > > > > > > the > > > > > > > IIO > > > > > > > driver on the sysfs interface. So, yeah, I think you need > > > > > > > the > > > > > > > regmap > > > > > > > lock and better just leave the config as is. Yes, the lock > > > > > > > is > > > > > > > opt- > > > > > > > out > > > > > > > so let's not disable it :) > > > > > > > > > > > > All the regmap operations are fully thread safe. > > > > > > > > > > Even if 'config->disable_locking' is set? I think that is > > > > > what's > > > > > being > > > > > discussed in here... > > > > > > > > In case the driver has its own lock to serialize IO how on earth > > > > the > > > > regmap > > > > lock is needed. That's what I asked the author of the driver. He > > > > told > > > > the code > > > > > > Well, if the driver has it's own locking, then sure we do not need > > > regmap's lock... > > > > > > > doesn't require the regmap lock, and I tend to believe the > > > > author. > > > > So, why to > > > > keep it? > > > > > > However, if you look at the adc driver, I can see plain > > > regmap_read() > > > calls without any "outside" locking. > > > > Then author of the code should know what they are doing. Right? > > In theory yes, but you know that's not always the case :) Exactly. That's why I want to hear from the author of the code to make sure they know _their_ code. -- With Best Regards, Andy Shevchenko