On 9/10/24 5:34 AM, Peter Wang (王信友) wrote:
On Mon, 2024-09-09 at 16:11 -0700, Bart Van Assche wrote:
Simplify __ufshcd_send_uic_cmd() by always initializing the
uic_cmd::done completion. This is fine since the time required to
initialize a completion is small compared to the time required to
process an UIC command.
The time to compare should not be with the UIC command process time.
It should be compared with the time for the "if (completion)"
conditional
expression. We cannot justify increasing the latency of sending a UIC
command just because the UIC command process time is longer.
Although I appreciate your concern about performance, I don't think that
the above feedback is appropriate. On my test setup UIC commands take
between 20 and 1500 microseconds to complete. A single init_completion()
call takes about 0.01 microseconds. So I don't think that the time spent
in init_completion() matters for UIC commands. Additionally, this patch
only introduces an init_completion() call for power management commands
and not any other type of UIC command.
Thanks,
Bart.