diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-08-25 18:38:57 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-01-31 13:33:47 -0500 |
commit | 4bd9682c924d4e10e715f9f271a1e7461f9c1f59 (patch) | |
tree | b033f434d7d86211cb586e8a59c4bc95cb4e4ab0 /drivers/gpu/nvgpu/gk20a | |
parent | 5fb7f2a262d2e9e187d8bcc4fb2ceb945fec9f8d (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')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c | 25 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.h | 6 |
3 files changed, 26 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 16acc1c9..a2fb8dc8 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -933,7 +933,7 @@ int gk20a_pm_finalize_poweron(struct device *dev) | |||
933 | if (g->ops.clk.disable_slowboot) | 933 | if (g->ops.clk.disable_slowboot) |
934 | g->ops.clk.disable_slowboot(g); | 934 | g->ops.clk.disable_slowboot(g); |
935 | 935 | ||
936 | gk20a_reset_priv_ring(g); | 936 | gk20a_enable_priv_ring(g); |
937 | 937 | ||
938 | /* TBD: move this after graphics init in which blcg/slcg is enabled. | 938 | /* TBD: move this after graphics init in which blcg/slcg is enabled. |
939 | This function removes SlowdownOnBoot which applies 32x divider | 939 | This function removes SlowdownOnBoot which applies 32x divider |
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 | ||
27 | void gk20a_reset_priv_ring(struct gk20a *g) | 27 | void 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 | ||
48 | static 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 | |||
48 | void gk20a_priv_ring_isr(struct gk20a *g) | 69 | void gk20a_priv_ring_isr(struct gk20a *g) |
49 | { | 70 | { |
50 | u32 status0, status1; | 71 | u32 status0, status1; |
diff --git a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.h b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.h index cb9d49c7..8a6320d7 100644 --- a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.h | |||
@@ -1,9 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/video/tegra/host/gk20a/priv_ring_gk20a.h | ||
3 | * | ||
4 | * GK20A PRIV ringmaster | 2 | * GK20A PRIV ringmaster |
5 | * | 3 | * |
6 | * Copyright (c) 2011-2012, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved. |
7 | * | 5 | * |
8 | * 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 |
9 | * under the terms and conditions of the GNU General Public License, | 7 | * under the terms and conditions of the GNU General Public License, |
@@ -21,7 +19,7 @@ | |||
21 | #ifndef __PRIV_RING_GK20A_H__ | 19 | #ifndef __PRIV_RING_GK20A_H__ |
22 | #define __PRIV_RING_GK20A_H__ | 20 | #define __PRIV_RING_GK20A_H__ |
23 | 21 | ||
24 | void gk20a_reset_priv_ring(struct gk20a *g); | 22 | void gk20a_enable_priv_ring(struct gk20a *g); |
25 | void gk20a_priv_ring_isr(struct gk20a *g); | 23 | void gk20a_priv_ring_isr(struct gk20a *g); |
26 | 24 | ||
27 | #endif /*__PRIV_RING_GK20A_H__*/ | 25 | #endif /*__PRIV_RING_GK20A_H__*/ |