-
Notifications
You must be signed in to change notification settings - Fork 618
os/arch/arm/src/amebasmart: Fix I2S abort during PM suspend #6980
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?
Conversation
| i2s_pminitialize(); | ||
| #endif | ||
| #endif | ||
| #endif |
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 don't get why this is changed. Why is i2s pm under audio i2s?
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.
i2s can also be initialized in rtl8730e_syu645b_initialize.
So I think the previous conditional check that calling i2s_pminitialize when CONFIG_AMEBASMART_I2S is defined is correct.
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.
Since amebasmart_i2s_suspend() and amebasmart_i2s_resume() are based on port number, but currently when pmu_register_sleep_callback() is called, we do not pass in any param. Should we restructure i2s_pminitialize() place it in amebasmart_i2s_initialize() and called with port number pass in? So PM suspend and resume will be trigger based on i2s port which has been initialized?
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 think it would be a better design for to call i2s_pminitialize in amebasmart_i2s_initialize.
However, in that case we might need to invoke pmu_register_sleep_callback multiple times depending on the port, what do you think about it?
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.
Yes, that's what I planned to do. The callback will be triggered multiple times as well.
So pmu_register_sleep_callback() will be called during init, and pmu_unregister_sleep_callback() will be called during deinit. Is that okay?
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.
Ok, that looks good.
|
@ziyik build break on flat_dev_ddr |
4105318 to
8b0c489
Compare
8b0c489 to
45eff0f
Compare
45eff0f to
c00f7e6
Compare
|
I think the current changes have successfully achieved the purpose of the PR. However, I’m wondering that in the current implementation all I2S ports are managed by the PM using the same cycle. |
By doing so, it will have 2 I2S domains, is it? Currently, only one domain, BSP_I2S_DRV, and driver will handle all I2S ports. |
|
LGTM |
| #ifdef CONFIG_PM | ||
| i2s_pminitialize(); | ||
| #endif |
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.
How about revert it?
it's duplicated calling.
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.
This is the only place to register the PM domain for i2s.
If this is removed, no other place will register the domain.
I have checked, and it's okay to register 2 times. It will overwrite it.
This will ensure the PM domain is registered when i2s is initialized (without depending/checking which i2s port is initialized)
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.
@ziyik He asked revert, not remove. Previously, you called the i2s pm init at outside of the i2s init. It called the pm init once, but new change causes twice. We want to prevent duplicated calling. It needs all pm domain string comparison and unnecessary duplicated operation.
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.
In this case, I will need to revert rtl8730e_boot.c as well.
Otherwise, the PM domain will not be registered.
Is that okay?
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.
We believe that if we do not use I2S, it is appropriate not to register I2S-related PM as well.
However, in the current structure, I2S is not differentiated by port-specific PM, so we are currently registering I2S in PM and checking the initialization status of each port based on the presence of priv.
In this structure, it seems clearer for i2s_pminitialize() to be called from board_i2s_initialize(), which is the initialization process for I2S itself, rather than for each port.
Additionally, while the current code only allows overwriting, which does not cause issues with duplicate calls, it would be better to revert rather than allow duplicate calls, as understanding this history may be necessary for future modifications.
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.
Okay, got it.
I will revert the change, and since the PM sleep/resume has already added the check of the port initialization state (presence of priv), so it's fine.
-Check I2S stuct pointer during PM suspend and resume
c00f7e6 to
0df423f
Compare
-Check I2S stuct pointer during PM suspend and resume