Skip to content

RFC some /dev/mem specifications and traced testing

Gabriele Paoloni linux-doc linux-kselftest linux-mm lkml oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 RFC Latest6 patches 4 repliesIn review

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6Documentation: extend the 'Function documentation' with expected behavior and constraints of useDocumentation/doc-guide/kernel-doc.rst+19 -04 replies
2/6/dev/mem: Add initial documentation of memory_open() and mem_fopsdrivers/char/mem.c+190 -60 replies
3/6kunit: add visibility helpers for static inline functionsinclude/kunit/visibility.h+2 -00 replies
4/6char: mem: expose devmem helpers for KUnit testingdrivers/char/mem.c drivers/char/mem.h+28 -40 replies
5/6char: mem: add KUnit tests for /dev/mem read_mem()drivers/char/mem_kunit_test.c+1323 -00 replies
6/6char: mem: add Kconfig option for devmem KUnit testsdrivers/char/Kconfig drivers/char/Makefile+22 -00 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [RFC PATCH v3 0/6] some /dev/mem specifications and traced testing

RFCv1 [1] was an initial proposal defining testable code specifications for some functions in /drivers/char/mem.c. However it was not clear how to write specifications according to the format and wording used for them, plus tests were missing.

RFCv2 [2] proposed a guideline explaining how to write such testable code specifications and also added kselftest for read_mem, however there was reluctance to accept the proposed addition before having clarity on who needs it, who is going to maintain it and for which APIs in the kernel it is needed.

RFCv3 (this one) proposes kernel-doc API documentation according to the current doc-guide for some APIs of /dev/mem introducing the concept of traceable specifications to KUnit tests.
For read_mem() Kunit tests traced to the corresponding specifications are also introduced, so that in case of test failure it is clear which specification is violated and it would be easier to review incoming patches agaisnt the intended behavior of the code.

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/

Alessandro Carminati (4):
kunit: add visibility helpers for static inline functions
char: mem: expose devmem helpers for KUnit testing
char: mem: add KUnit tests for /dev/mem read_mem()
char: mem: add Kconfig option for devmem KUnit tests

Gabriele Paoloni (2):
Documentation: extend the 'Function documentation' with expected
behavior and constraints of use
/dev/mem: Add initial documentation of memory_open() and mem_fops

 Documentation/doc-guide/kernel-doc.rst |   19 +
 drivers/char/Kconfig                   |   21 +
 drivers/char/Makefile                  |    1 +
 drivers/char/mem.c                     |  211 +++-
 drivers/char/mem.h                     |   17 +
 drivers/char/mem_kunit_test.c          | 1323 ++++++++++++++++++++++++
 include/kunit/visibility.h             |    2 +
 7 files changed, 1584 insertions(+), 10 deletions(-)
 create mode 100644 drivers/char/mem.h
 create mode 100644 drivers/char/mem_kunit_test.c
Signature · 1 line
2.48.1