Commit f55e03b9 authored by Michel Dänzer's avatar Michel Dänzer Committed by Alex Deucher

drm/radeon: Update IH_RB_RPTR register after each processed interrupt

This might decrease the chance of IH ring buffer overflows.
Signed-off-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6cc2fda2
...@@ -8251,6 +8251,7 @@ int cik_irq_process(struct radeon_device *rdev) ...@@ -8251,6 +8251,7 @@ int cik_irq_process(struct radeon_device *rdev)
/* wptr/rptr are in bytes! */ /* wptr/rptr are in bytes! */
rptr += 16; rptr += 16;
rptr &= rdev->ih.ptr_mask; rptr &= rdev->ih.ptr_mask;
WREG32(IH_RB_RPTR, rptr);
} }
if (queue_hotplug) if (queue_hotplug)
schedule_work(&rdev->hotplug_work); schedule_work(&rdev->hotplug_work);
...@@ -8259,7 +8260,6 @@ int cik_irq_process(struct radeon_device *rdev) ...@@ -8259,7 +8260,6 @@ int cik_irq_process(struct radeon_device *rdev)
if (queue_thermal) if (queue_thermal)
schedule_work(&rdev->pm.dpm.thermal.work); schedule_work(&rdev->pm.dpm.thermal.work);
rdev->ih.rptr = rptr; rdev->ih.rptr = rptr;
WREG32(IH_RB_RPTR, rdev->ih.rptr);
atomic_set(&rdev->ih.lock, 0); atomic_set(&rdev->ih.lock, 0);
/* make sure wptr hasn't changed while processing */ /* make sure wptr hasn't changed while processing */
......
...@@ -5137,6 +5137,7 @@ int evergreen_irq_process(struct radeon_device *rdev) ...@@ -5137,6 +5137,7 @@ int evergreen_irq_process(struct radeon_device *rdev)
/* wptr/rptr are in bytes! */ /* wptr/rptr are in bytes! */
rptr += 16; rptr += 16;
rptr &= rdev->ih.ptr_mask; rptr &= rdev->ih.ptr_mask;
WREG32(IH_RB_RPTR, rptr);
} }
if (queue_hotplug) if (queue_hotplug)
schedule_work(&rdev->hotplug_work); schedule_work(&rdev->hotplug_work);
...@@ -5145,7 +5146,6 @@ int evergreen_irq_process(struct radeon_device *rdev) ...@@ -5145,7 +5146,6 @@ int evergreen_irq_process(struct radeon_device *rdev)
if (queue_thermal && rdev->pm.dpm_enabled) if (queue_thermal && rdev->pm.dpm_enabled)
schedule_work(&rdev->pm.dpm.thermal.work); schedule_work(&rdev->pm.dpm.thermal.work);
rdev->ih.rptr = rptr; rdev->ih.rptr = rptr;
WREG32(IH_RB_RPTR, rdev->ih.rptr);
atomic_set(&rdev->ih.lock, 0); atomic_set(&rdev->ih.lock, 0);
/* make sure wptr hasn't changed while processing */ /* make sure wptr hasn't changed while processing */
......
...@@ -4048,6 +4048,7 @@ int r600_irq_process(struct radeon_device *rdev) ...@@ -4048,6 +4048,7 @@ int r600_irq_process(struct radeon_device *rdev)
/* wptr/rptr are in bytes! */ /* wptr/rptr are in bytes! */
rptr += 16; rptr += 16;
rptr &= rdev->ih.ptr_mask; rptr &= rdev->ih.ptr_mask;
WREG32(IH_RB_RPTR, rptr);
} }
if (queue_hotplug) if (queue_hotplug)
schedule_work(&rdev->hotplug_work); schedule_work(&rdev->hotplug_work);
...@@ -4056,7 +4057,6 @@ int r600_irq_process(struct radeon_device *rdev) ...@@ -4056,7 +4057,6 @@ int r600_irq_process(struct radeon_device *rdev)
if (queue_thermal && rdev->pm.dpm_enabled) if (queue_thermal && rdev->pm.dpm_enabled)
schedule_work(&rdev->pm.dpm.thermal.work); schedule_work(&rdev->pm.dpm.thermal.work);
rdev->ih.rptr = rptr; rdev->ih.rptr = rptr;
WREG32(IH_RB_RPTR, rdev->ih.rptr);
atomic_set(&rdev->ih.lock, 0); atomic_set(&rdev->ih.lock, 0);
/* make sure wptr hasn't changed while processing */ /* make sure wptr hasn't changed while processing */
......
...@@ -6664,13 +6664,13 @@ int si_irq_process(struct radeon_device *rdev) ...@@ -6664,13 +6664,13 @@ int si_irq_process(struct radeon_device *rdev)
/* wptr/rptr are in bytes! */ /* wptr/rptr are in bytes! */
rptr += 16; rptr += 16;
rptr &= rdev->ih.ptr_mask; rptr &= rdev->ih.ptr_mask;
WREG32(IH_RB_RPTR, rptr);
} }
if (queue_hotplug) if (queue_hotplug)
schedule_work(&rdev->hotplug_work); schedule_work(&rdev->hotplug_work);
if (queue_thermal && rdev->pm.dpm_enabled) if (queue_thermal && rdev->pm.dpm_enabled)
schedule_work(&rdev->pm.dpm.thermal.work); schedule_work(&rdev->pm.dpm.thermal.work);
rdev->ih.rptr = rptr; rdev->ih.rptr = rptr;
WREG32(IH_RB_RPTR, rdev->ih.rptr);
atomic_set(&rdev->ih.lock, 0); atomic_set(&rdev->ih.lock, 0);
/* make sure wptr hasn't changed while processing */ /* make sure wptr hasn't changed while processing */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment