mbox series

[00/12] firmware: cirrus: Add KUnit tests for cs_dsp

Message ID 20241212143725.1381013-1-rf@opensource.cirrus.com (mailing list archive)
Headers show
Series firmware: cirrus: Add KUnit tests for cs_dsp | expand

Message

Richard Fitzgerald Dec. 12, 2024, 2:37 p.m. UTC
This series adds KUnit tests for the cs_dsp module.

Most of the functionality in cs_dsp is for downloading firmware to
DSP memory and interacting with "control" words defined in that
memory. This doesn't require any emulation of running firmware,
because it is only reading and writing registers. So the testing can
be done using a dummy regmap. The way this is used to perform testing
is described in more detail in the commit message for each test.

ADSP1 is not tested because this was only used by the WM2200 codec,
a long-obsolete part that was discontinued in 2015.

Richard Fitzgerald (12):
  firmware: cs_dsp: Add mock regmap for KUnit testing
  firmware: cs_dsp: Add mock DSP memory map for KUnit testing
  firmware: cs_dsp: Add mock wmfw file generator for KUnit testing
  firmware: cs_dsp: Add mock bin file generator for KUnit testing
  firmware: cs_dsp: Add KUnit testing of bin file download
  firmware: cs_dsp: Add KUnit testing of wmfw download
  firmware: cs_dsp: Add KUnit testing of control parsing
  firmware: cs_dsp: Add KUnit testing of control cache
  firmware: cs_dsp: Add KUnit testing of control read/write
  firmware: cs_dsp: Add KUnit testing of bin error cases
  firmware: cs_dsp: Add KUnit testing of wmfw error cases
  firmware: cs_dsp: Add KUnit testing of client callbacks

 MAINTAINERS                                   |    4 +-
 drivers/firmware/cirrus/Kconfig               |   20 +
 drivers/firmware/cirrus/Makefile              |    2 +
 drivers/firmware/cirrus/test/Makefile         |   23 +
 .../firmware/cirrus/test/cs_dsp_mock_bin.c    |  199 +
 .../cirrus/test/cs_dsp_mock_mem_maps.c        |  751 ++++
 .../firmware/cirrus/test/cs_dsp_mock_regmap.c |  367 ++
 .../firmware/cirrus/test/cs_dsp_mock_utils.c  |   13 +
 .../firmware/cirrus/test/cs_dsp_mock_wmfw.c   |  473 +++
 .../firmware/cirrus/test/cs_dsp_test_bin.c    | 2557 +++++++++++++
 .../cirrus/test/cs_dsp_test_bin_error.c       |  600 +++
 .../cirrus/test/cs_dsp_test_callbacks.c       |  688 ++++
 .../cirrus/test/cs_dsp_test_control_cache.c   | 3282 +++++++++++++++++
 .../cirrus/test/cs_dsp_test_control_parse.c   | 1851 ++++++++++
 .../cirrus/test/cs_dsp_test_control_rw.c      | 2669 ++++++++++++++
 .../firmware/cirrus/test/cs_dsp_test_wmfw.c   | 2211 +++++++++++
 .../cirrus/test/cs_dsp_test_wmfw_error.c      | 1347 +++++++
 drivers/firmware/cirrus/test/cs_dsp_tests.c   |   14 +
 .../linux/firmware/cirrus/cs_dsp_test_utils.h |  160 +
 19 files changed, 17229 insertions(+), 2 deletions(-)
 create mode 100644 drivers/firmware/cirrus/test/Makefile
 create mode 100644 drivers/firmware/cirrus/test/cs_dsp_mock_bin.c
 create mode 100644 drivers/firmware/cirrus/test/cs_dsp_mock_mem_maps.c
 create mode 100644 drivers/firmware/cirrus/test/cs_dsp_mock_regmap.c
 create mode 100644 drivers/firmware/cirrus/test/cs_dsp_mock_utils.c
 create mode 100644 drivers/firmware/cirrus/test/cs_dsp_mock_wmfw.c
 create mode 100644 drivers/firmware/cirrus/test/cs_dsp_test_bin.c
 create mode 100644 drivers/firmware/cirrus/test/cs_dsp_test_bin_error.c
 create mode 100644 drivers/firmware/cirrus/test/cs_dsp_test_callbacks.c
 create mode 100644 drivers/firmware/cirrus/test/cs_dsp_test_control_cache.c
 create mode 100644 drivers/firmware/cirrus/test/cs_dsp_test_control_parse.c
 create mode 100644 drivers/firmware/cirrus/test/cs_dsp_test_control_rw.c
 create mode 100644 drivers/firmware/cirrus/test/cs_dsp_test_wmfw.c
 create mode 100644 drivers/firmware/cirrus/test/cs_dsp_test_wmfw_error.c
 create mode 100644 drivers/firmware/cirrus/test/cs_dsp_tests.c
 create mode 100644 include/linux/firmware/cirrus/cs_dsp_test_utils.h

Comments

Mark Brown Dec. 13, 2024, 6:27 p.m. UTC | #1
On Thu, 12 Dec 2024 14:37:13 +0000, Richard Fitzgerald wrote:
> This series adds KUnit tests for the cs_dsp module.
> 
> Most of the functionality in cs_dsp is for downloading firmware to
> DSP memory and interacting with "control" words defined in that
> memory. This doesn't require any emulation of running firmware,
> because it is only reading and writing registers. So the testing can
> be done using a dummy regmap. The way this is used to perform testing
> is described in more detail in the commit message for each test.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[01/12] firmware: cs_dsp: Add mock regmap for KUnit testing
        commit: d54a3fc6bf3db0db0e16cfdf7f48a8bbb803f6b0
[02/12] firmware: cs_dsp: Add mock DSP memory map for KUnit testing
        commit: 41e78c0f44f97c958afcda3f82b23f4f4a05b968
[03/12] firmware: cs_dsp: Add mock wmfw file generator for KUnit testing
        commit: 5cf1b7b471803f7cc654a29ee16cb085ad69c097
[04/12] firmware: cs_dsp: Add mock bin file generator for KUnit testing
        commit: 7c052c6615297ff32032105130cd5f02059f7ae4
[05/12] firmware: cs_dsp: Add KUnit testing of bin file download
        commit: dd0b6b1f29b92202d03a6d2dd7d65ecead27941a
[06/12] firmware: cs_dsp: Add KUnit testing of wmfw download
        commit: a2b2f2c1cd2a8b21c23bd1ec33131d2266c7568a
[07/12] firmware: cs_dsp: Add KUnit testing of control parsing
        commit: 83baecd92e7c2a44ac963fab8fd4476c71e19ddd
[08/12] firmware: cs_dsp: Add KUnit testing of control cache
        commit: 9b33a4fc500cedc1adc9c0ee01e30ffd50e5887a
[09/12] firmware: cs_dsp: Add KUnit testing of control read/write
        commit: fe54fd5474f746f07f2b587f2f5e3311bf611970
[10/12] firmware: cs_dsp: Add KUnit testing of bin error cases
        commit: cd8c058499b65e8605cd3c387bb1f76e2954870e
[11/12] firmware: cs_dsp: Add KUnit testing of wmfw error cases
        commit: feb5fb0615f321ab514f4fbbab777f3591f7e4b5
[12/12] firmware: cs_dsp: Add KUnit testing of client callbacks
        commit: 75a4a6ef615e2f4e9458051641f185498273ce02

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark