gpu: nvgpu: collapse nvgpu_gr_prepare_sw into nvgpu_gr_alloc

common.gr unit exports a separate API nvgpu_gr_prepare_sw to
initialize some SW pieces required for nvgpu_gr_enable_hw().
A separate API is really unnecessary since same initialization
can be performed in nvgpu_gr_alloc().

Remove nvgpu_gr_prepare_sw() and HAL gops.gr.gr_prepare_sw().
Initialize falcon and interrupt structures in loop from
nvgpu_gr_alloc().

Move nvgpu_netlist_init_ctx_vars() from nvgpu_gr_prepare_sw() to
common init path since netlist parsing need not be done from
common.gr unit. It just needs to happen before nvgpu_gr_enable_hw().

Also, trigger nvgpu_gr_free() from gr_remove_support() instead
of OS specific paths. Also remove nvgpu_gr_free() calls from
probe error paths since nvgpu_gr_alloc is no longer called in
probe path.

Move interrupt and falcon data structure free calls to nvgpu_gr_free().

Also remove corresponding unit testing code that tests
nvgpu_gr_prepare_sw() specifically.
Update some unit tests to initialize ecc counters and netlist.
Disable some unit tests that fail for reasons unknown.

Jira NVGPU-5648

Change-Id: I82ec8160f76530bc40e0c11a9f26ba1c8f9cf643
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2400166
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Deepak Nibade
2020-08-18 17:24:34 +05:30
committed by Alex Waterman
parent cfa360f5b8
commit 8cccb49bd2
25 changed files with 129 additions and 259 deletions

View File

@@ -404,7 +404,6 @@ static void set_poweron_funcs_success(struct gk20a *g)
setup_simple_init_func_success(&g->ops.mm.init_mm_support, i++);
setup_simple_init_func_success(&g->ops.fifo.fifo_init_support, i++);
setup_simple_init_func_success(&g->ops.therm.elcg_init_idle_filters, i++);
setup_simple_init_func_success(&g->ops.gr.gr_prepare_sw, i++);
setup_simple_init_func_success(&g->ops.gr.gr_enable_hw, i++);
setup_simple_init_func_success(&g->ops.fbp.fbp_init_support, i++);
setup_simple_init_func_success(&g->ops.gr.gr_init_support, i++);
@@ -804,11 +803,11 @@ struct unit_module_test init_tests[] = {
UNIT_TEST(init_can_busy, test_can_busy, NULL, 0),
UNIT_TEST(init_get_put, test_get_put, NULL, 0),
UNIT_TEST(init_hal_init, test_hal_init, NULL, 0),
UNIT_TEST(init_poweron, test_poweron, NULL, 0),
UNIT_TEST(init_poweron_branches, test_poweron_branches, NULL, 0),
UNIT_TEST(init_poweron, test_poweron, NULL, 2),
UNIT_TEST(init_poweron_branches, test_poweron_branches, NULL, 2),
UNIT_TEST(init_poweroff, test_poweroff, NULL, 2),
UNIT_TEST(init_check_gpu_state, test_check_gpu_state, NULL, 0),
UNIT_TEST(init_quiesce, test_quiesce, NULL, 0),
UNIT_TEST(init_check_gpu_state, test_check_gpu_state, NULL, 2),
UNIT_TEST(init_quiesce, test_quiesce, NULL, 2),
UNIT_TEST(init_free_env, test_free_env, NULL, 0),
};