<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/linux/iio/iio-opaque.h, branch linux-6.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2022-09-05T17:08:42Z</updated>
<entry>
<title>iio: Use per-device lockdep class for mlock</title>
<updated>2022-09-05T17:08:42Z</updated>
<author>
<name>Vincent Whitchurch</name>
<email>vincent.whitchurch@axis.com</email>
</author>
<published>2022-08-29T09:18:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2bc9cd66eb25d0fefbb081421d6586495e25840e'/>
<id>urn:sha1:2bc9cd66eb25d0fefbb081421d6586495e25840e</id>
<content type='text'>
If an IIO driver uses callbacks from another IIO driver and calls
iio_channel_start_all_cb() from one of its buffer setup ops, then
lockdep complains due to the lock nesting, as in the below example with
lmp91000.

Since the locks are being taken on different IIO devices, there is no
actual deadlock.  Fix the warning by telling lockdep to use a different
class for each iio_device.

 ============================================
 WARNING: possible recursive locking detected
 --------------------------------------------
 python3/23 is trying to acquire lock:
 (&amp;indio_dev-&gt;mlock){+.+.}-{3:3}, at: iio_update_buffers

 but task is already holding lock:
 (&amp;indio_dev-&gt;mlock){+.+.}-{3:3}, at: enable_store

 other info that might help us debug this:
  Possible unsafe locking scenario:

        CPU0
        ----
   lock(&amp;indio_dev-&gt;mlock);
   lock(&amp;indio_dev-&gt;mlock);

  *** DEADLOCK ***

  May be due to missing lock nesting notation

 5 locks held by python3/23:
  #0: (sb_writers#5){.+.+}-{0:0}, at: ksys_write
  #1: (&amp;of-&gt;mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter
  #2: (kn-&gt;active#14){.+.+}-{0:0}, at: kernfs_fop_write_iter
  #3: (&amp;indio_dev-&gt;mlock){+.+.}-{3:3}, at: enable_store
  #4: (&amp;iio_dev_opaque-&gt;info_exist_lock){+.+.}-{3:3}, at: iio_update_buffers

 Call Trace:
  __mutex_lock
  iio_update_buffers
  iio_channel_start_all_cb
  lmp91000_buffer_postenable
  __iio_update_buffers
  enable_store

Fixes: 67e17300dc1d76 ("iio: potentiostat: add LMP91000 support")
Signed-off-by: Vincent Whitchurch &lt;vincent.whitchurch@axis.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20220829091840.2791846-1-vincent.whitchurch@axis.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: core: Move the currentmode entry to the opaque structure</title>
<updated>2022-04-10T15:23:01Z</updated>
<author>
<name>Miquel Raynal</name>
<email>miquel.raynal@bootlin.com</email>
</author>
<published>2022-02-07T14:38:38Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=51570c9d4b3a678f77a50ac139f67290e946ec86'/>
<id>urn:sha1:51570c9d4b3a678f77a50ac139f67290e946ec86</id>
<content type='text'>
This entry should, under no situation, be modified by device
drivers. Now that we have limited its read access to device drivers
really needing it and did so through a dedicated helper, we can
easily move this variable to the opaque structure in order to
prevent any further modification from non-authorized code (out of the
core, basically).

Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Reviewed-by: Alexandru Ardelean &lt;ardeleanalex@gmail.com&gt;
Link: https://lore.kernel.org/r/20220207143840.707510-12-miquel.raynal@bootlin.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: core: Introduce iio_push_to_buffers_with_ts_unaligned()</title>
<updated>2021-10-19T07:29:22Z</updated>
<author>
<name>Jonathan Cameron</name>
<email>Jonathan.Cameron@huawei.com</email>
</author>
<published>2021-06-13T15:10:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=95ec3fdf2b79eaff79e78688bbc2f7dbb98d68b6'/>
<id>urn:sha1:95ec3fdf2b79eaff79e78688bbc2f7dbb98d68b6</id>
<content type='text'>
Whilst it is almost always possible to arrange for scan data to be
read directly into a buffer that is suitable for passing to
iio_push_to_buffers_with_timestamp(), there are a few places where
leading data needs to be skipped over.

For these cases introduce a function that will allocate an appropriate
sized and aligned bounce buffer (if not already allocated) and copy
the unaligned data into that before calling
iio_push_to_buffers_with_timestamp() on the bounce buffer.
We tie the lifespace of this buffer to that of the iio_dev.dev
which should ensure no memory leaks occur.

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Reviewed-by: Nuno Sá &lt;nuno.sa@analog.com&gt;
Link: https://lore.kernel.org/r/20210613151039.569883-2-jic23@kernel.org
</content>
</entry>
<entry>
<title>iio: core: move @clock_id from struct iio_dev to struct iio_dev_opaque</title>
<updated>2021-05-17T12:54:21Z</updated>
<author>
<name>Jonathan Cameron</name>
<email>Jonathan.Cameron@huawei.com</email>
</author>
<published>2021-04-26T17:49:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=62a486c46d61bc684967fc3f83eed15dde49cf9b'/>
<id>urn:sha1:62a486c46d61bc684967fc3f83eed15dde49cf9b</id>
<content type='text'>
There is already an acessor function used to access it, making this
move straight forward.

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Reviewed-by: Alexandru Ardelean &lt;ardeleanalex@gmail.com&gt;
Link: https://lore.kernel.org/r/20210426174911.397061-10-jic23@kernel.org
</content>
</entry>
<entry>
<title>iio: core: move @flags from struct iio_dev to struct iio_dev_opaque</title>
<updated>2021-05-17T12:54:21Z</updated>
<author>
<name>Jonathan Cameron</name>
<email>Jonathan.Cameron@huawei.com</email>
</author>
<published>2021-04-26T17:49:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8b1c82cb849f8f7c758891099f2128b8fbc05744'/>
<id>urn:sha1:8b1c82cb849f8f7c758891099f2128b8fbc05744</id>
<content type='text'>
No reason any driver should ever need access to this field, so hide it.

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Reviewed-by: Alexandru Ardelean &lt;ardeleanalex@gmail.com&gt;
Link: https://lore.kernel.org/r/20210426174911.397061-9-jic23@kernel.org
</content>
</entry>
<entry>
<title>iio: core: move @chrdev from struct iio_dev to struct iio_dev_opaque</title>
<updated>2021-05-17T12:54:17Z</updated>
<author>
<name>Jonathan Cameron</name>
<email>Jonathan.Cameron@huawei.com</email>
</author>
<published>2021-04-26T17:49:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=396f7234856956eb29f009da6e5d846f29f87ebd'/>
<id>urn:sha1:396f7234856956eb29f009da6e5d846f29f87ebd</id>
<content type='text'>
No reason for this to be exposed to the drivers, so lets move it to the
opaque structure.

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Reviewed-by: Alexandru Ardelean &lt;ardeleanalex@gmail.com&gt;
Link: https://lore.kernel.org/r/20210426174911.397061-8-jic23@kernel.org
</content>
</entry>
<entry>
<title>iio: core: move @info_exist_lock to struct iio_dev_opaque</title>
<updated>2021-05-17T12:49:13Z</updated>
<author>
<name>Jonathan Cameron</name>
<email>Jonathan.Cameron@huawei.com</email>
</author>
<published>2021-04-26T17:49:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b804e2b76ac6d5559b99588e0190ac97b5597497'/>
<id>urn:sha1:b804e2b76ac6d5559b99588e0190ac97b5597497</id>
<content type='text'>
This lock is only of interest to the IIO core, so make it only
visible there.

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Reviewed-by: Alexandru Ardelean &lt;ardeleanalex@gmail.com&gt;
Link: https://lore.kernel.org/r/20210426174911.397061-7-jic23@kernel.org
</content>
</entry>
<entry>
<title>iio: core: move @scan_index_timestamp to struct iio_dev_opaque</title>
<updated>2021-05-17T12:49:13Z</updated>
<author>
<name>Jonathan Cameron</name>
<email>Jonathan.Cameron@huawei.com</email>
</author>
<published>2021-04-26T17:49:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=62f4f36cdfcdbb961bbbeab15e6595dd391d2205'/>
<id>urn:sha1:62f4f36cdfcdbb961bbbeab15e6595dd391d2205</id>
<content type='text'>
No reason for this cached value to be exposed to drivers so move it
to the opaque structure.

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Reviewed-by: Alexandru Ardelean &lt;ardeleanalex@gmail.com&gt;
Link: https://lore.kernel.org/r/20210426174911.397061-6-jic23@kernel.org
</content>
</entry>
<entry>
<title>iio: core: move @trig_readonly from struct iio_dev to struct iio_dev_opaque</title>
<updated>2021-05-17T12:49:13Z</updated>
<author>
<name>Jonathan Cameron</name>
<email>Jonathan.Cameron@huawei.com</email>
</author>
<published>2021-04-26T17:49:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3028e0c2af95dd476ccd71f4fc025990385168c2'/>
<id>urn:sha1:3028e0c2af95dd476ccd71f4fc025990385168c2</id>
<content type='text'>
This is only set via the iio_trig_set_immutable() call and later used
by the IIO core so there is no benefit in drivers being able to access
it.

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Reviewed-by: Alexandru Ardelean &lt;ardeleanalex@gmail.com&gt;
Link: https://lore.kernel.org/r/20210426174911.397061-5-jic23@kernel.org
</content>
</entry>
<entry>
<title>iio: core: move @driver_module from struct iio_dev to struct iio_dev_opaque</title>
<updated>2021-05-17T12:49:13Z</updated>
<author>
<name>Jonathan Cameron</name>
<email>Jonathan.Cameron@huawei.com</email>
</author>
<published>2021-04-26T17:49:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6eaf9f6a2738789dedb1e962096f61aaddd81464'/>
<id>urn:sha1:6eaf9f6a2738789dedb1e962096f61aaddd81464</id>
<content type='text'>
Continuing move to hide internal elements from drivers, move this structure
element over.  It's only accessed from iio core files so this one was
straight forward and no accessor functions are needed.

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Reviewed-by: Alexandru Ardelean &lt;ardeleanalex@gmail.com&gt;
Link: https://lore.kernel.org/r/20210426174911.397061-4-jic23@kernel.org
</content>
</entry>
</feed>
