From: "Javier Carrasco" <javier.carrasco.cruz@gmail.com>
To: "Andy Shevchenko" <andriy.shevchenko@intel.com>,
"Javier Carrasco" <javier.carrasco.cruz@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"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 v4 2/4] iio: light: add support for veml6031x00 ALS series
Date: Tue, 02 Jun 2026 13:42:44 +0200 [thread overview]
Message-ID: <DIYJBS4F362A.2LIDZAKU7GBBU@gmail.com> (raw)
In-Reply-To: <ah66ljSiIc0ywFC2@ashevche-desk.local>
On Tue Jun 2, 2026 at 1:12 PM CEST, Andy Shevchenko wrote:
> On Tue, Jun 02, 2026 at 12:45:35PM +0200, Javier Carrasco wrote:
>> On Tue Jun 2, 2026 at 12:01 PM CEST, Andy Shevchenko wrote:
>> > On Sun, May 31, 2026 at 09:58:22PM +0200, Javier Carrasco wrote:
>
> ...
>
>> > + array_size.h
>> >
>> >> +#include <linux/bitfield.h>
>> >> +#include <linux/bits.h>
>> >> +#include <linux/i2c.h>
>> >
>> >> +#include <linux/module.h>
>> >> +#include <linux/mod_devicetable.h>
>> >
>> > In C locale it seems wrong order.
>> >
>> >> +#include <linux/mutex.h>
>> >> +#include <linux/pm_runtime.h>
>> >> +#include <linux/regmap.h>
>> >
>> > + types.h
>>
>> Do you know any tool to automate this beyond asking an AI? Manual
>> auditing is not very reliablo and it is not that difficult to miss a
>> header that has been indirectly included. Building with W=1 and similar
>> stuff did not help.
>
> `iwyu`, but it needs a custom configuration. Even with that it's quite far from ideal.
> The custom config had been shared in the linux-iio@ mailing list this year.
>
Thanks, I'll take a look at it in case it finds some more missing
headers.
>> >> +#include <linux/units.h>
>
> ...
>
>> >> + /* integration time + 10 % to ensure completion */
>> >
>> > fsleep() adds up to 25%, isn't it enough?
>>
>> The problem is that it adds UP to 25%, but that is not guaranteed. If
>> almost no extra delay is added, it will be below the margin I added,
>> which was necessary when I tested this delay with real hardware.
>
> Noted. Can it_usec be precalculated already to include that 10%?
>
Yes, that is possible. I'll add it to V5.
>> >> + fsleep(it_usec + (it_usec / 10));
>
> ...
>
>> >> + pm_runtime_put_autosuspend(dev);
>> >
>> > Hmm... But why? Wouldn't this be problematic with reference count on the failed
>> > devm_iio_device_register() below?
>>
>> I could move this a bit further down after devm_iio_device_register(),
>> but as I replied to a Sashiko complaint, the reference count will never
>> underflow in this configuration.
>
> Please, add a comment elaborating on that, it's not clear at glance.
I will provide the link to the message where I explained this instead of
copying the explanation to keep the discussion in one place. The mail
belongs to the discussion thread for [2/4] (this patch) anyway:
https://lore.kernel.org/all/20260531-veml6031x00-v4-0-e64f7fdce38d@gmail.com/
Best regards,
Javier
next prev parent reply other threads:[~2026-06-02 11:42 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-31 19:58 [PATCH v4 0/4] iio: light: add support for veml6031x00 ALS series Javier Carrasco
2026-05-31 19:58 ` [PATCH v4 1/4] dt-bindings: iio: light: veml6030: add " Javier Carrasco
2026-05-31 19:58 ` [PATCH v4 2/4] iio: light: add support for " Javier Carrasco
2026-05-31 20:16 ` sashiko-bot
2026-06-01 10:21 ` Jonathan Cameron
2026-06-01 20:07 ` Javier Carrasco
2026-06-02 12:33 ` Jonathan Cameron
2026-06-02 17:54 ` Javier Carrasco
2026-06-02 10:01 ` Andy Shevchenko
2026-06-02 10:45 ` Javier Carrasco
2026-06-02 11:12 ` Andy Shevchenko
2026-06-02 11:21 ` Joshua Crofts
2026-06-02 11:35 ` Javier Carrasco
2026-06-02 11:47 ` Joshua Crofts
2026-06-02 12:22 ` Javier Carrasco
2026-06-02 12:33 ` Joshua Crofts
2026-06-02 12:34 ` Javier Carrasco
2026-06-02 11:42 ` Javier Carrasco [this message]
2026-06-02 11:44 ` Javier Carrasco
2026-06-02 12:38 ` Jonathan Cameron
2026-06-02 12:40 ` Javier Carrasco
2026-06-02 14:29 ` Jonathan Cameron
2026-06-02 14:33 ` Javier Carrasco
2026-05-31 19:58 ` [PATCH v4 3/4] iio: light: veml6031x00: add support for triggered buffers Javier Carrasco
2026-05-31 20:30 ` sashiko-bot
2026-06-01 10:26 ` Jonathan Cameron
2026-06-02 10:10 ` Andy Shevchenko
2026-05-31 19:58 ` [PATCH v4 4/4] iio: light: veml6031x00: add support for events and trigger Javier Carrasco
2026-05-31 20:43 ` sashiko-bot
2026-06-01 10:47 ` Jonathan Cameron
2026-06-02 10:27 ` Andy Shevchenko
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=DIYJBS4F362A.2LIDZAKU7GBBU@gmail.com \
--to=javier.carrasco.cruz@gmail.com \
--cc=andriy.shevchenko@intel.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