diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2016-04-07 08:50:50 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-05-03 12:01:20 -0400 |
commit | caed43e0a208d87dd2c1788a74897072422b89a8 (patch) | |
tree | c8fae4fbb4fc3f7d6d137d072e2df2ad822d36aa | |
parent | fb7c8c756c9aa207d76d8316c3482a306b36596a (diff) |
gpu: nvgpu: return from worker if gpu is not up
During GPU shutdown path, it is possible that we
shut down the GPU while worker thread is still
running gk20a_channel_update()
Hence before accessing gp_put/get, check if GPU
is up or not
Bug 200166139
Change-Id: Iba3ec173041a84527c4700a93f20564a842cfb01
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/935193
(cherry picked from commit c81ea5fe383c44e872754b363968af57d84225ac)
Reviewed-on: http://git-master/r/1121917
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index a7f8005b..d94e12a2 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -1871,6 +1871,11 @@ static void gk20a_channel_clean_up_jobs(struct work_struct *work) | |||
1871 | if (!c) | 1871 | if (!c) |
1872 | return; | 1872 | return; |
1873 | 1873 | ||
1874 | if (!c->g->power_on) { /* shutdown case */ | ||
1875 | gk20a_channel_put(c); | ||
1876 | return; | ||
1877 | } | ||
1878 | |||
1874 | vm = c->vm; | 1879 | vm = c->vm; |
1875 | g = c->g; | 1880 | g = c->g; |
1876 | platform = gk20a_get_platform(g->dev); | 1881 | platform = gk20a_get_platform(g->dev); |
@@ -1951,6 +1956,11 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed) | |||
1951 | if (!c) | 1956 | if (!c) |
1952 | return; | 1957 | return; |
1953 | 1958 | ||
1959 | if (!c->g->power_on) { /* shutdown case */ | ||
1960 | gk20a_channel_put(c); | ||
1961 | return; | ||
1962 | } | ||
1963 | |||
1954 | update_gp_get(c->g, c); | 1964 | update_gp_get(c->g, c); |
1955 | wake_up(&c->submit_wq); | 1965 | wake_up(&c->submit_wq); |
1956 | 1966 | ||