gpu: nvgpu: add channel.clear gops

- Add channel.clear gops for nvgpu-next.
- Do not return error if hw_state.next is set and channel.clear is not
NULL.

Bug 200650602
Bug 3109773

Change-Id: I4252691e4557351899e6fb9d85934e2d72517a36
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2414211
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Vedashree Vidwans
2020-09-15 16:47:02 -07:00
committed by Alex Waterman
parent 7b7f42bd33
commit b2ff527d15
2 changed files with 16 additions and 2 deletions

View File

@@ -178,6 +178,10 @@ static int nvgpu_tsg_unbind_channel_common(struct nvgpu_tsg *tsg,
}
}
if (g->ops.channel.clear != NULL) {
g->ops.channel.clear(ch);
}
/* Channel should be seen as TSG channel while updating runlist */
err = nvgpu_channel_update_runlist(ch, false);
if (err != 0) {
@@ -296,12 +300,21 @@ int nvgpu_tsg_unbind_channel_check_hw_state(struct nvgpu_tsg *tsg,
struct gk20a *g = ch->g;
struct nvgpu_channel_hw_state hw_state;
nvgpu_rwsem_down_read(&tsg->ch_list_lock);
g->ops.channel.read_state(g, ch, &hw_state);
nvgpu_rwsem_up_read(&tsg->ch_list_lock);
if (hw_state.next) {
nvgpu_err(g, "Channel %d to be removed from TSG %d has NEXT set!",
if (g->ops.channel.clear != NULL) {
nvgpu_log_info(g, "Channel %d to be removed "
"from TSG %d has NEXT set!",
ch->chid, ch->tsgid);
return -EINVAL;
} else {
nvgpu_err(g, "Channel %d to be removed "
"from TSG %d has NEXT set!",
ch->chid, ch->tsgid);
return -EINVAL;
}
}
if (g->ops.tsg.unbind_channel_check_ctx_reload != NULL) {

View File

@@ -141,6 +141,7 @@ struct gops_channel {
void (*abort_clean_up)(struct nvgpu_channel *ch);
void (*reset_faulted)(struct gk20a *g, struct nvgpu_channel *ch,
bool eng, bool pbdma);
void (*clear)(struct nvgpu_channel *ch);
#ifdef CONFIG_NVGPU_KERNEL_MODE_SUBMIT
int (*set_syncpt)(struct nvgpu_channel *ch);