summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/fifo/tsg.c
diff options
context:
space:
mode:
authorPeter Daifuku <pdaifuku@nvidia.com>2020-01-30 13:58:54 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2020-02-22 07:24:36 -0500
commitea14973b149930669a8fe2aa37cdfad41759001d (patch)
tree37ede9e1280516550c3da4f28c3f43b6e42917df /drivers/gpu/nvgpu/common/fifo/tsg.c
parente1683ce076db48117cda56597238b90acdfe67cb (diff)
gpu: nvgpu: vgpu: fix tsg_unbind in recovery case
When unbinding a channel from a tsg when virtual, vgpu_tsg_unbind_channel would return an error if unbinding the channel on the guest side failed, and did so before notifying the RM server of the unbind. Later on in the recovery process, the guest OS would remove the channel from the TSG's list, but this would leave the RM server with an out-of-date channel list. Fix this by making the tsg_unbind_channel HAL optional and implemented only for vgpu: the vgpu version now just notifies the RM server so that it can clean up its version of the TSG; if vgpu, always call the tsg_unbind_channel HAL whether or not the local unbind succeeded. Minimal port from dev-main of https://git-master.nvidia.com/r/c/linux-nvgpu/+/2084029 Bug 2766920 Bug 200587845 Change-Id: I75bddf3a28ac20bf4fb7510ff64097a32c7eec3f Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2287774 (cherry picked from commit 471c72c1efcc4fe6d547f556edf7773827fd2674) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2289928 Reviewed-by: Thomas Steinle <tsteinle@nvidia.com> Reviewed-by: Satish Arora <satisha@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
Diffstat (limited to 'drivers/gpu/nvgpu/common/fifo/tsg.c')
-rw-r--r--drivers/gpu/nvgpu/common/fifo/tsg.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/fifo/tsg.c b/drivers/gpu/nvgpu/common/fifo/tsg.c
index 65cee225..f6c718f0 100644
--- a/drivers/gpu/nvgpu/common/fifo/tsg.c
+++ b/drivers/gpu/nvgpu/common/fifo/tsg.c
@@ -158,7 +158,7 @@ int gk20a_tsg_unbind_channel(struct channel_gk20a *ch)
158 return -EINVAL; 158 return -EINVAL;
159 } 159 }
160 160
161 err = g->ops.fifo.tsg_unbind_channel(ch); 161 err = gk20a_fifo_tsg_unbind_channel(ch);
162 if (err) { 162 if (err) {
163 nvgpu_err(g, "Channel %d unbind failed, tearing down TSG %d", 163 nvgpu_err(g, "Channel %d unbind failed, tearing down TSG %d",
164 ch->chid, tsg->tsgid); 164 ch->chid, tsg->tsgid);
@@ -172,6 +172,11 @@ int gk20a_tsg_unbind_channel(struct channel_gk20a *ch)
172 ch->tsgid = NVGPU_INVALID_TSG_ID; 172 ch->tsgid = NVGPU_INVALID_TSG_ID;
173 nvgpu_rwsem_up_write(&tsg->ch_list_lock); 173 nvgpu_rwsem_up_write(&tsg->ch_list_lock);
174 } 174 }
175
176 if (g->ops.fifo.tsg_unbind_channel != NULL) {
177 err = g->ops.fifo.tsg_unbind_channel(ch);
178 }
179
175 nvgpu_log(g, gpu_dbg_fn, "UNBIND tsg:%d channel:%d", 180 nvgpu_log(g, gpu_dbg_fn, "UNBIND tsg:%d channel:%d",
176 tsg->tsgid, ch->chid); 181 tsg->tsgid, ch->chid);
177 182