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 <[email protected]>
Signed-off-by: Zhijie Zhang <[email protected]>
Signed-off-by: Yanteng Si <[email protected]>
  • Loading branch information
Yanteng Si committed May 31, 2024
1 parent 74727dd commit ef0556e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/radeon/cik.c
Original file line number Diff line number Diff line change
Expand Up @@ -8093,6 +8093,9 @@ int cik_irq_process(struct radeon_device *rdev)
if (queue_thermal)
schedule_work(&rdev->pm.dpm.thermal.work);
rdev->ih.rptr = rptr;
#ifdef CONFIG_LOONGARCH
WREG32(IH_RB_RPTR, rptr);
#endif
atomic_set(&rdev->ih.lock, 0);

/* make sure wptr hasn't changed while processing */
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/radeon/evergreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -4922,6 +4922,9 @@ 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;
#ifdef CONFIG_LOONGARCH
WREG32(IH_RB_RPTR, rptr);
#endif
atomic_set(&rdev->ih.lock, 0);

/* make sure wptr hasn't changed while processing */
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/radeon/r600.c
Original file line number Diff line number Diff line change
Expand Up @@ -4328,6 +4328,9 @@ 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;
#ifdef CONFIG_LOONGARCH
WREG32(IH_RB_RPTR, rptr);
#endif
atomic_set(&rdev->ih.lock, 0);

/* make sure wptr hasn't changed while processing */
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/radeon/si.c
Original file line number Diff line number Diff line change
Expand Up @@ -6442,6 +6442,9 @@ 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;
#ifdef CONFIG_LOONGARCH
WREG32(IH_RB_RPTR, rptr);
#endif
atomic_set(&rdev->ih.lock, 0);

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

0 comments on commit ef0556e

Please sign in to comment.