diff --git a/drivers/gpu/nvgpu/hal/fifo/engine_status_gm20b.c b/drivers/gpu/nvgpu/hal/fifo/engine_status_gm20b.c index ed9c95641..b745a1452 100644 --- a/drivers/gpu/nvgpu/hal/fifo/engine_status_gm20b.c +++ b/drivers/gpu/nvgpu/hal/fifo/engine_status_gm20b.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -42,6 +42,11 @@ void gm20b_dump_engine_status(struct gk20a *g, struct nvgpu_debug_context *o) gk20a_debug_output(o, "--------------------------"); for (i = 0; i < host_num_engines; i++) { + if (!nvgpu_engine_check_valid_id(g, i)) { + /* Skip invalid engines */ + continue; + } + g->ops.engine_status.read_engine_status_info(g, i, &engine_status); gk20a_debug_output(o, diff --git a/drivers/gpu/nvgpu/hal/fifo/engine_status_gv100_fusa.c b/drivers/gpu/nvgpu/hal/fifo/engine_status_gv100_fusa.c index 5ac42f164..e5e8139b7 100644 --- a/drivers/gpu/nvgpu/hal/fifo/engine_status_gv100_fusa.c +++ b/drivers/gpu/nvgpu/hal/fifo/engine_status_gv100_fusa.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -52,6 +53,11 @@ void gv100_dump_engine_status(struct gk20a *g, struct nvgpu_debug_context *o) host_num_engines = nvgpu_get_litter_value(g, GPU_LIT_HOST_NUM_ENGINES); for (i = 0; i < host_num_engines; i++) { + if (!nvgpu_engine_check_valid_id(g, i)) { + /* Skip invalid engines */ + continue; + } + g->ops.engine_status.read_engine_status_info(g, i, &engine_status); gk20a_debug_output(o, "%s eng %d: ", g->name, i); diff --git a/userspace/required_tests.ini b/userspace/required_tests.ini index 8208edcd8..74213ce5a 100644 --- a/userspace/required_tests.ini +++ b/userspace/required_tests.ini @@ -565,7 +565,6 @@ test_gp10b_engine_init_ce_info.engine_init_ce_info=2 [nvgpu_engine_gv100] test_fifo_init_support.init_support=0 test_fifo_remove_support.remove_support=0 -test_gv100_dump_engine_status.dump_engine_status_info=0 test_gv100_read_engine_status_info.read_engine_status_info=0 [nvgpu_engine_gv11b] diff --git a/userspace/units/fifo/engine/gv100/nvgpu-engine-gv100.c b/userspace/units/fifo/engine/gv100/nvgpu-engine-gv100.c index 6c9723170..5dd4e97b0 100644 --- a/userspace/units/fifo/engine/gv100/nvgpu-engine-gv100.c +++ b/userspace/units/fifo/engine/gv100/nvgpu-engine-gv100.c @@ -170,7 +170,7 @@ done: struct unit_module_test nvgpu_engine_gv100_tests[] = { UNIT_TEST(init_support, test_fifo_init_support, NULL, 0), UNIT_TEST(read_engine_status_info, test_gv100_read_engine_status_info, NULL, 0), - UNIT_TEST(dump_engine_status_info, test_gv100_dump_engine_status, NULL, 0), + UNIT_TEST(dump_engine_status_info, test_gv100_dump_engine_status, NULL, 1), UNIT_TEST(remove_support, test_fifo_remove_support, NULL, 0), };