diff options
author | Seema Khowala <seemaj@nvidia.com> | 2018-12-27 22:23:06 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2019-03-18 14:30:16 -0400 |
commit | e00804594b83781bc9f7c17ac68cd9c5dd30953c (patch) | |
tree | f687d4da54c3b2afc867b8fcdde12bf8489f95f3 /drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |
parent | 0c47ce7d72e4c95ca293a222e2462f52683838a3 (diff) |
gpu: nvgpu: remove gk20a_is_channel_marked_as_tsg
Use tsg_gk20a_from_ch to get tsg pointer for tsgid of a channel. For
invalid tsgid, tsg pointer will be NULL
Bug 2092051
Bug 2429295
Bug 2484211
Change-Id: I82cd6a2dc5fab4acb147202af667ca97a2842a73
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2006722
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
(cherry picked from commit 13f37f9c70b9ae2e0d179830cded93a0a6f86494
in dev-kernel)
Reviewed-on: https://git-master.nvidia.com/r/2025507
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/fifo_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index f12c78f8..f4b96b7a 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |||
@@ -2154,11 +2154,15 @@ int gk20a_fifo_tsg_unbind_channel_verify_status(struct channel_gk20a *ch) | |||
2154 | int gk20a_fifo_tsg_unbind_channel(struct channel_gk20a *ch) | 2154 | int gk20a_fifo_tsg_unbind_channel(struct channel_gk20a *ch) |
2155 | { | 2155 | { |
2156 | struct gk20a *g = ch->g; | 2156 | struct gk20a *g = ch->g; |
2157 | struct fifo_gk20a *f = &g->fifo; | 2157 | struct tsg_gk20a *tsg = tsg_gk20a_from_ch(ch); |
2158 | struct tsg_gk20a *tsg = &f->tsg[ch->tsgid]; | ||
2159 | int err; | 2158 | int err; |
2160 | bool tsg_timedout = false; | 2159 | bool tsg_timedout = false; |
2161 | 2160 | ||
2161 | if (tsg == NULL) { | ||
2162 | nvgpu_err(g, "chid: %d is not bound to tsg", ch->chid); | ||
2163 | return 0; | ||
2164 | } | ||
2165 | |||
2162 | /* If one channel in TSG times out, we disable all channels */ | 2166 | /* If one channel in TSG times out, we disable all channels */ |
2163 | nvgpu_rwsem_down_write(&tsg->ch_list_lock); | 2167 | nvgpu_rwsem_down_write(&tsg->ch_list_lock); |
2164 | tsg_timedout = gk20a_channel_check_timedout(ch); | 2168 | tsg_timedout = gk20a_channel_check_timedout(ch); |
@@ -2188,6 +2192,7 @@ int gk20a_fifo_tsg_unbind_channel(struct channel_gk20a *ch) | |||
2188 | /* Remove channel from TSG and re-enable rest of the channels */ | 2192 | /* Remove channel from TSG and re-enable rest of the channels */ |
2189 | nvgpu_rwsem_down_write(&tsg->ch_list_lock); | 2193 | nvgpu_rwsem_down_write(&tsg->ch_list_lock); |
2190 | nvgpu_list_del(&ch->ch_entry); | 2194 | nvgpu_list_del(&ch->ch_entry); |
2195 | ch->tsgid = NVGPU_INVALID_TSG_ID; | ||
2191 | nvgpu_rwsem_up_write(&tsg->ch_list_lock); | 2196 | nvgpu_rwsem_up_write(&tsg->ch_list_lock); |
2192 | 2197 | ||
2193 | /* | 2198 | /* |
@@ -3485,9 +3490,7 @@ int gk20a_fifo_update_runlist_locked(struct gk20a *g, u32 runlist_id, | |||
3485 | Otherwise, keep active list untouched for suspend/resume. */ | 3490 | Otherwise, keep active list untouched for suspend/resume. */ |
3486 | if (chid != FIFO_INVAL_CHANNEL_ID) { | 3491 | if (chid != FIFO_INVAL_CHANNEL_ID) { |
3487 | ch = &f->channel[chid]; | 3492 | ch = &f->channel[chid]; |
3488 | if (gk20a_is_channel_marked_as_tsg(ch)) { | 3493 | tsg = tsg_gk20a_from_ch(ch); |
3489 | tsg = &f->tsg[ch->tsgid]; | ||
3490 | } | ||
3491 | 3494 | ||
3492 | if (add) { | 3495 | if (add) { |
3493 | if (test_and_set_bit(chid, | 3496 | if (test_and_set_bit(chid, |