mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: unit: improve coverage for gv11b pbdma HAL
Improve branch coverage for the following HALs: - gv11b_pbdma_handle_intr_0 (add error cases for report_pbdma_error) - gv11b_pbdma_handle_intr_1 (add HCE interrupt case) Jira NVGPU-3694 Jira NVGPU-4673 Change-Id: I658a7c270af16152ccb6a0b19da1fa8c68e9c2ec Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2263669 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
31d689d489
commit
a50802510f
@@ -215,9 +215,17 @@ int test_gv11b_pbdma_handle_intr_0(struct unit_module *m,
|
||||
if (pbdma_intr_0 & pbdma_intr_0_eng_reset_pending_f()) {
|
||||
assert(recover);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
recover = gv11b_pbdma_handle_intr_0(g, pbdma_id,
|
||||
pbdma_intr_0_memack_extra_pending_f(), &err_notifier);
|
||||
recover = gv11b_pbdma_handle_intr_0(g, pbdma_id,
|
||||
pbdma_intr_0_gpfifo_pending_f(), &err_notifier);
|
||||
recover = gv11b_pbdma_handle_intr_0(g, pbdma_id,
|
||||
pbdma_intr_0_clear_faulted_error_pending_f(), &err_notifier);
|
||||
recover = gv11b_pbdma_handle_intr_0(g, pbdma_id,
|
||||
pbdma_intr_0_signature_pending_f(), &err_notifier);
|
||||
|
||||
ret = UNIT_SUCCESS;
|
||||
done:
|
||||
if (ret != UNIT_SUCCESS) {
|
||||
@@ -230,7 +238,8 @@ done:
|
||||
|
||||
#define F_PBDMA_INTR_1_CTXNOTVALID_IN BIT(0)
|
||||
#define F_PBDMA_INTR_1_CTXNOTVALID_READ BIT(1)
|
||||
#define F_PBDMA_INTR_1_LAST BIT(2)
|
||||
#define F_PBDMA_INTR_1_HCE BIT(2)
|
||||
#define F_PBDMA_INTR_1_LAST BIT(3)
|
||||
|
||||
int test_gv11b_pbdma_handle_intr_1(struct unit_module *m,
|
||||
struct gk20a *g, void *args)
|
||||
@@ -240,6 +249,7 @@ int test_gv11b_pbdma_handle_intr_1(struct unit_module *m,
|
||||
const char *labels[] = {
|
||||
"ctxnotvalid_in",
|
||||
"ctxnotvalid_readl",
|
||||
"hce"
|
||||
};
|
||||
u32 pbdma_id = 0;
|
||||
u32 pbdma_intr_1;
|
||||
@@ -264,6 +274,10 @@ int test_gv11b_pbdma_handle_intr_1(struct unit_module *m,
|
||||
nvgpu_writel(g, pbdma_intr_1_r(pbdma_id), 0);
|
||||
}
|
||||
|
||||
if (branches & F_PBDMA_INTR_1_HCE) {
|
||||
pbdma_intr_1 |= BIT(0); /* HCE_RE_ILLEGAL_OP */
|
||||
}
|
||||
|
||||
err_notifier = INVALID_ERR_NOTIFIER;
|
||||
|
||||
recover = gv11b_pbdma_handle_intr_1(g, pbdma_id, pbdma_intr_1, &err_notifier);
|
||||
@@ -272,8 +286,9 @@ int test_gv11b_pbdma_handle_intr_1(struct unit_module *m,
|
||||
assert(!recover);
|
||||
}
|
||||
|
||||
if ((branches & F_PBDMA_INTR_1_CTXNOTVALID_IN) &&
|
||||
(branches & F_PBDMA_INTR_1_CTXNOTVALID_READ)) {
|
||||
if (((branches & F_PBDMA_INTR_1_CTXNOTVALID_IN) &&
|
||||
(branches & F_PBDMA_INTR_1_CTXNOTVALID_READ)) ||
|
||||
(branches & F_PBDMA_INTR_1_HCE)) {
|
||||
assert(recover);
|
||||
} else {
|
||||
assert(!recover);
|
||||
|
||||
@@ -106,6 +106,8 @@ int test_gv11b_pbdma_intr_enable(struct unit_module *m,
|
||||
* been reset.
|
||||
* - eng_reset: Check that recover is true.
|
||||
* - Other interrupts are tested explicitly for gm20b_pbdma_handle_intr_0.
|
||||
* - Call gv11b_pbdma_handle_intr_0 with additional error codes to exercise
|
||||
* all branches in report_pbdma_error.
|
||||
*
|
||||
* Output: Returns PASS if all branches gave expected results. FAIL otherwise.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user