-
Notifications
You must be signed in to change notification settings - Fork 617
os/arch/arm/src/amebasmart: fix sem_timedwait(&g_read_cmd_done) not b… #6994
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
3ba2295 to
2b988ce
Compare
2b988ce to
ed10313
Compare
ed10313 to
313e0ab
Compare
…eing called 1. change condition from receive_cmd_done flag to MIPI_LPTX_IS_READ, resolve the issue when rx isr is called earlier than sem_timedwait. 2. re-initialize semaphore when timeout happen.
313e0ab to
bdf7f99
Compare
seokhun-eom24
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.
How about enabling the MIPI interrupt when the transfer starts and disabling it when it finishes?
In the current changes, the reason for calling sem_init in the Fail_case is to initialize the semaphore after a timedwait timeout so that it cannot be consumed later.
However, this still does not prevent a situation where an ISR occurs after the semaphore is initialized and performs a post.
Also, if we do it this way, I think send_cmd_done and receive_cmd_done become unnecessary, so please review this approach.
This PR addresses a potential issue that could arise on timeout; even if it isn’t merged quickly, I’d like to proceed in a way that fully resolves the problem.
Currently, when we switch to cmd mode to send cmd, we are enabling the interrupt, and disable it after switch to video mode. static void rtl8730e_mipi_mode_switch(mipi_mode_t mode)
{
if (mode == CMD_MODE) {
mipi_mode_switch_to_video(false);
MIPI_DSI_INT_Config(MIPI, DISABLE, ENABLE, FALSE);
LCDC_INTConfig(pLCDC, LCDC_BIT_DMA_UN_INTEN, DISABLE);
DelayMs(140);
} else {
MIPI_DSI_INT_Config(MIPI, DISABLE, DISABLE, FALSE);
LCDC_INTConfig(pLCDC, LCDC_BIT_DMA_UN_INTEN, ENABLE);
mipi_mode_switch_to_video(true);
}
}and it will be disable at the end of cmd sent if the msg->type == MIPI_DSI_END_OF_TRANSMISSION..
|
How about moving the interrupt enable/disable that operates when the mode changes to the point where the transfer occurs? Doing this would, as mentioned earlier, resolve issues such as an ISR firing after semaphore initialization, and allow us to match each transfer with its ISR one‑to‑one without using Please share your thoughts on this approach. |
For send cmd, i think it can be done since each send will correspond to a send cmd done isr. But for read cmd, it will trigger minimum two isr, when to disable the irq?
|
I think it should be disabled after reading the cmd ISR. This PR's final implementation goals are
|
Right now i think they are already paired with the help of 'send_cmd_done' and 'receive_cmd_done'. how about below code when timeout |
…eing called