[PATCH 5/5] lib: utils/suspend: add Andes ATCSMU suspend driver
Ben Zong-You Xie
ben717 at andestech.com
Sun Feb 22 19:53:47 PST 2026
> >
> > - ae350_non_ret_save(sbi_scratch_thishart_ptr());
> > ae350_disable_coherency();
> > wfi();
> > - return 0;
> > +
> > + /* Light sleep resumes here */
> > + ae350_enable_coherency();
> > +
> > + return SBI_ENOTSUPP;
>
> I just skimmed this patch really fast, so I probably missed something,
> but it seems odd to return SBI_ENOTSUPP here.
>
> Thanks,
> drew
Hi Drew,
The reason for returning SBI_ENOTSUPP here is to satisfy the logic in
sbi_hsm_exit(). In sbi_hsm_exit(), there is a specific check:
if (hsm_device_has_hart_hotplug()) {
if (hsm_device_hart_stop() != SBI_ENOTSUPP)
goto fail_exit;
}
/**
* As platform is lacking support for hotplug, directly jump to warmboot
* and wait for interrupts in warmboot. We do it preemptively in order
* preserve the hart states and reuse the code path for hotplug.
*/
jump_warmboot();
If we return 0 (SBI_OK), the condition (0 != SBI_ENOTSUPP) evaluates to
true, and the code jumps to fail_exit, hanging the hart.
Returning SBI_ENOTSUPP allows the execution to fall through to the
jump_warmboot() path, which is the intended behavior for 'light sleep'
on AE350 platform.
More information about the opensbi
mailing list