]> www.infradead.org Git - users/jedix/linux-maple.git/commit
of/unittest: Add empty dma-ranges address translation tests
authorAndrea della Porta <andrea.porta@suse.com>
Sun, 24 Nov 2024 10:05:36 +0000 (11:05 +0100)
committerRob Herring (Arm) <robh@kernel.org>
Wed, 27 Nov 2024 15:18:04 +0000 (09:18 -0600)
commit1a75e81baf4f1b322f3498ffd373eaada8e60589
tree33c4ec49f77e491eab0a8b5907099d892115eb05
parentbc7acc0bd0f94c26bc0defc902311794a3d0fae9
of/unittest: Add empty dma-ranges address translation tests

Intermediate DT PCI nodes dynamically generated by enabling
CONFIG_PCI_DYNAMIC_OF_NODES have empty dma-ranges property. PCI address
specifiers have 3 cells and when dma-ranges is missing or empty,
of_translate_one() is currently dropping the flag portion of PCI addresses
which are subnodes of the aforementioned ones, failing the translation.
Add new tests covering this case.

With this test, we get 1 new failure which is fixed in subsequent
commit:

FAIL of_unittest_pci_empty_dma_ranges():1245 for_each_of_pci_range wrong CPU addr (ffffffffffffffff) on node /testcase-data/address-tests2/pcie@d1070000/pci@0,0/dev@0,0/local-bus@0

Signed-off-by: Andrea della Porta <andrea.porta@suse.com>
Link: https://lore.kernel.org/r/08f8fee4fdc0379240fda2f4a0e6f11ebf9647a8.1732441813.git.andrea.porta@suse.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
drivers/of/unittest-data/tests-address.dtsi
drivers/of/unittest.c