mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
In the current logic for nvgpu_timeout_expired(), function always returns 0 if fault injection is enabled. This only helps for testing timeout not expired scenarios. However, if nvgpu_timeout_expired() is used in a while(true) loop, it is impossible to break the infinite loop. This patch modifies nvgpu_timeout_expired() to not expire until fault injection counter is non-zero. The function will now return -ETIMEDOUT when fault injection is enabled and counter is zero. Jira NVGPU-4675 Change-Id: I494031698ade19cf1ec5b75e4dbe5a1157da2aa7 Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2275290 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Philip Elcan <pelcan@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>