]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
i2c: nvidia-gpu: Handle timeout correctly in gpu_i2c_check_status()
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Tue, 24 Mar 2020 15:28:11 +0000 (23:28 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 3 Apr 2020 13:17:23 +0000 (15:17 +0200)
commitbc60499e52b1584d84a0fea0ec684ab0b6d61d8e
tree9a45dffbdf53f0e62272ab77de770e15f7b191b4
parentffb9c344266eb4758a168dbc41d03fb47e2ce3d1
i2c: nvidia-gpu: Handle timeout correctly in gpu_i2c_check_status()

BugLink: https://bugs.launchpad.net/bugs/1870142
commit d944b27df121e2ee854a6c2fad13d6c6300792d4 upstream.

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 <andriy.shevchenko@linux.intel.com>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Ajay Gupta <ajayg@nvidia.com>
Tested-by: Ajay Gupta <ajayg@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
drivers/i2c/busses/i2c-nvidia-gpu.c