summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/fifo/channel.c
diff options
context:
space:
mode:
authorSeema Khowala <seemaj@nvidia.com>2018-10-17 17:23:38 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2019-02-13 16:19:41 -0500
commitf78918fd6c34cf7c73fd8dc98408a33bdd55ad1b (patch)
tree74c290fe7ee7d7412b551147a63381d541af3041 /drivers/gpu/nvgpu/common/fifo/channel.c
parent220860d04383489a8e75684802a2ced1323831df (diff)
gpu: nvgpu: do not suspend/resume recovered channel
Already torn down channels should not be suspended or resumed. A channel reference could still be available even if it is recovered but not closed. Use ch_timedout status to check if channel is already recovered/aborted. Bug 2404865 Change-Id: I718eab6032ee94a9322da7a239a978b388de2b01 Signed-off-by: Seema Khowala <seemaj@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1929338 Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> (cherry picked from commit 88cff206ae31999240945a870683e8a10be584d7 in dev-kernel) Reviewed-on: https://git-master.nvidia.com/r/2016994 GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> 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/channel.c')
-rw-r--r--drivers/gpu/nvgpu/common/fifo/channel.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c
index b5ae42d4..2ada3911 100644
--- a/drivers/gpu/nvgpu/common/fifo/channel.c
+++ b/drivers/gpu/nvgpu/common/fifo/channel.c
@@ -2291,7 +2291,13 @@ int gk20a_channel_suspend(struct gk20a *g)
2291 for (chid = 0; chid < f->num_channels; chid++) { 2291 for (chid = 0; chid < f->num_channels; chid++) {
2292 struct channel_gk20a *ch = gk20a_channel_from_id(g, chid); 2292 struct channel_gk20a *ch = gk20a_channel_from_id(g, chid);
2293 2293
2294 if (ch != NULL) { 2294 if (ch == NULL) {
2295 continue;
2296 }
2297 if (gk20a_channel_check_timedout(ch)) {
2298 nvgpu_log_info(g, "do not suspend recovered "
2299 "channel %d", chid);
2300 } else {
2295 nvgpu_log_info(g, "suspend channel %d", chid); 2301 nvgpu_log_info(g, "suspend channel %d", chid);
2296 /* disable channel */ 2302 /* disable channel */
2297 gk20a_disable_channel_tsg(g, ch); 2303 gk20a_disable_channel_tsg(g, ch);
@@ -2304,10 +2310,9 @@ int gk20a_channel_suspend(struct gk20a *g)
2304 2310
2305 channels_in_use = true; 2311 channels_in_use = true;
2306 2312
2307 active_runlist_ids |= BIT(ch->runlist_id); 2313 active_runlist_ids |= (u32) BIT64(ch->runlist_id);
2308
2309 gk20a_channel_put(ch);
2310 } 2314 }
2315 gk20a_channel_put(ch);
2311 } 2316 }
2312 2317
2313 if (channels_in_use) { 2318 if (channels_in_use) {
@@ -2317,7 +2322,13 @@ int gk20a_channel_suspend(struct gk20a *g)
2317 struct channel_gk20a *ch = gk20a_channel_from_id(g, chid); 2322 struct channel_gk20a *ch = gk20a_channel_from_id(g, chid);
2318 2323
2319 if (ch != NULL) { 2324 if (ch != NULL) {
2320 g->ops.fifo.unbind_channel(ch); 2325 if (gk20a_channel_check_timedout(ch)) {
2326 nvgpu_log_info(g, "do not unbind "
2327 "recovered channel %d",
2328 chid);
2329 } else {
2330 g->ops.fifo.unbind_channel(ch);
2331 }
2321 gk20a_channel_put(ch); 2332 gk20a_channel_put(ch);
2322 } 2333 }
2323 } 2334 }
@@ -2339,13 +2350,19 @@ int gk20a_channel_resume(struct gk20a *g)
2339 for (chid = 0; chid < f->num_channels; chid++) { 2350 for (chid = 0; chid < f->num_channels; chid++) {
2340 struct channel_gk20a *ch = gk20a_channel_from_id(g, chid); 2351 struct channel_gk20a *ch = gk20a_channel_from_id(g, chid);
2341 2352
2342 if (ch != NULL) { 2353 if (ch == NULL) {
2354 continue;
2355 }
2356 if (gk20a_channel_check_timedout(ch)) {
2357 nvgpu_log_info(g, "do not resume recovered "
2358 "channel %d", chid);
2359 } else {
2343 nvgpu_log_info(g, "resume channel %d", chid); 2360 nvgpu_log_info(g, "resume channel %d", chid);
2344 g->ops.fifo.bind_channel(ch); 2361 g->ops.fifo.bind_channel(ch);
2345 channels_in_use = true; 2362 channels_in_use = true;
2346 active_runlist_ids |= BIT(f->channel[chid].runlist_id); 2363 active_runlist_ids |= (u32) BIT64(ch->runlist_id);
2347 gk20a_channel_put(ch);
2348 } 2364 }
2365 gk20a_channel_put(ch);
2349 } 2366 }
2350 2367
2351 if (channels_in_use) { 2368 if (channels_in_use) {