Skip to content

Commit e68c861

Browse files
Sahil-Malpekarchetan-rathore
authored andcommitted
fix(pcie): handle NOT_IMPLEMENTED return from pal_get_msi_vectors
- Skip the test when pal_get_msi_vectors() is not implemented. - Preserve original behavior for zero and non-zero return values. Signed-off-by: Sahil Shakil Malpekar <Sahil.ShakilMalpekar@arm.com> Change-Id: Iea213a90eb8b359c9becc1cd0bcdbdf66109a40e
1 parent 46eb830 commit e68c861

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

test_pool/pcie/p046.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ payload (void)
8484
PERIPHERAL_VECTOR_LIST *dev_mvec, *mvec;
8585
uint64_t dev_bdf;
8686
uint32_t test_skip = 1;
87+
uint32_t ret;
8788

8889
if(!count) {
8990
val_set_status (index, RESULT_SKIP (TEST_NUM, 2));
@@ -104,11 +105,15 @@ payload (void)
104105
if (dev_bdf) {
105106
val_print (ACS_PRINT_INFO, " Checking PCI device with BDF %4X\n", dev_bdf);
106107
/* Read MSI(X) vectors */
107-
if (val_get_msi_vectors(dev_bdf, &dev_mvec) == NOT_IMPLEMENTED) {
108+
ret = val_get_msi_vectors (dev_bdf, &dev_mvec);
109+
110+
if (ret == NOT_IMPLEMENTED) {
108111
val_print(ACS_PRINT_ERR,
109-
"\n pal_get_msi_vectors is unimplemented, Skipping test.", 0);
112+
"\n pal_get_msi_vectors is unimplemented, Skipping test.", 0);
110113
goto test_skip_unimplemented;
111-
} else {
114+
}
115+
116+
if (ret) {
112117
test_skip = 0;
113118
mvec = dev_mvec;
114119
while(mvec) {

test_pool/pcie/p097.c

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ payload (void)
128128
uint32_t bdf, dp_type;
129129
uint32_t class_code;
130130
uint32_t base_cc;
131+
uint32_t ret;
131132
status = 0;
132133

133134
bdf_tbl_ptr = val_pcie_bdf_table_ptr();
@@ -166,11 +167,15 @@ payload (void)
166167
continue;
167168
}
168169

169-
if (val_get_msi_vectors(current_dev_bdf, &current_dev_mvec) == NOT_IMPLEMENTED) {
170+
ret = val_get_msi_vectors (current_dev_bdf, &current_dev_mvec);
171+
172+
if (ret == NOT_IMPLEMENTED) {
170173
val_print(ACS_PRINT_ERR,
171-
"\n pal_get_msi_vectors is unimplemented, Skipping test.", 0);
174+
"\n pal_get_msi_vectors is unimplemented, Skipping test.", 0);
172175
goto test_skip_unimplemented;
173-
} else {
176+
}
177+
178+
if (ret) {
174179
tbl_index_next = tbl_index + 1;
175180
while (tbl_index_next < bdf_tbl_ptr->num_entries && !status)
176181
{
@@ -209,11 +214,15 @@ payload (void)
209214
}
210215

211216
/* Read MSI(X) vectors */
212-
if (val_get_msi_vectors(next_dev_bdf, &next_dev_mvec) == NOT_IMPLEMENTED) {
217+
ret = val_get_msi_vectors (next_dev_bdf, &next_dev_mvec);
218+
219+
if (ret == NOT_IMPLEMENTED) {
213220
val_print(ACS_PRINT_ERR,
214-
"\n pal_get_msi_vectors is unimplemented, Skipping test.", 0);
221+
"\n pal_get_msi_vectors is unimplemented, Skipping test.", 0);
215222
goto test_skip_unimplemented;
216-
} else {
223+
}
224+
225+
if (ret) {
217226
test_skip = 0;
218227
/* Compare two lists of MSI(X) vectors */
219228
if (check_list_duplicates (current_dev_mvec, next_dev_mvec))

test_pool/peripherals/d004.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ payload_check_io_coherent_dma_mem_attribute(void)
182182
return;
183183

184184
test_skip_unimplemented:
185-
val_set_status(index, RESULT_SKIP(TEST_NUM, 2));
185+
val_set_status(index, RESULT_SKIP(TEST_NUM1, 2));
186186
}
187187

188188
uint32_t

0 commit comments

Comments
 (0)