mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
As the docs of nvgpu_thread say, each thread (which the worker loop is) should wake up and check also nvgpu_thread_should_stop() to manage graceful and quick exit as requested. The loop does have that check already, but the workqueue condition does not, so the cond wait might end up waiting until its timeout hits. It's not robust to trust the worker users to have a swift timeout for exiting the thread, so read the should-stop flag in the wakeup condition too. Simplify the clk arb worker ops now that calling nvgpu_worker_should_stop from there is no longer necessary. (Other worker users did not have those, so they were technically buggy.) Change-Id: I5409b8037564d4b6445a15cdbd4f1f3d616c4083 Signed-off-by: Konsta Hölttä <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2635808 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: svcacv <svcacv@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit