Skip to content

iio: osf: add KUnit coverage

Jinseob Kim linux-iio lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v12 Latest2 patches 0 repliesNew

Changes in v12 from the cover letter

- Send only the two replacement tests; omit the six applied driver patches.
- Allow the supported composite module configurations with a bool selector.
- Add deferred destruction for pending-session, receive and IIO mutexes.
- Strengthen producer/configuration worker entry synchronization.
- Document the IIO core unregister prerequisite and validation base split.

Patches in v12 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2iio: osf: add core KUnit testsdrivers/iio/sensorhubs/osf/Kconfig drivers/iio/sensorhubs/osf/Makefile drivers/iio/sensorhubs/osf/osf_core_test.c+1081 -00 replies
2/2iio: osf: add IIO KUnit testsdrivers/iio/sensorhubs/osf/Kconfig drivers/iio/sensorhubs/osf/Makefile drivers/iio/sensorhubs/osf/osf_iio_test.c+397 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v12 yet.

Read the v12 thread

Cover letter [PATCH v12 0/2] iio: osf: add KUnit coverage

Jonathan asked for the updated KUnit patches, replacing the two pending v11 test patches. The six v11 production patches are already applied and are not included again. This KUnit-only v12 maps patch 1/2 to v11 7/8 and patch 2/2 to v11 8/8. The separately submitted kfifo RAW-cache fix is not part of this series.

Allow tests in the existing OSF composite when the driver is a module, without exporting internal symbols or creating a separate test module. The supported configurations are OSF=y/KUNIT=y/TEST=y, OSF=m/KUNIT=y/TEST=y and OSF=m/KUNIT=m/TEST=y. Add deferred mutex cleanup for pending sessions, receive serialization and IIO fixtures, and require producer/configuration handshakes before checking concurrent state.

The unchanged OSF/test sources previously passed all 16 core and 2 IIO cases, GCC and Clang W=1 builds, KASAN, lockdep and debug mutex checks. Actual module load/run/unload validation covered built-in and modular KUnit. With built-in KUnit, 200 production and 200 test-module reloads exercised 20,000 buffer toggles; modular KUnit completed 20 of each reload and 2,000 toggles. Local assertion-abort validation checked seven cleanup paths. These are reused results for identical sources, not new v12 runs. Existing upstream compiler warnings are retained in the validation logs.

The immutable signed commits retain the original IIO testing snapshot:
6a27f3a7d1063aec5aa3d9370161e850fc3a85dd
Runtime unregister concurrency validation used that base plus mainline commit 84bb0fc46ccf6a545b8fdf57cda83770186ed8dd
("iio: buffer: serialize buffer teardown with mode claims"). The fix is a runtime prerequisite, not a patch in this series.

Current IIO testing, fetched for this preparation, is:
19c5db3507633edc21b4172d99f573c2dfbf42b1
Its rewritten OSF commits have identical patch IDs and OSF source blobs, and it now contains 84bb0fc46ccf. Both patches apply cleanly there as well as to the original base, with unchanged OSF/test content. The base-commit below deliberately identifies the original signed series base; the new testing application check is not a claim of a fresh kernel runtime run.

Previous patches, now marked superseded in Patchwork:
https://lore.kernel.org/linux-iio/[email protected]/
https://lore.kernel.org/linux-iio/[email protected]/

Jonathan's request for updated patches:
https://lore.kernel.org/linux-iio/20261018190454.054d3385@jic23-hlaptop/

Changes since v11:
- Send only the two replacement tests; omit the six applied driver patches.
- Allow the supported composite module configurations with a bool selector.
- Add deferred destruction for pending-session, receive and IIO mutexes.
- Strengthen producer/configuration worker entry synchronization.
- Document the IIO core unregister prerequisite and validation base split.

Jinseob Kim (2):
iio: osf: add core KUnit tests
iio: osf: add IIO KUnit tests

 drivers/iio/sensorhubs/osf/Kconfig         |   16 +
 drivers/iio/sensorhubs/osf/Makefile        |    1 +
 drivers/iio/sensorhubs/osf/osf_core_test.c | 1064 ++++++++++++++++++++
 drivers/iio/sensorhubs/osf/osf_iio_test.c  |  395 ++++++++
 4 files changed, 1476 insertions(+)
 create mode 100644 drivers/iio/sensorhubs/osf/osf_core_test.c
 create mode 100644 drivers/iio/sensorhubs/osf/osf_iio_test.c

base-commit: 6a27f3a7d1063aec5aa3d9370161e850fc3a85dd