-
Notifications
You must be signed in to change notification settings - Fork 15
TimeoutLockless PCU agent #600
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
Conversation
Added 'hold' option to process_action function.
|
I added the 'hold' option to the socs/socs/agents/hwp_pcu/agent.py Lines 41 to 43 in 61d971f
|
|
Many thanks for updating the pcu agent! The pcu uses a relay module and I have defined |
|
Hi Junna, no problem! I do think reading the status from the relays instead of using the last sent command is very important. It will make the data from the agent a lot more trustworthy, especially in cases where:
I suggest we invest some time to understand why the |
|
I got the importance of reading the status. Although it takes a few minutes to obtain the correct status immediately after changing the operating mode, the response becomes stable thereafter. |
Strictly speaking, the new 'hold' operation mode doesn't hold the hwp. It just stops the motor from spinning the hwp.
Status 'failed' is obtained when relay_read apparently failed.
|
Thanks Junna, this is much better! Do you think we can log the "response" in the cases where it's failing so we can get a better idea why? Other than that I think this is fine to merge. It may be worth coming back later and figure out how to make get_status more reliable though. |
|
Actually, I was testting reliable get_status, and I could do it by the following script. I'm happy to implement more reliable get_status later. |
|
I guess the reason why the current get_status sometimes fails because there is exception for the I'm not sure if this is the best way, but following method in my script worked as long as I tested. |
|
@jlashner |
|
Hi kyohei, yep! Totally fine with merging this now and then figuring out remaining issues after vacation. Good luck! |
* PCU agent restructure * Adds back agg_param frame-length * Adds inline callback dec * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Debugged agent.py Added 'hold' option to process_action function. * Updated 'stop' phase definition * 'hold' is replaced with 'stop' Strictly speaking, the new 'hold' operation mode doesn't hold the hwp. It just stops the motor from spinning the hwp. * Update hwp_pcu.py -- added 'failed' to get_status responses Status 'failed' is obtained when relay_read apparently failed. * fix typo and docs * fix typo --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: jsugiyama <75608221+17-sugiyama@users.noreply.github.com> Co-authored-by: ykyohei <38639108+ykyohei@users.noreply.github.com>
I realize it may not have been clear what I was saying about restructuring the PCU agent to avoid timeout locks since we still don't have any examples, so thought I'd throw it into a branch here for people to see and use if they'd like.
Description
Restructure HWP PCU to use new lockless agent structure. I think this is a easier way to structure the agent, and should solve all of the issues that have to do with lock-acquisition, and generally make the agent more threadsafe.
Motivation and Context
Solves locking issues, and serves as an example for timeout lockless agents
How Has This Been Tested?
Not tested
Types of changes
Checklist: