lkml.org 
[lkml]   [2022]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v7 2/2] iio: light: Add support for ltrf216a sensor
From
On 7/11/22 16:41, Andy Shevchenko wrote:
> On Mon, Jul 11, 2022 at 3:39 PM Shreeya Patel
> <shreeya.patel@collabora.com> wrote:
>> On 11/07/22 18:36, Andy Shevchenko wrote:
>>> On Mon, Jul 11, 2022 at 1:30 PM Shreeya Patel
>
> Please, remove unneeded context when replying!
>
> ...
>
>>>> +static const struct regmap_config ltrf216a_regmap_config = {
>>>> + .name = LTRF216A_DRV_NAME,
>>>> + .reg_bits = 8,
>>>> + .val_bits = 8,
>>>> + .max_register = LTRF216A_MAX_REG,
>>> Why do you use regmap locking? What for?
>>
>> Why do we want to skip the internal locking if it doesn't bring any
>> benefits?
>
> Can you elaborate on the "no benefits" part, please?

Since the regmap's lock will never be contended, thus it's free to keep
using it. If later on we will need to change the driver's code such that
the lock will become needed, then we won't need to bother with
re-enabling it. The comment to the driver's mutex states clearly that
it's intended to protect the cached value.

Hence what is point in disabling the regmap's lock? There are very few
drivers that disable the regmap's lock and most of them do that for the
good reason.

--
Best regards,
Dmitry

\
 
 \ /
  Last update: 2022-07-11 16:04    [W:1.865 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site