On 8/22/24 1:54 PM, Bao D. Nguyen wrote:
I am just curious about providing workaround for a hardware issue in the ufs core driver. Sometimes I notice the community is not accepting such a change and push the change to be implemented in the vendor/platform drivers.
There are two reasons why I propose to implement this workaround as a change for the UFS driver core: - I am not aware of any way to implement the behavior change in a vendor driver without modifying the UFS driver core. - The workaround results in a simplification of the UFS driver core code. More lines are removed from the UFS driver than added. Although it would be possible to select whether the old or the new behavior is selected by introducing yet another host controller quirk, I prefer not to do that because it would make the UFSHCI driver even more complex.
In your proposed change to ufshcd_uic_cmd_compl(), you are signalling both complete(&cmd->done) and complete(hba->uic_async_done) for a single ufshcd_uic_pwr_ctrl() command which can cause issues.
Please take another look at patch 2/2. With or without this patch applied, only hba->uic_async_done is signaled when a power mode UIC command completes. Thanks, Bart.