hwmon: (bt1-pvt) Wait for the completion with timeout
authorSerge Semin <Sergey.Semin@baikalelectronics.ru>
Sun, 20 Sep 2020 11:09:23 +0000 (14:09 +0300)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 4 Oct 2020 15:40:10 +0000 (08:40 -0700)
commit0ffd21d5985506d164ada9e8fff6daae8ef469a1
tree68222da17209b478b421290265227fc657764fb7
parent0015503e5f6357f286bef34d039e43359fa4efd4
hwmon: (bt1-pvt) Wait for the completion with timeout

If the PVT sensor is suddenly powered down while a caller is waiting for
the conversion completion, the request won't be finished and the task will
hang up on this procedure until the power is back up again. Let's call the
wait_for_completion_timeout() method instead to prevent that. The cached
timeout is exactly what we need to predict for how long conversion could
normally last.

Fixes: 87976ce2825d ("hwmon: Add Baikal-T1 PVT sensor driver")
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Link: https://lore.kernel.org/r/20200920110924.19741-4-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/bt1-pvt.c