gpu: nvgpu: Increase PBDMA timeout
Terje Bergstrom [Fri, 15 Aug 2014 07:44:51 +0000 (10:44 +0300)]
PBDMA timeout can cause stale data in FIFO. Default value equals 1ms.
Increase it to max.

Bug 1537636

Change-Id: I1c6c6b10abaece3a64b77b9b3ef77ff726ff67cf
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/457047
(cherry picked from commit f516652f567a44e2e1c6313dccd3dc80172a980f)
Reviewed-on: http://git-master/r/457067
(cherry picked from commit f5219cf5888502de3f6cabb2db3e8968b6d20b7c)
Reviewed-on: http://git-master/r/504534
Reviewed-by: Automatic_Commit_Validation_User

drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
drivers/gpu/nvgpu/gk20a/hw_pbdma_gk20a.h

index a5174b4..c1a04ce 100644 (file)
@@ -417,6 +417,13 @@ int gk20a_init_fifo_reset_enable_hw(struct gk20a *g)
                        fifo_fb_timeout_period_max_f());
        gk20a_writel(g, fifo_fb_timeout_r(), timeout);
 
+       for (i = 0; i < pbdma_timeout__size_1_v(); i++) {
+               timeout = gk20a_readl(g, pbdma_timeout_r(i));
+               timeout = set_field(timeout, pbdma_timeout_period_m(),
+                                   pbdma_timeout_period_max_f());
+               gk20a_writel(g, pbdma_timeout_r(i), timeout);
+       }
+
        if (tegra_platform_is_silicon()) {
                timeout = gk20a_readl(g, fifo_pb_timeout_r());
                timeout &= ~fifo_pb_timeout_detection_enabled_f();
index 6b353a0..79d8cf2 100644 (file)
@@ -106,6 +106,22 @@ static inline u32 pbdma_gp_put_r(u32 i)
 {
        return 0x00040000 + i*8192;
 }
+static inline u32 pbdma_timeout_r(u32 i)
+{
+       return 0x0004012c + i*8192;
+}
+static inline u32 pbdma_timeout__size_1_v(void)
+{
+       return 0x00000001;
+}
+static inline u32 pbdma_timeout_period_m(void)
+{
+       return 0xffffffff << 0;
+}
+static inline u32 pbdma_timeout_period_max_f(void)
+{
+       return 0xffffffff;
+}
 static inline u32 pbdma_pb_fetch_r(u32 i)
 {
        return 0x00040054 + i*8192;