-
Notifications
You must be signed in to change notification settings - Fork 619
Moving pm_idle to kernel #7053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Moving pm_idle to kernel #7053
Conversation
os/kernel/sched/sched_cpuoff.c
Outdated
| int sched_cpuoff(int cpu, bool migrate) | ||
| { | ||
| if(spin_trylock(&g_cpuhp_lock[cpu]) == SP_LOCKED) { | ||
| slldbg("CPU state change is already in progress\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if there is a race condition between spin_trylock() and spin_lock()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The locks are taken in same order and released in same order from both the APIs. We don't think there can be race condition.
os/kernel/sched/sched_cpuoff.c
Outdated
| ret = up_cpu_off(cpu); | ||
| } else { | ||
| slldbg("CPU is already off\n"); | ||
| ret = -EBUSY; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns -EBUSY when CPU is already off, but in sched_cpuon() it returns -EBUSY when CPU is already on. This is inconsistent - should probably return -EINVAL or a more appropriate error code for "already in desired state".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EBUSY is changed to ENOTSUP to signify that the CPU is already in desired state and therefore operation is not supported.
0390857 to
9ea8e01
Compare
| @@ -0,0 +1,30 @@ | |||
| ########################################################################### | |||
| # | |||
| # Copyright 2019 Samsung Electronics All Rights Reserved. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2025
| @@ -0,0 +1,30 @@ | |||
| ########################################################################### | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please seperate this commit to new PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am modifying this PR to include only pm_idle move changes, will raise another PR for the scheduler modifications
9ea8e01 to
fecd8a3
Compare
sunghan-chang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vivek1-j @singh-aditya-04
Is this a valid PR? Please follow our commit rules. The title for commit and PR is not matched. I don't get what this is.
Could you let me know why? |
| #include <tinyara/clock.h> | ||
| #include <tinyara/irq.h> | ||
| #include <tinyara/arch.h> | ||
| #include "../kernel/sched/sched.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check here
fecd8a3 to
d7734d9
Compare
|
@vivek1-j There is no update on my queries. Could you let me get replies for them? |
d7734d9 to
84dbdc5
Compare
In this PR we have moved PM Idle function from os/pm to os/kernel power directories.
At present we have moved the code as it is.