summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Zhao <rizhao@nvidia.com>2018-01-26 14:44:12 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-31 05:40:48 -0500
commitb386768d323c95f530dd28b695927426e52fe0dc (patch)
treeb6facabb206b8d7e5dbc471512c71db2eb35f245
parenta9644aa4435a72e5c7e768f85ffb98802940cab4 (diff)
gpu: nvgpu: make .tsg_unbind_channel one layer lower
The message to tell RM server to unbind channel has to be sent after client unbinds the channel and before client calls tsg release. The channel has to belong to a tsg on RM server before client submit a runlist to remove the channel. Or there's a bare channel problem. By moving .tsg_unbind_channl one layer lower, gk20a_tsg_unbind_channel() will be common functions for all chip, and it'll call tsg release after call .tsg_unbind_channel. So vgpu won't need to worry about tsg was released before sending msg to RM server. Bug 200382695 Bug 200382785 Change-Id: I32acc122f3f9d5d0628049ccf673225f9e90c87a Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1645383 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/tsg_vgpu.c4
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/tsg_gk20a.c4
-rw-r--r--drivers/gpu/nvgpu/gm20b/hal_gm20b.c4
-rw-r--r--drivers/gpu/nvgpu/gp106/hal_gp106.c2
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c2
-rw-r--r--drivers/gpu/nvgpu/gv100/hal_gv100.c2
-rw-r--r--drivers/gpu/nvgpu/gv11b/hal_gv11b.c2
8 files changed, 11 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/tsg_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/tsg_vgpu.c
index 06f52177..19987f0c 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/tsg_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/tsg_vgpu.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -119,7 +119,7 @@ int vgpu_tsg_unbind_channel(struct channel_gk20a *ch)
119 119
120 gk20a_dbg_fn(""); 120 gk20a_dbg_fn("");
121 121
122 err = gk20a_tsg_unbind_channel(ch); 122 err = gk20a_fifo_tsg_unbind_channel(ch);
123 if (err) 123 if (err)
124 return err; 124 return err;
125 125
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 2949c426..07863ac7 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -349,7 +349,7 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force)
349 if (!nvgpu_is_enabled(g, NVGPU_DRIVER_IS_DYING)) { 349 if (!nvgpu_is_enabled(g, NVGPU_DRIVER_IS_DYING)) {
350 /* abort channel and remove from runlist */ 350 /* abort channel and remove from runlist */
351 if (gk20a_is_channel_marked_as_tsg(ch)) { 351 if (gk20a_is_channel_marked_as_tsg(ch)) {
352 err = g->ops.fifo.tsg_unbind_channel(ch); 352 err = gk20a_tsg_unbind_channel(ch);
353 if (err) 353 if (err)
354 nvgpu_err(g, 354 nvgpu_err(g,
355 "failed to unbind channel %d from TSG", 355 "failed to unbind channel %d from TSG",
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
index 19d0ecce..ccb456cf 100644
--- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"), 5 * copy of this software and associated documentation files (the "Software"),
@@ -150,7 +150,7 @@ int gk20a_tsg_unbind_channel(struct channel_gk20a *ch)
150 struct tsg_gk20a *tsg = &g->fifo.tsg[ch->tsgid]; 150 struct tsg_gk20a *tsg = &g->fifo.tsg[ch->tsgid];
151 int err; 151 int err;
152 152
153 err = gk20a_fifo_tsg_unbind_channel(ch); 153 err = g->ops.fifo.tsg_unbind_channel(ch);
154 if (err) { 154 if (err) {
155 nvgpu_err(g, "Channel %d unbind failed, tearing down TSG %d", 155 nvgpu_err(g, "Channel %d unbind failed, tearing down TSG %d",
156 ch->chid, tsg->tsgid); 156 ch->chid, tsg->tsgid);
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
index 8a5c1278..47f666de 100644
--- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GM20B Graphics 2 * GM20B Graphics
3 * 3 *
4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"), 7 * copy of this software and associated documentation files (the "Software"),
@@ -427,7 +427,7 @@ static const struct gpu_ops gm20b_ops = {
427 .handle_pbdma_intr_0 = gk20a_fifo_handle_pbdma_intr_0, 427 .handle_pbdma_intr_0 = gk20a_fifo_handle_pbdma_intr_0,
428 .handle_pbdma_intr_1 = gk20a_fifo_handle_pbdma_intr_1, 428 .handle_pbdma_intr_1 = gk20a_fifo_handle_pbdma_intr_1,
429 .tsg_bind_channel = gk20a_tsg_bind_channel, 429 .tsg_bind_channel = gk20a_tsg_bind_channel,
430 .tsg_unbind_channel = gk20a_tsg_unbind_channel, 430 .tsg_unbind_channel = gk20a_fifo_tsg_unbind_channel,
431#ifdef CONFIG_TEGRA_GK20A_NVHOST 431#ifdef CONFIG_TEGRA_GK20A_NVHOST
432 .alloc_syncpt_buf = gk20a_fifo_alloc_syncpt_buf, 432 .alloc_syncpt_buf = gk20a_fifo_alloc_syncpt_buf,
433 .free_syncpt_buf = gk20a_fifo_free_syncpt_buf, 433 .free_syncpt_buf = gk20a_fifo_free_syncpt_buf,
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c
index 7a57672e..edf1be37 100644
--- a/drivers/gpu/nvgpu/gp106/hal_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c
@@ -487,7 +487,7 @@ static const struct gpu_ops gp106_ops = {
487 .handle_pbdma_intr_0 = gk20a_fifo_handle_pbdma_intr_0, 487 .handle_pbdma_intr_0 = gk20a_fifo_handle_pbdma_intr_0,
488 .handle_pbdma_intr_1 = gk20a_fifo_handle_pbdma_intr_1, 488 .handle_pbdma_intr_1 = gk20a_fifo_handle_pbdma_intr_1,
489 .tsg_bind_channel = gk20a_tsg_bind_channel, 489 .tsg_bind_channel = gk20a_tsg_bind_channel,
490 .tsg_unbind_channel = gk20a_tsg_unbind_channel, 490 .tsg_unbind_channel = gk20a_fifo_tsg_unbind_channel,
491#ifdef CONFIG_TEGRA_GK20A_NVHOST 491#ifdef CONFIG_TEGRA_GK20A_NVHOST
492 .alloc_syncpt_buf = gk20a_fifo_alloc_syncpt_buf, 492 .alloc_syncpt_buf = gk20a_fifo_alloc_syncpt_buf,
493 .free_syncpt_buf = gk20a_fifo_free_syncpt_buf, 493 .free_syncpt_buf = gk20a_fifo_free_syncpt_buf,
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
index eb3d1f9d..0fd983a2 100644
--- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
@@ -460,7 +460,7 @@ static const struct gpu_ops gp10b_ops = {
460 .handle_pbdma_intr_0 = gk20a_fifo_handle_pbdma_intr_0, 460 .handle_pbdma_intr_0 = gk20a_fifo_handle_pbdma_intr_0,
461 .handle_pbdma_intr_1 = gk20a_fifo_handle_pbdma_intr_1, 461 .handle_pbdma_intr_1 = gk20a_fifo_handle_pbdma_intr_1,
462 .tsg_bind_channel = gk20a_tsg_bind_channel, 462 .tsg_bind_channel = gk20a_tsg_bind_channel,
463 .tsg_unbind_channel = gk20a_tsg_unbind_channel, 463 .tsg_unbind_channel = gk20a_fifo_tsg_unbind_channel,
464#ifdef CONFIG_TEGRA_GK20A_NVHOST 464#ifdef CONFIG_TEGRA_GK20A_NVHOST
465 .alloc_syncpt_buf = gk20a_fifo_alloc_syncpt_buf, 465 .alloc_syncpt_buf = gk20a_fifo_alloc_syncpt_buf,
466 .free_syncpt_buf = gk20a_fifo_free_syncpt_buf, 466 .free_syncpt_buf = gk20a_fifo_free_syncpt_buf,
diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c
index 418ff45e..22e07288 100644
--- a/drivers/gpu/nvgpu/gv100/hal_gv100.c
+++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c
@@ -500,7 +500,7 @@ static const struct gpu_ops gv100_ops = {
500 .deinit_eng_method_buffers = 500 .deinit_eng_method_buffers =
501 gv11b_fifo_deinit_eng_method_buffers, 501 gv11b_fifo_deinit_eng_method_buffers,
502 .tsg_bind_channel = gk20a_tsg_bind_channel, 502 .tsg_bind_channel = gk20a_tsg_bind_channel,
503 .tsg_unbind_channel = gk20a_tsg_unbind_channel, 503 .tsg_unbind_channel = gk20a_fifo_tsg_unbind_channel,
504#ifdef CONFIG_TEGRA_GK20A_NVHOST 504#ifdef CONFIG_TEGRA_GK20A_NVHOST
505 .alloc_syncpt_buf = gv11b_fifo_alloc_syncpt_buf, 505 .alloc_syncpt_buf = gv11b_fifo_alloc_syncpt_buf,
506 .free_syncpt_buf = gv11b_fifo_free_syncpt_buf, 506 .free_syncpt_buf = gv11b_fifo_free_syncpt_buf,
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
index e4e9323b..97660917 100644
--- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
@@ -524,7 +524,7 @@ static const struct gpu_ops gv11b_ops = {
524 .deinit_eng_method_buffers = 524 .deinit_eng_method_buffers =
525 gv11b_fifo_deinit_eng_method_buffers, 525 gv11b_fifo_deinit_eng_method_buffers,
526 .tsg_bind_channel = gk20a_tsg_bind_channel, 526 .tsg_bind_channel = gk20a_tsg_bind_channel,
527 .tsg_unbind_channel = gk20a_tsg_unbind_channel, 527 .tsg_unbind_channel = gk20a_fifo_tsg_unbind_channel,
528#ifdef CONFIG_TEGRA_GK20A_NVHOST 528#ifdef CONFIG_TEGRA_GK20A_NVHOST
529 .alloc_syncpt_buf = gv11b_fifo_alloc_syncpt_buf, 529 .alloc_syncpt_buf = gv11b_fifo_alloc_syncpt_buf,
530 .free_syncpt_buf = gv11b_fifo_free_syncpt_buf, 530 .free_syncpt_buf = gv11b_fifo_free_syncpt_buf,