Nvidia card may come with a "phantom" UCSI device, and its driver gets
stuck in probe routine, prevents any system PM operations like suspend.
There's an unaccounted case that the target time can equal to jiffies in
gpu_i2c_check_status(), let's solve that by using readl_poll_timeout()
instead of jiffies comparison functions.
Fixes: c71bcdcb42a7 ("i2c: add i2c bus driver for NVIDIA GPU")
Suggested-by: Andy Shevchenko <email address hidden>
Signed-off-by: Kai-Heng Feng <email address hidden>
Reviewed-by: Andy Shevchenko <email address hidden>
Reviewed-by: Ajay Gupta <email address hidden>
Tested-by: Ajay Gupta <email address hidden>
Signed-off-by: Wolfram Sang <email address hidden>
(cherry picked from commit d944b27df121e2ee854a6c2fad13d6c6300792d4 linux-next)
Signed-off-by: Kai-Heng Feng <email address hidden>
Signed-off-by: Timo Aaltonen <email address hidden>
It returns -NODEV at the first selftest timeout, so the retry logic
doesn't work. Move the return outside of the while loop to make it real
retry 5 times before returns -ENODEV.
BTW, the origin loop will retry 6 times, also fix this.
Signed-off-by: You-Sheng Yang <email address hidden>
(backported from
https://<email address hidden>/)
Signed-off-by: Timo Aaltonen <email address hidden>