public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Shreeya Patel <shreeya.patel@collabora.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh+dt@kernel.org>,
	Zhigang.Shi@liteon.com, krisman@collabora.com,
	linux-iio <linux-iio@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Collabora Kernel ML <kernel@collabora.com>,
	alvaro.soliverez@collabora.com
Subject: Re: [PATCH v7 2/2] iio: light: Add support for ltrf216a sensor
Date: Mon, 11 Jul 2022 17:04:04 +0300	[thread overview]
Message-ID: <68de450f-da22-02e3-e863-7e17582ee03f@collabora.com> (raw)
In-Reply-To: <CAHp75Vf=FOt+N6azar5gifvig8FL4sS3LX1kO8CzNCh2yOk-DQ@mail.gmail.com>

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

  reply	other threads:[~2022-07-11 14:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-11 11:28 [PATCH v7 0/2] Add LTRF216A Driver Shreeya Patel
2022-07-11 11:28 ` [PATCH v7 1/2] dt-bindings: Document ltrf216a light sensor bindings Shreeya Patel
2022-07-11 11:29 ` [PATCH v7 2/2] iio: light: Add support for ltrf216a sensor Shreeya Patel
2022-07-11 13:06   ` Andy Shevchenko
2022-07-11 13:39     ` Shreeya Patel
2022-07-11 13:41       ` Andy Shevchenko
2022-07-11 14:04         ` Dmitry Osipenko [this message]
2022-07-11 14:22           ` Andy Shevchenko
2022-07-11 14:50             ` Dmitry Osipenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=68de450f-da22-02e3-e863-7e17582ee03f@collabora.com \
    --to=dmitry.osipenko@collabora.com \
    --cc=Zhigang.Shi@liteon.com \
    --cc=alvaro.soliverez@collabora.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=kernel@collabora.com \
    --cc=krisman@collabora.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=shreeya.patel@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox