gpu: nvgpu: retry tsg unbind if NEXT is set

The NEXT bit can remain set for the channel if timeslice expires before
scheduler clears it. Due to this nvgpu fails TSG unbind and in turn
nvrm_gpu fails channel close. In this case, checking the channel hw
state after some time can help see NEXT bit cleared by scheduler.

Reenable the tsg and return -EAGAIN to nvrm_gpu for it to retry again.

Bug 3144960

Change-Id: I35f417f02270e371a4e632986b73a00f8a4f921a
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2468391
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Sagar Kamble
2021-01-10 22:35:00 +05:30
committed by mobile promotions
parent 35e28884ec
commit cf287a4ef5
25 changed files with 169 additions and 63 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -1274,7 +1274,7 @@ int test_runlist_update_locked(struct unit_module *m, struct gk20a *g,
0U, chA, false, false);
unit_assert(err == 0, goto done);
err = nvgpu_tsg_unbind_channel(tsg, chA);
err = nvgpu_tsg_force_unbind_channel(tsg, chA);
if (err != 0) {
unit_err(m, "Cannot unbind channel A\n");
}
@@ -1307,7 +1307,7 @@ done:
branches_str(branches, f_runlist_update));
}
err = nvgpu_tsg_unbind_channel(tsg, ch);
err = nvgpu_tsg_force_unbind_channel(tsg, ch);
if (err != 0) {
unit_err(m, "Cannot unbind channel\n");
}
@@ -1355,7 +1355,7 @@ done:
unit_err(m, "%s failed\n", __func__);
}
err = nvgpu_tsg_unbind_channel(tsg, ch);
err = nvgpu_tsg_force_unbind_channel(tsg, ch);
if (err != 0) {
unit_err(m, "Cannot unbind channel\n");
}