From 6a8e93aceb2a6b9c78f38782b28941b7e05e27c0 Mon Sep 17 00:00:00 2001 From: Shanmuga Priya L Date: Wed, 6 May 2026 11:01:03 +0000 Subject: [PATCH] refactor(dma): update handling for missing DMA devices - Replace DEBUG/INFO logs with WARN when no DMA devices found - Improve log messages to clarify ACS detection limitations - Change result status from SKIP to WARNING for missing DMA cases Signed-off-by: Shanmuga Priya L Change-Id: If087fb8ef60454a74a25add4a342e3b25caa7753 --- test_pool/memory_map/m004.c | 19 ++++++++++++------- test_pool/pcie/p095.c | 8 +++++--- test_pool/pcie/p105.c | 8 +++++--- test_pool/peripherals/d004.c | 14 +++++++++----- val/src/acs_pcie.c | 2 +- 5 files changed, 32 insertions(+), 19 deletions(-) diff --git a/test_pool/memory_map/m004.c b/test_pool/memory_map/m004.c index 990f8e59..a613b12d 100644 --- a/test_pool/memory_map/m004.c +++ b/test_pool/memory_map/m004.c @@ -44,8 +44,10 @@ check_peripheral_dma_capability (void) pcie_bdf_list_t *pcie_peripherals_bdf_list = val_pcie_get_pcie_peripheral_bdf_list(); if (pcie_peripherals_bdf_list == NULL || pcie_peripherals_bdf_list->count == 0) { - val_print(DEBUG, "\n Skip as no peripherals detected "); - val_set_status(index, RESULT_SKIP(1)); + val_print(WARN, "\n ACS could not detect any PCIe peripherals with driver support."); + val_print(WARN, "\n if the system has peripherals devices, " + "manually review the rule."); + val_set_status(index, RESULT_WARNING(1)); return; } @@ -84,9 +86,10 @@ payload_check_dev_dma_if_behind_smmu (void) pcie_bdf_list_t *pcie_peripherals_bdf_list = val_pcie_get_pcie_peripheral_bdf_list(); if (pcie_peripherals_bdf_list == NULL || pcie_peripherals_bdf_list->count == 0) { - val_print(DEBUG, "\n Skip as no peripherals detected "); - val_set_status(index, RESULT_SKIP(1)); - return; + val_print(WARN, "\n ACS could not detect any PCIe peripherals with driver support."); + val_print(WARN, "\n if the system has peripherals devices, " + "manually review the rule."); + val_set_status(index, RESULT_WARNING(1)); } /* Check if a device is capable of accessing non secure address */ @@ -127,8 +130,10 @@ payload_check_if_non_dma_dev_behind_smmu (void) pcie_bdf_list_t *pcie_peripherals_bdf_list = val_pcie_get_pcie_peripheral_bdf_list(); if (pcie_peripherals_bdf_list == NULL || pcie_peripherals_bdf_list->count == 0) { - val_print(DEBUG, "\n Skip as no peripherals detected "); - val_set_status(index, RESULT_SKIP(1)); + val_print(WARN, "\n ACS could not detect any PCIe peripherals with driver support."); + val_print(WARN, "\n if the system has peripherals devices, " + "manually review the rule."); + val_set_status(index, RESULT_WARNING(1)); return; } diff --git a/test_pool/pcie/p095.c b/test_pool/pcie/p095.c index 9bb2dc0e..acc5e7b2 100644 --- a/test_pool/pcie/p095.c +++ b/test_pool/pcie/p095.c @@ -43,8 +43,10 @@ payload(void) target_dev_index = val_dma_get_info(DMA_NUM_CTRL, 0); if (!target_dev_index) { - val_print(DEBUG, "\n No DMA controllers detected... "); - val_set_status(index, RESULT_SKIP(1)); + val_print(WARN, "\n ACS could not detect any DMA-capable devices."); + val_print(WARN, "\n If the platform includes DMA-capable devices, " + "manual validation is required."); + val_set_status(index, RESULT_WARNING(1)); return; } @@ -81,7 +83,7 @@ payload(void) return; test_warn_unimplemented: - val_set_status(index, RESULT_WARNING(1)); + val_set_status(index, RESULT_WARNING(2)); } diff --git a/test_pool/pcie/p105.c b/test_pool/pcie/p105.c index 1a763830..9a025cc0 100644 --- a/test_pool/pcie/p105.c +++ b/test_pool/pcie/p105.c @@ -42,8 +42,10 @@ payload(void) target_dev_index = val_dma_get_info(DMA_NUM_CTRL, 0); if (!target_dev_index) { - val_print(DEBUG, "\n No DMA controllers detected... "); - val_set_status(index, RESULT_SKIP(1)); + val_print(WARN, "\n ACS could not detect any DMA-capable devices."); + val_print(WARN, "\n If the platform includes DMA-capable devices, " + "manual validation is required."); + val_set_status(index, RESULT_WARNING(1)); return; } @@ -82,7 +84,7 @@ payload(void) return; test_warn_unimplemented: - val_set_status(index, RESULT_WARNING(1)); + val_set_status(index, RESULT_WARNING(2)); } diff --git a/test_pool/peripherals/d004.c b/test_pool/peripherals/d004.c index dc3dd75b..8c206437 100644 --- a/test_pool/peripherals/d004.c +++ b/test_pool/peripherals/d004.c @@ -51,8 +51,10 @@ payload_check_dma_mem_attribute(void) if (!target_dev_index) { - val_print(INFO, "\n No DMA controllers detected... "); - val_set_status(index, RESULT_SKIP(1)); + val_print(WARN, "\n ACS could not detect any DMA-capable devices."); + val_print(WARN, "\n If the platform includes DMA-capable devices, " + "manual validation is required."); + val_set_status(index, RESULT_WARNING(1)); return; } @@ -107,7 +109,7 @@ payload_check_dma_mem_attribute(void) return; test_warn_unimplemented: - val_set_status(index, RESULT_WARNING(1)); + val_set_status(index, RESULT_WARNING(2)); } /* This test verifies I/O coherent DMA traffic must have the attribute @@ -130,8 +132,10 @@ payload_check_io_coherent_dma_mem_attribute(void) if (!target_dev_index) { - val_print(INFO, "\n No DMA controllers detected... "); - val_set_status(index, RESULT_SKIP(1)); + val_print(WARN, "\n ACS could not detect any DMA-capable devices."); + val_print(WARN, "\n If the platform includes DMA-capable devices, " + "manual validation is required."); + val_set_status(index, RESULT_WARNING(1)); return; } diff --git a/val/src/acs_pcie.c b/val/src/acs_pcie.c index 1367228d..1b83f8b4 100644 --- a/val/src/acs_pcie.c +++ b/val/src/acs_pcie.c @@ -2441,7 +2441,7 @@ pcie_bdf_list_t *val_pcie_get_pcie_peripheral_bdf_list(void) } if (!val_pcie_device_driver_present(dev_bdf)) { - val_print(DEBUG, "\n Driver not present for bdf 0x%x", dev_bdf); + val_print(WARN, "\n Driver not present for bdf 0x%x", dev_bdf); continue; }