Linux IIO development
 help / color / mirror / Atom feed
* [PATCH 00/15] IIO: Immutable triggers. Close leaks in registration and use more widely.
@ 2026-11-30  0:13 Jonathan Cameron
  2026-11-30  0:13 ` [PATCH 01/15] iio: core: add iio_trigger_set_default_immutable() Jonathan Cameron
                   ` (14 more replies)
  0 siblings, 15 replies; 20+ messages in thread
From: Jonathan Cameron @ 2026-11-30  0:13 UTC (permalink / raw)
  To: linux-iio, linux, Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko, Michael Hennerich, Radu Sabau, Song Qiang,
	Siratul Islam, Lorenzo Bianconi, Alisa-Dariana Roman,
	Ramona Bolboaca, Jean-Baptiste Maneyrol
  Cc: Jonathan Cameron

The first part is simply the equivalent of the work already done
with default_trigger. That only applies directly to the dln2_adc.

The second is to consider where we would have used immutable triggers
if the concept had been around at the time. This set of drivers both
set a default trigger and have a validate_trigger callback that mean
they can't use any another triggers. The subtle difference is that
they can be set to have 'no trigger'. In some other drivers that no
trigger state has meaning (typically use a fifo). In these it does not
and is an artefact only. The reason this series as an RFC is that ABI
change could trip up userspace software.  Hence I want lots of eyes
and testing on this.

If it turns out not to be a viable path we can instead just convert
these over to setting default_trigger and leave things otherwise as
they are. Not as elegant but removes this potential ABI related
regression.  I thought I'd give this path a go before giving up and
falling back to that!

For the kernel tools/iio code we are fine because amusingly it has
a bug that means the code that is meant to clear the trigger doesn't run.
iio-sensor-proxy is fine because it doesn't check the return value of
the clearing write.  I haven't checked libiio so keen for someone familiar
with that to take a look! (I asked an LLM and it thinks we are fine :)

The third part is the lmp9100 'special'.  This device grabs an immutable
trigger provided by another device.  The reason is that we need buffered
capture from an ADC that this is the consumer from.  It needs to do
some delecate ordering so it also needs to driver the trigger for that
devices.  There are some 'challenges' with this driver that may warrant
a closer look in future.

---
Jonathan Cameron (15):
      iio: core: add iio_trigger_set_default_immutable()
      iio: adc: dln2-adc: use iio_trigger_set_default_immutable()
      iio: core: allow writing the current trigger when it is immutable
      iio: adc: ad7606: use iio_trigger_set_default_immutable()
      iio: adc: ad4691: use iio_trigger_set_default_immutable()
      iio: proximity: vl53l0x-i2c: use iio_trigger_set_default_immutable()
      iio: proximity: vl53l1x-i2c: use iio_trigger_set_default_immutable()
      iio: humidity: hts221: use iio_dev->trig in iio_trigger_notify_done()
      iio: humidity: hts221: use iio_trigger_set_default_immutable()
      iio: adc: ad_sigma_delta: use an immutable default trigger
      iio: adc: ad_sigma_delta: drop ad_sd_validate_trigger()
      iio: imu: inv_mpu6050: use iio_trigger_set_default_immutable()
      iio: core: add devm_iio_trigger_set_immutable()
      iio: potentiostat: lmp91000: use devm managed probe
      iio: potentiostat: lmp91000: undo immutable trigger on unbind

 drivers/iio/adc/ad4691.c                      | 34 ++++----------
 drivers/iio/adc/ad7124.c                      |  1 -
 drivers/iio/adc/ad7173.c                      |  1 -
 drivers/iio/adc/ad7191.c                      |  1 -
 drivers/iio/adc/ad7192.c                      |  3 --
 drivers/iio/adc/ad7606.c                      | 20 ++------
 drivers/iio/adc/ad7791.c                      |  2 -
 drivers/iio/adc/ad7793.c                      |  2 -
 drivers/iio/adc/ad_sigma_delta.c              | 25 ++--------
 drivers/iio/adc/dln2-adc.c                    |  4 +-
 drivers/iio/adc/max11205.c                    |  1 -
 drivers/iio/humidity/hts221_buffer.c          |  8 ++--
 drivers/iio/humidity/hts221_core.c            |  9 ----
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c    | 21 ---------
 drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c |  4 +-
 drivers/iio/industrialio-trigger.c            | 62 +++++++++++++++++++++++-
 drivers/iio/potentiostat/lmp91000.c           | 68 +++++++++------------------
 drivers/iio/proximity/vl53l0x-i2c.c           | 12 ++---
 drivers/iio/proximity/vl53l1x-i2c.c           |  5 +-
 include/linux/iio/adc/ad_sigma_delta.h        |  2 -
 include/linux/iio/trigger.h                   | 37 +++++++++++++++
 21 files changed, 150 insertions(+), 172 deletions(-)
---
base-commit: 7ef6c02e7230f47fc912cb0c86b7720814ae44b4
change-id: 20261129-messing-immutable3323-369a21c95432
prerequisite-message-id: 20261129-messing-fixes3323-v1-0-f01aa73aa628@oss.qualcomm.com
prerequisite-patch-id: 395dcce76e0802ec04f53ce6c72b00ebd0d5d399
prerequisite-patch-id: 0fd8e639fbf994a926f53b9e5061e41503cdfe08
prerequisite-patch-id: b99455c14e8a05b76b18cc731c2facb355a3fb46
prerequisite-patch-id: 957e0cc96c42f292fdb76bb331e381f8c0a51607
prerequisite-patch-id: b93d28d2bb81d48b6b268773de89b0a748ce4eca
prerequisite-patch-id: ddebcd656fa8344fbfc9b50778679302cf8c87a2
prerequisite-patch-id: c7248b27faf9d78c3470699228803472264d9b2e
prerequisite-patch-id: 71a16d6ecaa05483dc17c431330ed08fb3b28fdd
prerequisite-patch-id: ed6ff8f99c77d07deb748768ce458350fdee2e31
prerequisite-patch-id: 950d5da771e575a7f01bca2561d1723c05d56b02
prerequisite-patch-id: a3f7613afda381afa66d6f798c1ba6c2329e9828
prerequisite-patch-id: 6baead8547cc63e04ddb10b7c0c78da3f6236cae
prerequisite-patch-id: c42539f00c54e1b95d0fa18833324908fae3b9c5
prerequisite-patch-id: b36164e1664d7eb313ce161b19471ad02129caa0
prerequisite-patch-id: 426447af229d8978e8922c7b3b56ca69b6cf8123
prerequisite-patch-id: f306103b25521bdf5a6e2f6df2691f8f932e949c
prerequisite-patch-id: 5cf31841531caf2ad7feae2b00838463a0040da7
prerequisite-patch-id: 3de5dfbbecb176ffb43471b8b24a467a8346662e
prerequisite-patch-id: 4f9cc97eeb18ea6c08c463f0e7a16ab187ee3c2f
prerequisite-patch-id: ebd3ac3a95da790d77f11e93c10ffb30109f28a7
prerequisite-patch-id: f39ea542c2fdaaf651e553f6a450910b75d3db01
prerequisite-patch-id: e7c36bbd76c0a88a14b804924865fa5460065501
prerequisite-patch-id: c30e8f8d90a8acaebc58990ddf4826ec6b7e9cf5
prerequisite-patch-id: 34f658a23f0d01c287b21f083f2af1d1ddd87beb
prerequisite-patch-id: ac27a967cc7164bb8f61a86b51c4e24b5ac94113

Best regards,
--  
Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2026-11-30 14:06 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30  0:13 [PATCH 00/15] IIO: Immutable triggers. Close leaks in registration and use more widely Jonathan Cameron
2026-11-30  0:13 ` [PATCH 01/15] iio: core: add iio_trigger_set_default_immutable() Jonathan Cameron
2026-11-30  0:13 ` [PATCH 02/15] iio: adc: dln2-adc: use iio_trigger_set_default_immutable() Jonathan Cameron
2026-11-30  0:13 ` [PATCH 03/15] iio: core: allow writing the current trigger when it is immutable Jonathan Cameron
2026-11-30  0:13 ` [PATCH 04/15] iio: adc: ad7606: use iio_trigger_set_default_immutable() Jonathan Cameron
2026-11-30  0:13 ` [PATCH 05/15] iio: adc: ad4691: " Jonathan Cameron
2026-11-30  0:13 ` [PATCH 06/15] iio: proximity: vl53l0x-i2c: " Jonathan Cameron
2026-11-30 14:06   ` Siratul Islam
2026-11-30  0:13 ` [PATCH 07/15] iio: proximity: vl53l1x-i2c: " Jonathan Cameron
2026-11-30 14:06   ` Siratul Islam
2026-11-30  0:13 ` [PATCH 08/15] iio: humidity: hts221: use iio_dev->trig in iio_trigger_notify_done() Jonathan Cameron
2026-11-30  8:20   ` Lorenzo Bianconi
2026-11-30  0:13 ` [PATCH 09/15] iio: humidity: hts221: use iio_trigger_set_default_immutable() Jonathan Cameron
2026-11-30  8:21   ` Lorenzo Bianconi
2026-11-30  0:13 ` [PATCH 10/15] iio: adc: ad_sigma_delta: use an immutable default trigger Jonathan Cameron
2026-11-30  0:13 ` [PATCH 11/15] iio: adc: ad_sigma_delta: drop ad_sd_validate_trigger() Jonathan Cameron
2026-11-30  0:13 ` [PATCH 12/15] iio: imu: inv_mpu6050: use iio_trigger_set_default_immutable() Jonathan Cameron
2026-11-30  0:13 ` [PATCH 13/15] iio: core: add devm_iio_trigger_set_immutable() Jonathan Cameron
2026-11-30  0:13 ` [PATCH 14/15] iio: potentiostat: lmp91000: use devm managed probe Jonathan Cameron
2026-11-30  0:13 ` [PATCH 15/15] iio: potentiostat: lmp91000: undo immutable trigger on unbind Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox