On Fri, 2024-08-23 at 13:27 -0700, Bart Van Assche wrote: > > External email : Please do not click links or open attachments until > you have verified the sender or the content. > On 8/22/24 7:57 PM, Peter Wang (王信友) wrote: > > You assume that the following steps are executed in sequence. > > (Theread A) send ufshcd_uic_pwr_ctrl > > (ISR) UIC_POWER_MODE A > > clear hab->active_uic_cmd > > (ISR) UIC_COMMAND_COMPL A (step A) > > do nothing > > (Thread B) ufshcd_send_uic_cmd set hab->active_uic_cmd (step B) > > (ISR) UIC_COMMAND_COMPL B > > complte thread B's cmd > > > > But actually step A ISR may come after step B and cause error. > > > > (Theread A) send ufshcd_uic_pwr_ctrl > > (ISR) UIC_POWER_MODE A > > clear hab->active_uic_cmd > > (Thread B) ufshcd_send_uic_cmd set hab->active_uic_cmd (step B) > > (ISR) UIC_COMMAND_COMPL A (step A) > > complete Thread A cmd > > Hi Peter, > > Can you please take a look at the fix I proposed in my reply to Bao? > > Thanks, > > Bart. > Hi Bart, In this case, I suggest use a vendor hooks ufshcd_vops_hibern8_notify. When hibernate enter pre-change, disable UIC_COMMAND_COMPL interrupt to prevent enable UIC_COMMAND_COMPL after hibernate enter. When hibernate exit post-change, enable UIC_COMMAND_COMPL interrupt. If it works, it won't modify the native kernel code, nor will it require adding a quirk. It would simply use a vendor hook as a workaround, without violating GKI, right? Thanks Peter