Skip to content

Commit

Permalink
drm/radeon: Workaround radeon driver bug for Loongson
Browse files Browse the repository at this point in the history
Radeon driver can not handle the interrupt is faster than DMA data, so
irq handler must update an old ih.rptr value in IH_RB_RPTR register to
enable interrupt again when interrupt is faster than DMA data.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Zhijie Zhang <zhangzhijie@loongson.cn>
  • Loading branch information
chenhuacai committed Jun 17, 2024
1 parent 0b67f09 commit da63bd7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/radeon/cik.c
Original file line number Diff line number Diff line change
Expand Up @@ -8093,6 +8093,7 @@ int cik_irq_process(struct radeon_device *rdev)
if (queue_thermal)
schedule_work(&rdev->pm.dpm.thermal.work);
rdev->ih.rptr = rptr;
WREG32(IH_RB_RPTR, rptr);
atomic_set(&rdev->ih.lock, 0);

/* make sure wptr hasn't changed while processing */
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/radeon/evergreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -4919,6 +4919,7 @@ int evergreen_irq_process(struct radeon_device *rdev)
if (queue_thermal && rdev->pm.dpm_enabled)
schedule_work(&rdev->pm.dpm.thermal.work);
rdev->ih.rptr = rptr;
WREG32(IH_RB_RPTR, rptr);
atomic_set(&rdev->ih.lock, 0);

/* make sure wptr hasn't changed while processing */
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/radeon/r600.c
Original file line number Diff line number Diff line change
Expand Up @@ -4328,6 +4328,7 @@ int r600_irq_process(struct radeon_device *rdev)
if (queue_thermal && rdev->pm.dpm_enabled)
schedule_work(&rdev->pm.dpm.thermal.work);
rdev->ih.rptr = rptr;
WREG32(IH_RB_RPTR, rptr);
atomic_set(&rdev->ih.lock, 0);

/* make sure wptr hasn't changed while processing */
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/radeon/si.c
Original file line number Diff line number Diff line change
Expand Up @@ -6423,6 +6423,7 @@ int si_irq_process(struct radeon_device *rdev)
if (queue_thermal && rdev->pm.dpm_enabled)
schedule_work(&rdev->pm.dpm.thermal.work);
rdev->ih.rptr = rptr;
WREG32(IH_RB_RPTR, rptr);
atomic_set(&rdev->ih.lock, 0);

/* make sure wptr hasn't changed while processing */
Expand Down

0 comments on commit da63bd7

Please sign in to comment.