]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:07:26 +0000 (10:07 +0100)
commit6cc523c1ba7edfdddb7ffa12feed2295eb8a6ceb
tree39bbd53c6604b88e69c5efb0c6ba6c91d4e286df
parent82f27fd04df6516eacfad05b9eac34151ff64f35
hwmon: (bt1-pvt) Wait for the completion with timeout

[ Upstream commit 0ffd21d5985506d164ada9e8fff6daae8ef469a1 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/bt1-pvt.c