diff --git a/lib/utils/ipi/aclint_mswi.c b/lib/utils/ipi/aclint_mswi.c index f47b3bcb..140a49b5 100644 --- a/lib/utils/ipi/aclint_mswi.c +++ b/lib/utils/ipi/aclint_mswi.c @@ -101,8 +101,13 @@ int aclint_mswi_cold_init(struct aclint_mswi_data *mswi) /* Update MSWI pointer in scratch space */ for (i = 0; i < mswi->hart_count; i++) { scratch = sbi_hartid_to_scratch(mswi->first_hartid + i); + /* + * We don't need to fail if scratch pointer is not available + * because we might be dealing with hartid of a HART disabled + * in the device tree. + */ if (!scratch) - return SBI_ENOENT; + continue; mswi_set_hart_data_ptr(scratch, mswi); } diff --git a/lib/utils/timer/aclint_mtimer.c b/lib/utils/timer/aclint_mtimer.c index 13af5d82..271e6252 100644 --- a/lib/utils/timer/aclint_mtimer.c +++ b/lib/utils/timer/aclint_mtimer.c @@ -219,8 +219,13 @@ int aclint_mtimer_cold_init(struct aclint_mtimer_data *mt, /* Update MTIMER pointer in scratch space */ for (i = 0; i < mt->hart_count; i++) { scratch = sbi_hartid_to_scratch(mt->first_hartid + i); + /* + * We don't need to fail if scratch pointer is not available + * because we might be dealing with hartid of a HART disabled + * in the device tree. + */ if (!scratch) - return SBI_ENOENT; + continue; mtimer_set_hart_data_ptr(scratch, mt); }