diff options
author | Gagan Grover <ggrover@nvidia.com> | 2016-03-28 08:09:39 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-04-15 15:40:28 -0400 |
commit | 571c62d45e4a72a7243e37bf5c586452f9608fd3 (patch) | |
tree | 0b789832498dd252510684c27153e5f2cb4aff07 | |
parent | 0e423669a4ff3f00b06d86f8ca251ef99f3671ce (diff) |
gpu: nvgpu: WARN_ON if NULL params in pmu_cmd_post
Don't need to BUG_ON. We can simply print kernel error message
along with call stack and return.
Bug 200182457
Change-Id: I06693f88372dfb5dd0dd2fae7630540594f302ba
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1115992
(cherry picked from commit f5cc88880e147f90d2cf9980db4322ee5fd613a6)
Reviewed-on: http://git-master/r/1117166
(cherry picked from commit ab0318b4a726886cd3e5ce97cf1a3bcaabab6171)
Reviewed-on: http://git-master/r/1119038
(cherry picked from commit 9b977073d11d7a1caa72994f750293b0e5076cef)
Reviewed-on: http://git-master/r/1127490
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 957537a9..6677798b 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | |||
@@ -3884,9 +3884,20 @@ int gk20a_pmu_cmd_post(struct gk20a *g, struct pmu_cmd *cmd, | |||
3884 | 3884 | ||
3885 | gk20a_dbg_fn(""); | 3885 | gk20a_dbg_fn(""); |
3886 | 3886 | ||
3887 | BUG_ON(!cmd); | 3887 | if ((!cmd) || (!seq_desc) || (!pmu->pmu_ready)) { |
3888 | BUG_ON(!seq_desc); | 3888 | if (!cmd) |
3889 | BUG_ON(!pmu->pmu_ready); | 3889 | gk20a_warn(dev_from_gk20a(g), |
3890 | "%s(): PMU cmd buffer is NULL", __func__); | ||
3891 | else if (!seq_desc) | ||
3892 | gk20a_warn(dev_from_gk20a(g), | ||
3893 | "%s(): Seq descriptor is NULL", __func__); | ||
3894 | else | ||
3895 | gk20a_warn(dev_from_gk20a(g), | ||
3896 | "%s(): PMU is not ready", __func__); | ||
3897 | |||
3898 | WARN_ON(1); | ||
3899 | return -EINVAL; | ||
3900 | } | ||
3890 | 3901 | ||
3891 | if (!pmu_validate_cmd(pmu, cmd, msg, payload, queue_id)) | 3902 | if (!pmu_validate_cmd(pmu, cmd, msg, payload, queue_id)) |
3892 | return -EINVAL; | 3903 | return -EINVAL; |