[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<BL1PR03MB5992653C0A426BAC69D7033197EB2@BL1PR03MB5992.namprd03.prod.outlook.com>
Date: Wed, 22 May 2024 12:01:21 +0000
From: "Gradinariu, Ramona" <Ramona.Gradinariu@...log.com>
To: Jonathan Cameron <jic23@...nel.org>
CC: Nuno Sá <noname.nuno@...il.com>,
Ramona Gradinariu
<ramona.bolboaca13@...il.com>,
"linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>,
"linux-iio@...r.kernel.org"
<linux-iio@...r.kernel.org>,
"linux-doc@...r.kernel.org"
<linux-doc@...r.kernel.org>,
"devicetree@...r.kernel.org"
<devicetree@...r.kernel.org>,
"corbet@....net" <corbet@....net>,
"conor+dt@...nel.org" <conor+dt@...nel.org>,
"krzysztof.kozlowski+dt@...aro.org" <krzysztof.kozlowski+dt@...aro.org>,
"robh@...nel.org" <robh@...nel.org>, "Sa, Nuno" <Nuno.Sa@...log.com>
Subject: RE: [PATCH 4/5] iio: adis16480: add support for adis16545/7 families
>
> If you are using bursts, the data is getting read anyway - which is the main
> cost here. The real question becomes what are you actually saving by supporting all
> the combinations of the the two subsets of channels in the pollfunc?
> Currently you have to pick the channels out and repack them, if pushing them all
> looks to me like a mempcy and a single value being set (unconditionally).
I did not get a chance to look at this again until now. Unfortunately, a
memcpy will not work.
The current implementation is as follows:
/* The lower register data is sequenced first */
st->data[i++] = buffer[2 * bit + offset + 3];
st->data[i++] = buffer[2 * bit + offset + 2];
The device first sends the 16LSB, then the next 16MSB in big endian
format.
So then I wonder, can we keep the same implementation logic? The code
is implemented in the same manner for adis16475 driver which uses the
same channels data packing approach.
>
> Then it's a question of what the overhead of the channel demux in the core is.
> What you pass out of the driver via iio_push_to_buffers*()
> is not what ends up in the buffer if you allow the IIO core to do data demuxing
> for you - that is enabled by providing available_scan_masks. At buffer
> start up the demux code computes a fairly optimal set of copies to repack
> the incoming data to match with what channels the consumer (here probably
> the kfifo on the way to userspace) is expecting.
>
> That demux adds a small overhead but it should be small as long
> as the channels wanted aren't pathological (i.e. every other one).
>
> Advantage is the driver ends up simpler and in the common case of turn
> on all the channels (why else did you buy a device with those measurements
> if you didn't want them!) the demux is zerocopy so effectively free which
> is not going to be the case for the bitmap walk and element copy in the
> driver.
>
> Jonathan
>
Powered by blists - more mailing lists