Skip to content

PCI: Initial KUnit test fixture for resource assignment

Naveen Naidu linux-kernel-mentees linux-pci lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest1 patch 1 replyIn review
  2. v31 patch 1 replySuperseded
  3. v21 patch 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch0 repliesSuperseded

Changes in v4 from the cover letter

- Fix datatypes of the global variables and the fields of data structures.
- Fix code formatting

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1PCI: Add KUnit tests for __pci_read_base()drivers/pci/Kconfig drivers/pci/Makefile drivers/pci/pci-read-base-test.c+802 -01 reply

Reviews trailers per patch

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

Read the v4 thread

Cover letter [PATCH v4 0/1] PCI: Initial KUnit test fixture for resource assignment

Currently it's hard to deubg issues in the resource assignment code of the PCI because of the long reproduction cycles between the developer trying to fix the code and the user testing it due to the lack of hardware device with the developer [1].

[1]:
https://lore.kernel.org/all/20210621123714.GA3286648@bjorn-Precision-5520/

Bjorn, suggested that it would be really good if we could have a test fixture for debugging/testing resource assignment.

The patch attached along with the cover letter is an attempt to lay the foundation and also have a proof of concept to show that it is possible to have a test fixture to debug the resource assignment code.

Since there are a lot of things which happens during the resource assignement phase, the first version only tests the __pci_read_base() function since that was the most easiest to set up.

Hopefully, in the future patches I'll be able to write more KUnit tests for the other parts responsible during the resource assignment phase and get closer to the goal of having a complete test fixtures :)

Thanks,
Naveen

Changelog
=========
v4:
- Fix datatypes of the global variables and the fields of data structures.
- Fix code formatting
v3:
- Rename init_registers to init_test_registers
v2:
- Add test cases to test resource assignment for Type 1 devices
- Fix a error (a function was not static) found by Kernel Test Robot

Naveen Naidu (1):
[PATCH v4 1/1] PCI: Add KUnit tests for __pci_read_base()

 drivers/pci/Kconfig              |   4 +
 drivers/pci/Makefile             |   3 +
 drivers/pci/pci-read-base-test.c | 795 +++++++++++++++++++++++++++++++
 3 files changed, 802 insertions(+)
 create mode 100644 drivers/pci/pci-read-base-test.c
Signature · 1 line
2.25.1