drivers/pm: pm_smp remove sched_lock

all os-api those have post/wait feature will not allowed in pm_callbacks
and pm_handler, until we support by cpu/tcb sched_lock and add
sched_lock/unlock back here. Then should revert this commit.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
This commit is contained in:
buxiasen 2024-09-29 15:22:23 +08:00 committed by Xiang Xiao
parent 6db1e6504c
commit 731af5b42f
1 changed files with 4 additions and 2 deletions

View File

@ -146,10 +146,11 @@ void pm_idle(pm_idle_handler_t handler)
/* If sched lock before irq save, and irq handler do post, scheduler will
* be delayed after WFI until next sched unlock. which is not acceptable.
* per cpu sched_lock/unlock is not available here, all post/wait api will
* not allow in pm_callbacks.
*/
flags = up_irq_save();
sched_lock();
oldstate = pm_querystate(domain);
newstate = pm_checkstate(domain);
@ -200,10 +201,11 @@ void pm_idle(pm_idle_handler_t handler)
/* If there is pending irq, enable irq make handlers finish all
* execution will be better decrease scheduler context switch times.
* per cpu sched_lock/unlock is not available here, all post/wait api will
* not allow in pm_callbacks.
*/
up_irq_restore(flags);
sched_unlock();
}
#else