summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-08-25 18:38:57 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-31 13:33:47 -0500
commit4bd9682c924d4e10e715f9f271a1e7461f9c1f59 (patch)
treeb033f434d7d86211cb586e8a59c4bc95cb4e4ab0 /drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
parent5fb7f2a262d2e9e187d8bcc4fb2ceb945fec9f8d (diff)
gpu: nvgpu: Reset priv ring properly on error
We did not follow the proper sequence to reset priv ring on error. Instead we just re-enabled priv ring, which does not reset anything. Rename the gk20a_reset_priv_ring() to gk20a_enable_priv_ring() to indicate its proper use. Add another gk20a_reset_priv_ring() which actually resets priv ring properly. Change-Id: Ied74465b1215daa447a565b7e9cafef7fbe67d1b Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1294681 Reviewed-by: Seema Khowala <seemaj@nvidia.com> Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
index d16c5fd1..420b65f1 100644
--- a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A priv ring 2 * GK20A priv ring
3 * 3 *
4 * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -24,7 +24,7 @@
24#include <nvgpu/hw/gk20a/hw_pri_ringmaster_gk20a.h> 24#include <nvgpu/hw/gk20a/hw_pri_ringmaster_gk20a.h>
25#include <nvgpu/hw/gk20a/hw_pri_ringstation_sys_gk20a.h> 25#include <nvgpu/hw/gk20a/hw_pri_ringstation_sys_gk20a.h>
26 26
27void gk20a_reset_priv_ring(struct gk20a *g) 27void gk20a_enable_priv_ring(struct gk20a *g)
28{ 28{
29 struct gk20a_platform *platform = dev_get_drvdata(g->dev); 29 struct gk20a_platform *platform = dev_get_drvdata(g->dev);
30 30
@@ -45,6 +45,27 @@ void gk20a_reset_priv_ring(struct gk20a *g)
45 45
46} 46}
47 47
48static void gk20a_reset_priv_ring(struct gk20a *g)
49{
50 u32 val;
51
52 gk20a_reset(g, mc_enable_priv_ring_enabled_f());
53
54 val = gk20a_readl(g, pri_ringstation_sys_decode_config_r());
55 val = set_field(val,
56 pri_ringstation_sys_decode_config_ring_m(),
57 pri_ringstation_sys_decode_config_ring_drop_on_ring_not_started_f());
58 gk20a_writel(g, pri_ringstation_sys_decode_config_r(), val);
59
60 gk20a_writel(g, pri_ringmaster_global_ctl_r(),
61 pri_ringmaster_global_ctl_ring_reset_asserted_f());
62 udelay(20);
63 gk20a_writel(g, pri_ringmaster_global_ctl_r(),
64 pri_ringmaster_global_ctl_ring_reset_deasserted_f());
65
66 gk20a_enable_priv_ring(g);
67}
68
48void gk20a_priv_ring_isr(struct gk20a *g) 69void gk20a_priv_ring_isr(struct gk20a *g)
49{ 70{
50 u32 status0, status1; 71 u32 status0, status1;