Skip to content

Commit d409c20

Browse files
Asher SongAsher Song
Asher Song
authored and
Asher Song
committed
Revert "drm/amdgpu: rework lock handling for flush_tlb v2"
This reverts commit 7273ce5. This patch causes a gpu_reset failure on navi3x. Signed-off-by: Asher Song <[email protected]>
1 parent c298b4d commit d409c20

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

Diff for: drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c

-8
Original file line numberDiff line numberDiff line change
@@ -624,13 +624,6 @@ void amdgpu_gmc_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
624624
!adev->ib_pool_ready || amdgpu_in_reset(adev) ||
625625
!ring->sched.ready) {
626626

627-
/*
628-
* A GPU reset should flush all TLBs anyway, so no need to do
629-
* this while one is ongoing.
630-
*/
631-
if (!down_read_trylock(&adev->reset_domain->sem))
632-
return;
633-
634627
if (adev->gmc.flush_tlb_needs_extra_type_2)
635628
adev->gmc.gmc_funcs->flush_gpu_tlb(adev, vmid,
636629
vmhub, 2);
@@ -641,7 +634,6 @@ void amdgpu_gmc_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
641634

642635
adev->gmc.gmc_funcs->flush_gpu_tlb(adev, vmid, vmhub,
643636
flush_type);
644-
up_read(&adev->reset_domain->sem);
645637
return;
646638
}
647639

Diff for: drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
#include "athub_v2_0.h"
5252
#include "athub_v2_1.h"
5353

54+
#include "amdgpu_reset.h"
55+
5456
static int gmc_v10_0_ecc_interrupt_state(struct amdgpu_device *adev,
5557
struct amdgpu_irq_src *src,
5658
unsigned int type,

Diff for: drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c

+5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "amdgpu_ucode.h"
3434
#include "amdgpu_amdkfd.h"
3535
#include "amdgpu_gem.h"
36+
#include "amdgpu_reset.h"
3637

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

434+
if (!down_read_trylock(&adev->reset_domain->sem))
435+
return;
436+
433437
for (vmid = 1; vmid < 16; vmid++) {
434438
u32 tmp = RREG32(mmATC_VMID0_PASID_MAPPING + vmid);
435439

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

441445
WREG32(mmVM_INVALIDATE_REQUEST, mask);
442446
RREG32(mmVM_INVALIDATE_RESPONSE);
447+
up_read(&adev->reset_domain->sem);
443448
}
444449

445450
/*

Diff for: drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "amdgpu_ucode.h"
3232
#include "amdgpu_amdkfd.h"
3333
#include "amdgpu_gem.h"
34+
#include "amdgpu_reset.h"
3435

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

629+
if (!down_read_trylock(&adev->reset_domain->sem))
630+
return;
631+
628632
for (vmid = 1; vmid < 16; vmid++) {
629633
u32 tmp = RREG32(mmATC_VMID0_PASID_MAPPING + vmid);
630634

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

636640
WREG32(mmVM_INVALIDATE_REQUEST, mask);
637641
RREG32(mmVM_INVALIDATE_RESPONSE);
642+
up_read(&adev->reset_domain->sem);
638643
}
639644

640645
/*

Diff for: drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565
#include "amdgpu_ras.h"
6666
#include "amdgpu_xgmi.h"
6767

68+
#include "amdgpu_reset.h"
69+
6870
/* add these here since we already include dce12 headers and these are for DCN */
6971
#define mmHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION 0x055d
7072
#define mmHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION_BASE_IDX 2

0 commit comments

Comments
 (0)