Skip to content

Commit 54e6bad

Browse files
John Clementsalexdeucher
authored andcommitted
drm/amdgpu: Clear RAS interrupt status on aldebaran
resolve register address issue for detecting/clearing RAS interrupt Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: John Clements <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 3c4ff2d commit 54e6bad

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@
8585
#define mmRCC_DEV0_EPF0_STRAP0_ALDE 0x0015
8686
#define mmRCC_DEV0_EPF0_STRAP0_ALDE_BASE_IDX 2
8787

88+
#define mmBIF_DOORBELL_INT_CNTL_ALDE 0x3878
89+
#define mmBIF_DOORBELL_INT_CNTL_ALDE_BASE_IDX 2
90+
#define BIF_DOORBELL_INT_CNTL_ALDE__DOORBELL_INTERRUPT_DISABLE__SHIFT 0x18
91+
#define BIF_DOORBELL_INT_CNTL_ALDE__DOORBELL_INTERRUPT_DISABLE_MASK 0x01000000L
92+
8893
static void nbio_v7_4_query_ras_error_count(struct amdgpu_device *adev,
8994
void *ras_error_status);
9095

@@ -346,14 +351,21 @@ static void nbio_v7_4_handle_ras_controller_intr_no_bifring(struct amdgpu_device
346351
struct ras_err_data err_data = {0, 0, 0, NULL};
347352
struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
348353

349-
bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL);
354+
if (adev->asic_type == CHIP_ALDEBARAN)
355+
bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL_ALDE);
356+
else
357+
bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL);
358+
350359
if (REG_GET_FIELD(bif_doorbell_intr_cntl,
351360
BIF_DOORBELL_INT_CNTL, RAS_CNTLR_INTERRUPT_STATUS)) {
352361
/* driver has to clear the interrupt status when bif ring is disabled */
353362
bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
354363
BIF_DOORBELL_INT_CNTL,
355364
RAS_CNTLR_INTERRUPT_CLEAR, 1);
356-
WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL, bif_doorbell_intr_cntl);
365+
if (adev->asic_type == CHIP_ALDEBARAN)
366+
WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL_ALDE, bif_doorbell_intr_cntl);
367+
else
368+
WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL, bif_doorbell_intr_cntl);
357369

358370
if (!ras->disable_ras_err_cnt_harvest) {
359371
/*
@@ -395,14 +407,22 @@ static void nbio_v7_4_handle_ras_err_event_athub_intr_no_bifring(struct amdgpu_d
395407
{
396408
uint32_t bif_doorbell_intr_cntl;
397409

398-
bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL);
410+
if (adev->asic_type == CHIP_ALDEBARAN)
411+
bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL_ALDE);
412+
else
413+
bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL);
414+
399415
if (REG_GET_FIELD(bif_doorbell_intr_cntl,
400416
BIF_DOORBELL_INT_CNTL, RAS_ATHUB_ERR_EVENT_INTERRUPT_STATUS)) {
401417
/* driver has to clear the interrupt status when bif ring is disabled */
402418
bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
403419
BIF_DOORBELL_INT_CNTL,
404420
RAS_ATHUB_ERR_EVENT_INTERRUPT_CLEAR, 1);
405-
WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL, bif_doorbell_intr_cntl);
421+
422+
if (adev->asic_type == CHIP_ALDEBARAN)
423+
WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL_ALDE, bif_doorbell_intr_cntl);
424+
else
425+
WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL, bif_doorbell_intr_cntl);
406426

407427
amdgpu_ras_global_ras_isr(adev);
408428
}
@@ -572,7 +592,11 @@ static void nbio_v7_4_query_ras_error_count(struct amdgpu_device *adev,
572592
static void nbio_v7_4_enable_doorbell_interrupt(struct amdgpu_device *adev,
573593
bool enable)
574594
{
575-
WREG32_FIELD15(NBIO, 0, BIF_DOORBELL_INT_CNTL,
595+
if (adev->asic_type == CHIP_ALDEBARAN)
596+
WREG32_FIELD15(NBIO, 0, BIF_DOORBELL_INT_CNTL_ALDE,
597+
DOORBELL_INTERRUPT_DISABLE, enable ? 0 : 1);
598+
else
599+
WREG32_FIELD15(NBIO, 0, BIF_DOORBELL_INT_CNTL,
576600
DOORBELL_INTERRUPT_DISABLE, enable ? 0 : 1);
577601
}
578602

0 commit comments

Comments
 (0)