Skip to content

Commit

Permalink
Revert "drm/amdgpu: rework lock handling for flush_tlb v2"
Browse files Browse the repository at this point in the history
This reverts commit 7273ce5.
This patch causes a gpu_reset failure on navi3x.

Signed-off-by: Asher Song <Asher.Song@amd.com>
  • Loading branch information
Asher Song authored and Asher Song committed Mar 27, 2024
1 parent c298b4d commit d409c20
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
8 changes: 0 additions & 8 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,13 +624,6 @@ void amdgpu_gmc_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
!adev->ib_pool_ready || amdgpu_in_reset(adev) ||
!ring->sched.ready) {

/*
* A GPU reset should flush all TLBs anyway, so no need to do
* this while one is ongoing.
*/
if (!down_read_trylock(&adev->reset_domain->sem))
return;

if (adev->gmc.flush_tlb_needs_extra_type_2)
adev->gmc.gmc_funcs->flush_gpu_tlb(adev, vmid,
vmhub, 2);
Expand All @@ -641,7 +634,6 @@ void amdgpu_gmc_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,

adev->gmc.gmc_funcs->flush_gpu_tlb(adev, vmid, vmhub,
flush_type);
up_read(&adev->reset_domain->sem);
return;
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
#include "athub_v2_0.h"
#include "athub_v2_1.h"

#include "amdgpu_reset.h"

static int gmc_v10_0_ecc_interrupt_state(struct amdgpu_device *adev,
struct amdgpu_irq_src *src,
unsigned int type,
Expand Down
5 changes: 5 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "amdgpu_ucode.h"
#include "amdgpu_amdkfd.h"
#include "amdgpu_gem.h"
#include "amdgpu_reset.h"

#include "bif/bif_4_1_d.h"
#include "bif/bif_4_1_sh_mask.h"
Expand Down Expand Up @@ -430,6 +431,9 @@ static void gmc_v7_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev,
u32 mask = 0x0;
int vmid;

if (!down_read_trylock(&adev->reset_domain->sem))
return;

for (vmid = 1; vmid < 16; vmid++) {
u32 tmp = RREG32(mmATC_VMID0_PASID_MAPPING + vmid);

Expand All @@ -440,6 +444,7 @@ static void gmc_v7_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev,

WREG32(mmVM_INVALIDATE_REQUEST, mask);
RREG32(mmVM_INVALIDATE_RESPONSE);
up_read(&adev->reset_domain->sem);
}

/*
Expand Down
5 changes: 5 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "amdgpu_ucode.h"
#include "amdgpu_amdkfd.h"
#include "amdgpu_gem.h"
#include "amdgpu_reset.h"

#include "gmc/gmc_8_1_d.h"
#include "gmc/gmc_8_1_sh_mask.h"
Expand Down Expand Up @@ -625,6 +626,9 @@ static void gmc_v8_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev,
u32 mask = 0x0;
int vmid;

if (!down_read_trylock(&adev->reset_domain->sem))
return;

for (vmid = 1; vmid < 16; vmid++) {
u32 tmp = RREG32(mmATC_VMID0_PASID_MAPPING + vmid);

Expand All @@ -635,6 +639,7 @@ static void gmc_v8_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev,

WREG32(mmVM_INVALIDATE_REQUEST, mask);
RREG32(mmVM_INVALIDATE_RESPONSE);
up_read(&adev->reset_domain->sem);
}

/*
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
#include "amdgpu_ras.h"
#include "amdgpu_xgmi.h"

#include "amdgpu_reset.h"

/* add these here since we already include dce12 headers and these are for DCN */
#define mmHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION 0x055d
#define mmHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION_BASE_IDX 2
Expand Down

0 comments on commit d409c20

Please sign in to comment.