From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Remi Buisson <Remi.Buisson@tdk.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Frank Li <Frank.Li@nxp.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH v5 3/9] iio: imu: inv_icm45600: add buffer support in iio devices
Date: Thu, 4 Sep 2025 16:49:14 +0300 [thread overview]
Message-ID: <aLmY2mKg_FsPOpsq@smile.fi.intel.com> (raw)
In-Reply-To: <FR2PPF4571F02BCCFD984FDD99C69CAE7298C00A@FR2PPF4571F02BC.DEUP281.PROD.OUTLOOK.COM>
+Cc I³C people to comment on the returned values on the regmap. See below.
On Thu, Sep 04, 2025 at 01:01:32PM +0000, Remi Buisson wrote:
> >From: Andy Shevchenko <andriy.shevchenko@intel.com>
> >Sent: Thursday, August 21, 2025 11:21 AM
> >On Wed, Aug 20, 2025 at 02:24:21PM +0000, Remi Buisson via B4 Relay wrote:
...
> >> +#define INV_ICM45600_SENSOR_CONF_KEEP_VALUES {U8_MAX, U8_MAX, U8_MAX, U8_MAX, }
> >
> >When one line, no need to have inner trailing comma, besides that missed
> >space.
> The trailing comma was a request from Jonathan Cameron on the v2 of patchset.
> Let me know, if you disagree with him and I'll fix.
I see, then let's ask him, because it's a usual pattern for
the one-line arrays like this to have no inner trailing commas.
> And I'll add a space before first element.
...
> >> + /* Try to read all FIFO data in internal buffer. */
> >> + st->fifo.count = fifo_nb * packet_size;
> >> + ret = regmap_noinc_read(st->map, INV_ICM45600_REG_FIFO_DATA,
> >> + st->fifo.data, st->fifo.count);
> >> + if (ret == -ENOTSUPP || ret == -EFBIG) {
> >
> >Strictly speaking this is a bit of layering issue, do we have other means to
> >check the support before even trying?
>
> No unfortunately, we can't with current I3C regmap implementation.
> I2C and SPI regmaps are able to split transfers according to max_read_len.
> But for I3C, it is left to the controller driver, which usually only returns an error.
Have it been discussed with I³C maintainers / stakeholders? Because this kind of APIs
will be hard to follow and even change for both sides caller and callee.
> >> + /* Read full fifo is not supported, read samples one by one. */
> >> + ret = 0;
> >> + for (i = 0; i < st->fifo.count && ret == 0; i += packet_size)
> >> + ret = regmap_noinc_read(st->map, INV_ICM45600_REG_FIFO_DATA,
> >> + &st->fifo.data[i], packet_size);
> >> + }
> >> + if (ret)
> >> + return ret;
...
> >> + /* Disable FIFO and set depth. */
> >> + val = FIELD_PREP(INV_ICM45600_FIFO_CONFIG0_MODE_MASK,
> >> + INV_ICM45600_FIFO_CONFIG0_MODE_BYPASS);
> >> + val |= INV_ICM45600_FIFO_CONFIG0_FIFO_DEPTH_MAX;
> >
> >FIELD_MODIFY()
> Ok, great.
Actually this is not a modification per se, it's just an assignment (PREP)
split to two lines, can you just make it a single expression (wrapped on a few
lines, though)?
...
> >asm/byteorder.h ?
> Yes.
> Is linux/byteorder/generic.h OK?
No, as I put it.
linux/*
...blank line...
asm/*
...blank line...
linux/iio/*
...blank line...
...
> >> - scoped_guard(mutex, &st->lock)
> >> + scoped_guard(mutex, &st->lock) {
> >
> >Ah, nice. It should have been done in the first place and put a comment to that
> >patch that scoped_guard() {} used specifically for limiting churn in the next
> >changes.
> If ok for you, I'll keep that as it is.
> If I add a comment in previous patch, I'll anyway have to delete it this patch.
"Comment" is to be added to the email and not the code. It's a free words to
the cover letter and/or to this email after '---' line but before the actual
diff.
But {} should be added as even in the first patch this is multi-line body.
> >> + }
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-09-04 13:49 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-20 14:24 [PATCH v5 0/9] iio: imu: new inv_icm45600 driver Remi Buisson via B4 Relay
2025-08-20 14:24 ` [PATCH v5 1/9] dt-bindings: iio: imu: Add inv_icm45600 Remi Buisson via B4 Relay
2025-08-20 19:33 ` Conor Dooley
2025-08-20 14:24 ` [PATCH v5 2/9] iio: imu: inv_icm45600: add new inv_icm45600 driver Remi Buisson via B4 Relay
2025-08-21 9:02 ` Andy Shevchenko
2025-09-04 12:58 ` Remi Buisson
2025-09-04 13:17 ` Andy Shevchenko
2025-09-05 12:43 ` Remi Buisson
2025-09-05 13:47 ` Andy Shevchenko
2025-08-25 10:34 ` Jonathan Cameron
2025-09-04 13:04 ` Remi Buisson
2025-08-20 14:24 ` [PATCH v5 3/9] iio: imu: inv_icm45600: add buffer support in iio devices Remi Buisson via B4 Relay
2025-08-21 9:20 ` Andy Shevchenko
2025-09-04 13:01 ` Remi Buisson
2025-09-04 13:49 ` Andy Shevchenko [this message]
2025-09-05 12:44 ` Remi Buisson
2025-09-05 13:49 ` Andy Shevchenko
2025-08-25 10:42 ` Jonathan Cameron
2025-09-04 13:05 ` Remi Buisson
2025-08-20 14:24 ` [PATCH v5 4/9] iio: imu: inv_icm45600: add IMU IIO gyroscope device Remi Buisson via B4 Relay
2025-08-25 10:55 ` Jonathan Cameron
2025-09-04 13:06 ` Remi Buisson
2025-08-20 14:24 ` [PATCH v5 5/9] iio: imu: inv_icm45600: add IMU IIO accelerometer device Remi Buisson via B4 Relay
2025-08-20 14:24 ` [PATCH v5 6/9] iio: imu: inv_icm45600: add I2C driver for inv_icm45600 driver Remi Buisson via B4 Relay
2025-08-20 14:24 ` [PATCH v5 7/9] iio: imu: inv_icm45600: add SPI " Remi Buisson via B4 Relay
2025-08-20 14:24 ` [PATCH v5 8/9] iio: imu: inv_icm45600: add I3C " Remi Buisson via B4 Relay
2025-08-20 14:24 ` [PATCH v5 9/9] MAINTAINERS: add entry for inv_icm45600 6-axis imu sensor Remi Buisson via B4 Relay
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=aLmY2mKg_FsPOpsq@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=Frank.Li@nxp.com \
--cc=Remi.Buisson@tdk.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).