diff options
author | Supriya <ssharatkumar@nvidia.com> | 2017-11-02 02:24:03 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-12-28 06:01:48 -0500 |
commit | ea1b69d3f5e419ab1e66340779fda143e8f4ebc3 (patch) | |
tree | 9c07bc5e9efab1f781bb28d07a89598469948f2a /drivers/gpu/nvgpu/common/linux | |
parent | 3a956a573d2ecb9a7520680ec6bcd6f626054488 (diff) |
gpu: nvgpu: Fix crash on read fail of mc_boot_0_r
This CL handles
- erroneous use of boot_0 function pointer
before being assigned in __nvgpu_check_gpu_state
- And proper handling of error returned from gk20a_readl
in gk20a_mc_boot_0
With these fixes crash is not seen in case mc_boot_0 read
returns 0 in gk20a_mc_boot_0
- And also this handles the recursion caused by mc.boot_0()
calling nvgpu_readl and nvgpu_readl in turn
calling mc.boot_0 in case of read failure
Bug 2010966
Change-Id: Ia087811c67d88948b7fc5fff35e0fabc6ea91989
Signed-off-by: Supriya <ssharatkumar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1616274
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/io.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/io.c b/drivers/gpu/nvgpu/common/linux/io.c index 729825e7..cde90ddd 100644 --- a/drivers/gpu/nvgpu/common/linux/io.c +++ b/drivers/gpu/nvgpu/common/linux/io.c | |||
@@ -33,6 +33,16 @@ void nvgpu_writel(struct gk20a *g, u32 r, u32 v) | |||
33 | 33 | ||
34 | u32 nvgpu_readl(struct gk20a *g, u32 r) | 34 | u32 nvgpu_readl(struct gk20a *g, u32 r) |
35 | { | 35 | { |
36 | u32 v = __nvgpu_readl(g, r); | ||
37 | |||
38 | if (v == 0xffffffff) | ||
39 | __nvgpu_check_gpu_state(g); | ||
40 | |||
41 | return v; | ||
42 | } | ||
43 | |||
44 | u32 __nvgpu_readl(struct gk20a *g, u32 r) | ||
45 | { | ||
36 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); | 46 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); |
37 | u32 v = 0xffffffff; | 47 | u32 v = 0xffffffff; |
38 | 48 | ||
@@ -41,8 +51,6 @@ u32 nvgpu_readl(struct gk20a *g, u32 r) | |||
41 | gk20a_dbg(gpu_dbg_reg, "r=0x%x v=0x%x (failed)", r, v); | 51 | gk20a_dbg(gpu_dbg_reg, "r=0x%x v=0x%x (failed)", r, v); |
42 | } else { | 52 | } else { |
43 | v = readl(l->regs + r); | 53 | v = readl(l->regs + r); |
44 | if (v == 0xffffffff) | ||
45 | __nvgpu_check_gpu_state(g); | ||
46 | gk20a_dbg(gpu_dbg_reg, "r=0x%x v=0x%x", r, v); | 54 | gk20a_dbg(gpu_dbg_reg, "r=0x%x v=0x%x", r, v); |
47 | } | 55 | } |
48 | 56 | ||