mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: fix nvgpu remove sequence
While removing the nvgpu module, all gpu unmaps should happen before removing the PMU support as ELPG_MS accesses pmu pg structure and ELPG_MS is disabled/enabled while accessing TLB or cache flush. nvgpu_fb_vab_teardown_hal and mmu_fault.info_mem_destroy do gpu unmaps. They were executed post removal of PMU support. Fix the sequence. Bug 3448630 Change-Id: I44925c313c625a2d0f297d1367d69069b3deacef Signed-off-by: Sagar Kamble <skamble@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2632490 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@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:
committed by
mobile promotions
parent
3d9c67a0e7
commit
41df3e17a7
@@ -143,17 +143,6 @@ static void nvgpu_remove_mm_support(struct mm_gk20a *mm)
|
||||
nvgpu_dma_free(g, &mm->mmu_wr_mem);
|
||||
nvgpu_dma_free(g, &mm->mmu_rd_mem);
|
||||
|
||||
#if defined(CONFIG_NVGPU_NON_FUSA)
|
||||
if (nvgpu_fb_vab_teardown_hal(g) != 0) {
|
||||
nvgpu_err(g, "failed to teardown VAB");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (g->ops.mm.mmu_fault.info_mem_destroy != NULL) {
|
||||
g->ops.mm.mmu_fault.info_mem_destroy(g);
|
||||
}
|
||||
|
||||
if (g->ops.mm.remove_bar2_vm != NULL) {
|
||||
g->ops.mm.remove_bar2_vm(g);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved.
|
||||
* Copyright (c) 2014-2021, 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"),
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <nvgpu/gr/gr.h>
|
||||
#include <nvgpu/nvgpu_init.h>
|
||||
#include <nvgpu/device.h>
|
||||
#include <nvgpu/fb.h>
|
||||
|
||||
#include "init_vgpu.h"
|
||||
#include "hal/vgpu/init/init_hal_vgpu.h"
|
||||
@@ -84,6 +85,16 @@ void vgpu_remove_support_common(struct gk20a *g)
|
||||
g->fifo.remove_support(&g->fifo);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_NVGPU_NON_FUSA)
|
||||
if (nvgpu_fb_vab_teardown_hal(g) != 0) {
|
||||
nvgpu_err(g, "failed to teardown VAB");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (g->ops.mm.mmu_fault.info_mem_destroy != NULL) {
|
||||
g->ops.mm.mmu_fault.info_mem_destroy(g);
|
||||
}
|
||||
|
||||
nvgpu_pmu_remove_support(g, g->pmu);
|
||||
|
||||
if (g->mm.remove_support) {
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
#include <nvgpu/mc.h>
|
||||
#include <nvgpu/cic_mon.h>
|
||||
#include <nvgpu/cic_rm.h>
|
||||
#include <nvgpu/fb.h>
|
||||
|
||||
#include "platform_gk20a.h"
|
||||
#include "sysfs.h"
|
||||
@@ -1037,6 +1038,16 @@ void gk20a_remove_support(struct gk20a *g)
|
||||
if (g->fifo.remove_support)
|
||||
g->fifo.remove_support(&g->fifo);
|
||||
|
||||
#if defined(CONFIG_NVGPU_NON_FUSA)
|
||||
if (nvgpu_fb_vab_teardown_hal(g) != 0) {
|
||||
nvgpu_err(g, "failed to teardown VAB");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (g->ops.mm.mmu_fault.info_mem_destroy != NULL) {
|
||||
g->ops.mm.mmu_fault.info_mem_destroy(g);
|
||||
}
|
||||
|
||||
nvgpu_pmu_remove_support(g, g->pmu);
|
||||
|
||||
if (g->mm.remove_support)
|
||||
|
||||
Reference in New Issue
Block a user