From a9c6f595399074e88c16f3557e5acb29db1d52d5 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Mon, 4 Jan 2016 10:28:04 -0800 Subject: gpu: nvgpu: enable semaphore acquire timeout It'll detect dead semaphore acquire. The worst case is when ACQUIRE_SWITCH is disabled, semaphore acquire will poll and consume full gpu timeslicees. The timeout value is set to half of channel WDT. Bug 1636800 Change-Id: Ida6ccc534006a191513edf47e7b82d4b5b758684 Signed-off-by: Richard Zhao Reviewed-on: http://git-master/r/928827 GVS: Gerrit_Virtual_Submit Reviewed-by: Vladislav Buzov --- drivers/gpu/nvgpu/gm20b/hw_pbdma_gm20b.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gm20b/hw_pbdma_gm20b.h') diff --git a/drivers/gpu/nvgpu/gm20b/hw_pbdma_gm20b.h b/drivers/gpu/nvgpu/gm20b/hw_pbdma_gm20b.h index c03a377a..19b3bc44 100644 --- a/drivers/gpu/nvgpu/gm20b/hw_pbdma_gm20b.h +++ b/drivers/gpu/nvgpu/gm20b/hw_pbdma_gm20b.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -262,14 +262,34 @@ static inline u32 pbdma_acquire_retry_exp_2_f(void) { return 0x100; } +static inline u32 pbdma_acquire_timeout_exp_f(u32 v) +{ + return (v & 0xf) << 11; +} +static inline u32 pbdma_acquire_timeout_exp_max_v(void) +{ + return 0x0000000f; +} static inline u32 pbdma_acquire_timeout_exp_max_f(void) { return 0x7800; } +static inline u32 pbdma_acquire_timeout_man_f(u32 v) +{ + return (v & 0xffff) << 15; +} +static inline u32 pbdma_acquire_timeout_man_max_v(void) +{ + return 0x0000ffff; +} static inline u32 pbdma_acquire_timeout_man_max_f(void) { return 0x7fff8000; } +static inline u32 pbdma_acquire_timeout_en_enable_f(void) +{ + return 0x80000000; +} static inline u32 pbdma_acquire_timeout_en_disable_f(void) { return 0x0; -- cgit v1.2.2