Devicetree
 help / color / mirror / Atom feed
From: "Javier Carrasco" <javier.carrasco.cruz@gmail.com>
To: "Jonathan Cameron" <jic23@kernel.org>,
	"Javier Carrasco" <javier.carrasco.cruz@gmail.com>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Rishi Gupta" <gupt21@gmail.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Matti Vaittinen" <mazziesaccount@gmail.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/4] iio: light: add support for veml6031x00 ALS series
Date: Tue, 26 May 2026 22:46:40 +0200	[thread overview]
Message-ID: <DISWIFAG1KHL.3CUT30EQMVS81@gmail.com> (raw)
In-Reply-To: <20260526190528.0efe80c6@jic23-huawei>

On Tue May 26, 2026 at 8:05 PM CEST, Jonathan Cameron wrote:
> On Tue, 26 May 2026 18:59:33 +0100
> Jonathan Cameron <jic23@kernel.org> wrote:
>
>> On Sun, 24 May 2026 23:53:56 +0200
>> Javier Carrasco <javier.carrasco.cruz@gmail.com> wrote:
>>
>> > These sensors provide two light channels (ALS and IR), I2C communication
>> > and a multiplexed interrupt line to signal data ready and configurable
>> > threshold alarms.
>> >
>> > This first implementation provides basic functionality (measurement
>> > configuration, raw reads and ID validation) and defines the different
>> > register regions in preparation for extended features in the subsequent
>> > patches of the series.
>> >
>> > Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
>>
>> A few things inline.  Biggest one is that device driver specific state needs
>> local well documented locking. Here the whole complex gain handling means there
>> are a bunch of register field where the accesses to each set of them need
>> to appear atomic.
> The sashiko comment on underflowing pm counters also looks plausible
> so check that as well.

Hi Jonathan, thanks for your review to this and the other patches of the
series. I will go through all your comments within the next days.

I replied to its comment on the PM underflow, but as I only replied to it,
and then I forwarded the message, it might have gone unseen.

I believe Sashiko is misinterpreting how this pattern works (not
introduced by me, it is already available upstream in
drivers/spi/atmel-quadspi.c). Decrementing the usage counter is fine
because the devres action uses pm_runtime_put_noidle(), which in turns uses
atomic_add_unless(usage_count, -1, 0) to avoid decrementing the usage_count
if it is already 0. Otherwise the devm_ variant would be unusable
because it would not be possible to put the device in autosuspend for
the same reason Sashiko is complaining.

Best regards,
Javier

  reply	other threads:[~2026-05-26 20:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-24 21:53 [PATCH v3 0/4] iio: light: add support for veml6031x00 ALS series Javier Carrasco
2026-05-24 21:53 ` [PATCH v3 1/4] dt-bindings: iio: light: veml6030: add " Javier Carrasco
2026-05-24 22:11   ` sashiko-bot
2026-05-24 21:53 ` [PATCH v3 2/4] iio: light: add support for " Javier Carrasco
2026-05-24 22:53   ` sashiko-bot
2026-05-25  0:29     ` Javier Carrasco
2026-05-26 17:59   ` Jonathan Cameron
2026-05-26 18:05     ` Jonathan Cameron
2026-05-26 20:46       ` Javier Carrasco [this message]
2026-05-24 21:53 ` [PATCH v3 3/4] iio: light: veml6031x00: add support for triggered buffers Javier Carrasco
2026-05-24 23:29   ` sashiko-bot
2026-05-26 18:03   ` Jonathan Cameron
2026-05-24 21:53 ` [PATCH v3 4/4] iio: light: veml6031x00: add support for events and trigger Javier Carrasco
2026-05-25  0:13   ` sashiko-bot
2026-05-25  8:59     ` Javier Carrasco

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=DISWIFAG1KHL.3CUT30EQMVS81@gmail.com \
    --to=javier.carrasco.cruz@gmail.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=gupt21@gmail.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mazziesaccount@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    /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