All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: <linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<lars@metafoo.de>
Subject: Re: [RFC PATCH 00/12] iio: core,buffer: add support for multiple IIO buffers per IIO device
Date: Sat, 21 Nov 2020 18:52:43 +0000	[thread overview]
Message-ID: <20201121185243.255d33b2@archlinux> (raw)
In-Reply-To: <20201117162340.43924-1-alexandru.ardelean@analog.com>

On Tue, 17 Nov 2020 18:23:28 +0200
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:

> Continuing from:
>   https://lore.kernel.org/linux-iio/20200517144023.6c5cb169@archlinux/
> 
> This is a V2 of the initial attempt in the discussion above.
> But it did not occur to me that I should mark it as V2 when I generated
> the patches.
> I've only tested [so far] that the current IIO buffer mechnism still works.
> And decided to show this sketch patchset.
> 
> This requires the ioctl() centralization mechanism, for which I sent a
> fix earlier.
>   https://lore.kernel.org/linux-iio/CA+U=Dsqf3UgyM666Gg9EmehpWiucDx2P0bmsC9JR--JJDT_eWQ@mail.gmail.com/T/#t
>   https://lore.kernel.org/linux-iio/20201117095154.7189-1-alexandru.ardelean@analog.com/T/#u
> 
> The gist of this is that now, the first IIO buffer should work as
> before, but all extra buffers should go through the anon inodes
> mechanism.
> I'd need to find a device or a way or a chip to test these extra buffers
> stuff. But I'm confident that this current form should eventually work
> with multiple IIO buffers per 1 IIO device and with anon inodes.
> 
> Maybe I'll take some of the patches in this set separately and send them
> individually. The problem with patchsets like this that tackle changes
> in a framework (like IIO) is that I become unsure after the 5th-7th patch,
> that the approach is correct. And I get even more unsure after that.
> 
> I'll create some userspace code to test this a bit, but I thought I'd
> send an RFC in the meantime.

From a first read, with all the warnings you give above, this looks pretty
good to me.   The kobj stuff is a little nasty and needs more docs
but other than that it all looks quite pleasant and readable and was
roughly what I was expecting from earlier discussions (which is great!).

Good work on this, looking forward to next steps.

Jonathan

> 
> Alexandru Ardelean (12):
>   iio: core: register chardev only if needed
>   iio: buffer: add back-ref from iio_buffer to iio_dev
>   iio: buffer: rework buffer & scan_elements dir creation
>   iio: buffer: add index to the first IIO buffer dir and symlink it back
>   iio: core: split __iio_device_attr_init() to init only the attr object
>   iio: buffer: re-route scan_elements via it's kobj_type
>   iio: buffer: re-route core buffer attributes via it's new kobj_type
>   iio: buffer: add helper to get the IIO device to which a buffer
>     belongs
>   iio: re-route all buffer attributes through new buffer kobj_type
>   iio: core: wrap iio device & buffer into struct for character devices
>   iio: buffer: introduce support for attaching more IIO buffers
>   iio: buffer: add ioctl() to support opening extra buffers for IIO
>     device
> 
>  drivers/iio/accel/adxl372.c                   |  36 +-
>  drivers/iio/accel/bmc150-accel-core.c         |  34 +-
>  drivers/iio/adc/at91-sama5d2_adc.c            |  30 +-
>  .../buffer/industrialio-buffer-dmaengine.c    |  13 +-
>  .../cros_ec_sensors/cros_ec_sensors_core.c    |  30 +-
>  .../common/hid-sensors/hid-sensor-trigger.c   |  32 +-
>  drivers/iio/iio_core.h                        |  11 +
>  drivers/iio/industrialio-buffer.c             | 582 ++++++++++++++----
>  drivers/iio/industrialio-core.c               | 117 ++--
>  include/linux/iio/buffer.h                    |   2 +
>  include/linux/iio/buffer_impl.h               |  25 +-
>  include/linux/iio/iio-opaque.h                |   6 +
>  include/linux/iio/iio.h                       |   2 +-
>  include/linux/iio/sysfs.h                     |  50 ++
>  include/uapi/linux/iio/buffer.h               |  16 +
>  15 files changed, 735 insertions(+), 251 deletions(-)
>  create mode 100644 include/uapi/linux/iio/buffer.h
> 


  parent reply	other threads:[~2020-11-21 18:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17 16:23 [RFC PATCH 00/12] iio: core,buffer: add support for multiple IIO buffers per IIO device Alexandru Ardelean
2020-11-17 16:23 ` [RFC PATCH 01/12] iio: core: register chardev only if needed Alexandru Ardelean
2020-11-21 18:02   ` Jonathan Cameron
2020-11-23 12:10     ` Alexandru Ardelean
2020-11-17 16:23 ` [RFC PATCH 02/12] iio: buffer: add back-ref from iio_buffer to iio_dev Alexandru Ardelean
2020-11-17 16:23 ` [RFC PATCH 03/12] iio: buffer: rework buffer & scan_elements dir creation Alexandru Ardelean
2020-11-21 18:24   ` Jonathan Cameron
2020-11-23 12:21     ` Alexandru Ardelean
2020-11-17 16:23 ` [RFC PATCH 04/12] iio: buffer: add index to the first IIO buffer dir and symlink it back Alexandru Ardelean
2020-11-21 18:27   ` Jonathan Cameron
2020-11-17 16:23 ` [RFC PATCH 05/12] iio: core: split __iio_device_attr_init() to init only the attr object Alexandru Ardelean
2020-11-17 16:23 ` [RFC PATCH 06/12] iio: buffer: re-route scan_elements via it's kobj_type Alexandru Ardelean
2020-11-21 18:33   ` Jonathan Cameron
2020-11-23 12:22     ` Alexandru Ardelean
2020-11-17 16:23 ` [RFC PATCH 07/12] iio: buffer: re-route core buffer attributes via it's new kobj_type Alexandru Ardelean
2020-11-17 16:23 ` [RFC PATCH 08/12] iio: buffer: add helper to get the IIO device to which a buffer belongs Alexandru Ardelean
2020-11-17 16:23 ` [RFC PATCH 09/12] iio: re-route all buffer attributes through new buffer kobj_type Alexandru Ardelean
2020-11-17 16:23 ` [RFC PATCH 10/12] iio: core: wrap iio device & buffer into struct for character devices Alexandru Ardelean
2020-11-17 16:23 ` [RFC PATCH 11/12] iio: buffer: introduce support for attaching more IIO buffers Alexandru Ardelean
2020-11-21 18:44   ` Jonathan Cameron
2020-11-23 12:27     ` Alexandru Ardelean
2020-11-17 16:23 ` [RFC PATCH 12/12] iio: buffer: add ioctl() to support opening extra buffers for IIO device Alexandru Ardelean
2020-11-21 18:50   ` Jonathan Cameron
2020-11-23 12:54     ` Alexandru Ardelean
2020-11-21 18:52 ` Jonathan Cameron [this message]
2020-11-23 13:03   ` [RFC PATCH 00/12] iio: core,buffer: add support for multiple IIO buffers per " Alexandru Ardelean

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=20201121185243.255d33b2@archlinux \
    --to=jic23@kernel.org \
    --cc=alexandru.ardelean@analog.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.