const struct sbi_domain *dom,
u32 hartid, ulong saddr, ulong smode, ulong arg1)
{
- unsigned long init_count;
+ unsigned long init_count, entry_count;
unsigned int hstate;
struct sbi_scratch *rscratch;
struct sbi_hsm_data *hdata;
return SBI_EINVAL;
init_count = sbi_init_count(hartid);
+ entry_count = sbi_entry_count(hartid);
+
rscratch->next_arg1 = arg1;
rscratch->next_addr = saddr;
rscratch->next_mode = smode;
goto err;
}
- if (hsm_device_has_hart_hotplug() ||
+ if ((hsm_device_has_hart_hotplug() && (entry_count == init_count)) ||
(hsm_device_has_hart_secondary_boot() && !init_count)) {
rc = hsm_device_hart_start(hartid, scratch->warmboot_addr);
} else {