gpu: nvgpu: add assert in nvgpu_writel_check

nvgpu_writel_check outputs dbg message if updated read value
does not match with requested write value. Change dbg message to
error message.
Use BUG_ON for write mismatch as failure to update h/w register
is a bug and tells s/w to either add fixed delay or use timeout
to check for updated register value.

JIRA NVGPU-5490

Change-Id: Ib11b7862d2990a56259d2f8c10d75c12c84bae5d
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2338004
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Seema Khowala
2020-05-01 22:10:31 -07:00
committed by Alex Waterman
parent e5b23f33b9
commit cfc5bac059
2 changed files with 6 additions and 3 deletions

View File

@@ -26,6 +26,7 @@
#include <include/nvgpu/posix/io.h>
#include <nvgpu/types.h>
#include <nvgpu/io.h>
#include <nvgpu/bug.h>
#include "common_io.h"
@@ -56,7 +57,7 @@ int test_writel_check(struct unit_module *m, struct gk20a *g, void *args)
/* Value 0 will force to fail readback call as read API returns
* NVGPU_READ_VAL. */
nvgpu_writel_check(g, USER_MODE_BASE, 0);
EXPECT_BUG(nvgpu_writel_check(g, USER_MODE_BASE, 0));
/* Value NVGPU_READ_VAL will pass the readback call as read API returns
* NVGPU_READ_VAL. */