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