dart: Fix silent logic for dart_translate()

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2024-05-17 01:56:57 +09:00
parent 8c107bf80a
commit c83ad3fc4d

View file

@ -628,9 +628,10 @@ static void *dart_translate_internal(dart_dev_t *dart, uintptr_t iova, int silen
return NULL; return NULL;
} }
if (!(dart->l1[ttbr][l1_index] & DART_PTE_VALID) && !silent) { if (!(dart->l1[ttbr][l1_index] & DART_PTE_VALID)) {
printf("dart[%lx %u]: l1 translation failure %x %lx\n", dart->regs, dart->device, l1_index, if (!silent)
iova); printf("dart[%lx %u]: l1 translation failure %x %lx\n", dart->regs, dart->device,
l1_index, iova);
return NULL; return NULL;
} }
@ -638,9 +639,10 @@ static void *dart_translate_internal(dart_dev_t *dart, uintptr_t iova, int silen
u64 *l2 = (u64 *)(FIELD_GET(dart->params->offset_mask, dart->l1[ttbr][l1_index]) u64 *l2 = (u64 *)(FIELD_GET(dart->params->offset_mask, dart->l1[ttbr][l1_index])
<< DART_PTE_OFFSET_SHIFT); << DART_PTE_OFFSET_SHIFT);
if (!(l2[l2_index] & DART_PTE_VALID) && !silent) { if (!(l2[l2_index] & DART_PTE_VALID)) {
printf("dart[%lx %u]: l2 translation failure %x:%x %lx\n", dart->regs, dart->device, if (!silent)
l1_index, l2_index, iova); printf("dart[%lx %u]: l2 translation failure %x:%x %lx\n", dart->regs, dart->device,
l1_index, l2_index, iova);
return NULL; return NULL;
} }