diff options
author | sujeet baranwal <sbaranwal@nvidia.com> | 2015-03-26 20:51:11 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2015-06-06 10:25:36 -0400 |
commit | 85d0bc498d8329717fe5b0d947b8458e38ff0982 (patch) | |
tree | c35565b75cea5515054bab4abffd4e81a46fe78b /drivers/gpu | |
parent | 5e85069f4f4f1f9849fcba02829c802cb1849618 (diff) |
gpu: nvgpu: Correction in allow_all flag usage
The allow_all flag is used to avoid any kind of register's
offset being validate when called through regops. but the
current implementation was flawed. It printed error messages
and set the status of each operation invalid, even when
allow_all was set.
Change-Id: Ie5a70a3cdc2368715731cf1c9cd771fdcf6b0d57
Signed-off-by: sujeet baranwal <sbaranwal@nvidia.com>
Reviewed-on: http://git-master/r/723830
(cherry picked from commit 4483ef020ff5f0fabc83b1226376b02d42bd1d75)
Reviewed-on: http://git-master/r/753282
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/regops_gk20a.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c index b1c25ac9..1696f759 100644 --- a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c | |||
@@ -405,7 +405,8 @@ int exec_regops_gk20a(struct dbg_session_gk20a *dbg_s, | |||
405 | 405 | ||
406 | ok = validate_reg_ops(dbg_s, | 406 | ok = validate_reg_ops(dbg_s, |
407 | &ctx_rd_count, &ctx_wr_count, | 407 | &ctx_rd_count, &ctx_wr_count, |
408 | ops, num_ops) || g->allow_all; | 408 | ops, num_ops); |
409 | |||
409 | if (!ok) { | 410 | if (!ok) { |
410 | dev_err(dbg_s->dev, "invalid op(s)"); | 411 | dev_err(dbg_s->dev, "invalid op(s)"); |
411 | err = -EINVAL; | 412 | err = -EINVAL; |
@@ -678,6 +679,7 @@ static bool validate_reg_ops(struct dbg_session_gk20a *dbg_s, | |||
678 | u32 i; | 679 | u32 i; |
679 | int err; | 680 | int err; |
680 | bool ok = true; | 681 | bool ok = true; |
682 | struct gk20a *g = dbg_s->g; | ||
681 | 683 | ||
682 | /* keep going until the end so every op can get | 684 | /* keep going until the end so every op can get |
683 | * a separate error code if needed */ | 685 | * a separate error code if needed */ |
@@ -693,8 +695,11 @@ static bool validate_reg_ops(struct dbg_session_gk20a *dbg_s, | |||
693 | (*ctx_wr_count)++; | 695 | (*ctx_wr_count)++; |
694 | } | 696 | } |
695 | 697 | ||
696 | err = validate_reg_op_offset(dbg_s, &ops[i]); | 698 | /* if "allow_all" flag enabled, dont validate offset */ |
697 | ok &= !err; | 699 | if (!g->allow_all) { |
700 | err = validate_reg_op_offset(dbg_s, &ops[i]); | ||
701 | ok &= !err; | ||
702 | } | ||
698 | } | 703 | } |
699 | 704 | ||
700 | gk20a_dbg(gpu_dbg_gpu_dbg, "ctx_wrs:%d ctx_rds:%d", | 705 | gk20a_dbg(gpu_dbg_gpu_dbg, "ctx_wrs:%d ctx_rds:%d", |