diff options
author | Seema Khowala <seemaj@nvidia.com> | 2018-12-13 14:02:11 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2019-02-22 21:59:18 -0500 |
commit | c9d4df288d51e4776188a25a6a2bb26ddd897a20 (patch) | |
tree | de70d1fa9da9bd79e783d24db5953c74f5d15fb8 /drivers/gpu/nvgpu/common/fifo | |
parent | d975bda39876b288479ef5d72cb0495fe1c85c6b (diff) |
gpu: nvgpu: remove code for ch not bound to tsg
- Remove handling for channels that are no more bound to tsg
as channel could be referenceable but no more part of a tsg
- Use tsg_gk20a_from_ch to get pointer to tsg for a given channel
- Clear unhandled gr interrupts
Bug 2429295
JIRA NVGPU-1580
Change-Id: I9da43a2bc9a0282c793b9f301eaf8e8604f91d70
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1972492
(cherry picked from commit 013ca60edd97e7719e389b3048fed9b165277251
in dev-kernel)
Reviewed-on: https://git-master.nvidia.com/r/2018262
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Debarshi Dutta <ddutta@nvidia.com>
Tested-by: Debarshi Dutta <ddutta@nvidia.com>
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/common/fifo')
-rw-r--r-- | drivers/gpu/nvgpu/common/fifo/channel.c | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index cbffb6de..4b76dcdd 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c | |||
@@ -164,28 +164,26 @@ int gk20a_enable_channel_tsg(struct gk20a *g, struct channel_gk20a *ch) | |||
164 | { | 164 | { |
165 | struct tsg_gk20a *tsg; | 165 | struct tsg_gk20a *tsg; |
166 | 166 | ||
167 | if (gk20a_is_channel_marked_as_tsg(ch)) { | 167 | tsg = tsg_gk20a_from_ch(ch); |
168 | tsg = &g->fifo.tsg[ch->tsgid]; | 168 | if (tsg != NULL) { |
169 | g->ops.fifo.enable_tsg(tsg); | 169 | g->ops.fifo.enable_tsg(tsg); |
170 | return 0; | ||
170 | } else { | 171 | } else { |
171 | g->ops.fifo.enable_channel(ch); | 172 | return -EINVAL; |
172 | } | 173 | } |
173 | |||
174 | return 0; | ||
175 | } | 174 | } |
176 | 175 | ||
177 | int gk20a_disable_channel_tsg(struct gk20a *g, struct channel_gk20a *ch) | 176 | int gk20a_disable_channel_tsg(struct gk20a *g, struct channel_gk20a *ch) |
178 | { | 177 | { |
179 | struct tsg_gk20a *tsg; | 178 | struct tsg_gk20a *tsg; |
180 | 179 | ||
181 | if (gk20a_is_channel_marked_as_tsg(ch)) { | 180 | tsg = tsg_gk20a_from_ch(ch); |
182 | tsg = &g->fifo.tsg[ch->tsgid]; | 181 | if (tsg != NULL) { |
183 | g->ops.fifo.disable_tsg(tsg); | 182 | g->ops.fifo.disable_tsg(tsg); |
183 | return 0; | ||
184 | } else { | 184 | } else { |
185 | g->ops.fifo.disable_channel(ch); | 185 | return -EINVAL; |
186 | } | 186 | } |
187 | |||
188 | return 0; | ||
189 | } | 187 | } |
190 | 188 | ||
191 | void gk20a_channel_abort_clean_up(struct channel_gk20a *ch) | 189 | void gk20a_channel_abort_clean_up(struct channel_gk20a *ch) |
@@ -238,19 +236,8 @@ void gk20a_channel_abort(struct channel_gk20a *ch, bool channel_preempt) | |||
238 | 236 | ||
239 | if (tsg != NULL) { | 237 | if (tsg != NULL) { |
240 | return gk20a_fifo_abort_tsg(ch->g, tsg, channel_preempt); | 238 | return gk20a_fifo_abort_tsg(ch->g, tsg, channel_preempt); |
241 | } | 239 | } else { |
242 | 240 | nvgpu_err(ch->g, "chid: %d is not bound to tsg", ch->chid); | |
243 | /* make sure new kickoffs are prevented */ | ||
244 | gk20a_channel_set_timedout(ch); | ||
245 | |||
246 | ch->g->ops.fifo.disable_channel(ch); | ||
247 | |||
248 | if (channel_preempt) { | ||
249 | ch->g->ops.fifo.preempt_channel(ch->g, ch); | ||
250 | } | ||
251 | |||
252 | if (ch->g->ops.fifo.ch_abort_clean_up) { | ||
253 | ch->g->ops.fifo.ch_abort_clean_up(ch); | ||
254 | } | 241 | } |
255 | } | 242 | } |
256 | 243 | ||