diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-05-01 14:12:12 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-05-03 14:05:18 -0400 |
commit | 5e33f58a5ee971cd846f9f2a41ed652a5f2b1523 (patch) | |
tree | 38a616a2b4ff4d80f6d196e417e0135bff9fc0f9 | |
parent | 162108d0706bb45cdff07c31ab1360935b396f67 (diff) |
gpu: nvgpu: Move ch_wdt_timeout to gk20a
Copy watchdog timeout from platform structure to gk20a and use it
from gk20a.
JIRA NVGPU-16
Change-Id: Iab70253a7f0e1d28f2e3209285b3f4c476ce9279
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1473705
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/driver_common.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 7 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 1 |
3 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c index 34bd2062..14d4dd40 100644 --- a/drivers/gpu/nvgpu/common/linux/driver_common.c +++ b/drivers/gpu/nvgpu/common/linux/driver_common.c | |||
@@ -61,6 +61,8 @@ static void nvgpu_init_vars(struct gk20a *g) | |||
61 | 61 | ||
62 | static void nvgpu_init_timeout(struct gk20a *g) | 62 | static void nvgpu_init_timeout(struct gk20a *g) |
63 | { | 63 | { |
64 | struct gk20a_platform *platform = dev_get_drvdata(g->dev); | ||
65 | |||
64 | g->gr_idle_timeout_default = CONFIG_GK20A_DEFAULT_TIMEOUT; | 66 | g->gr_idle_timeout_default = CONFIG_GK20A_DEFAULT_TIMEOUT; |
65 | if (nvgpu_platform_is_silicon(g)) | 67 | if (nvgpu_platform_is_silicon(g)) |
66 | g->timeouts_enabled = true; | 68 | g->timeouts_enabled = true; |
@@ -68,6 +70,7 @@ static void nvgpu_init_timeout(struct gk20a *g) | |||
68 | g->gr_idle_timeout_default = GK20A_TIMEOUT_FPGA; | 70 | g->gr_idle_timeout_default = GK20A_TIMEOUT_FPGA; |
69 | g->timeouts_enabled = true; | 71 | g->timeouts_enabled = true; |
70 | } | 72 | } |
73 | g->ch_wdt_timeout_ms = platform->ch_wdt_timeout_ms; | ||
71 | } | 74 | } |
72 | 75 | ||
73 | static void nvgpu_init_timeslice(struct gk20a *g) | 76 | static void nvgpu_init_timeslice(struct gk20a *g) |
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index eafa17fb..8014fd8c 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -1377,8 +1377,7 @@ bool gk20a_channel_update_and_check_timeout(struct channel_gk20a *ch, | |||
1377 | 1377 | ||
1378 | static u32 gk20a_get_channel_watchdog_timeout(struct channel_gk20a *ch) | 1378 | static u32 gk20a_get_channel_watchdog_timeout(struct channel_gk20a *ch) |
1379 | { | 1379 | { |
1380 | struct gk20a_platform *platform = gk20a_get_platform(ch->g->dev); | 1380 | return ch->g->ch_wdt_timeout_ms; |
1381 | return platform->ch_wdt_timeout_ms; | ||
1382 | } | 1381 | } |
1383 | 1382 | ||
1384 | static u32 get_gp_free_count(struct channel_gk20a *c) | 1383 | static u32 get_gp_free_count(struct channel_gk20a *c) |
@@ -1490,9 +1489,7 @@ static void __gk20a_channel_timeout_start(struct channel_gk20a *ch) | |||
1490 | */ | 1489 | */ |
1491 | static void gk20a_channel_timeout_start(struct channel_gk20a *ch) | 1490 | static void gk20a_channel_timeout_start(struct channel_gk20a *ch) |
1492 | { | 1491 | { |
1493 | struct gk20a_platform *platform = gk20a_get_platform(ch->g->dev); | 1492 | if (!ch->g->timeouts_enabled || !gk20a_get_channel_watchdog_timeout(ch)) |
1494 | |||
1495 | if (!ch->g->timeouts_enabled || !platform->ch_wdt_timeout_ms) | ||
1496 | return; | 1493 | return; |
1497 | 1494 | ||
1498 | if (!ch->wdt_enabled) | 1495 | if (!ch->wdt_enabled) |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 74e2c688..c9a2ee93 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -976,6 +976,7 @@ struct gk20a { | |||
976 | #else | 976 | #else |
977 | bool timeouts_enabled; | 977 | bool timeouts_enabled; |
978 | #endif | 978 | #endif |
979 | unsigned int ch_wdt_timeout_ms; | ||
979 | 980 | ||
980 | struct nvgpu_mutex poweroff_lock; | 981 | struct nvgpu_mutex poweroff_lock; |
981 | 982 | ||