]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/radeon: drop register readback in cayman_cp_int_cntl_setup
authorLucas Stach <dev@lynxeye.de>
Mon, 24 Oct 2016 21:32:04 +0000 (23:32 +0200)
committerSasha Levin <alexander.levin@verizon.com>
Sat, 26 Nov 2016 03:57:02 +0000 (22:57 -0500)
[ Upstream commit 537b4b462caa8bfb9726d9695b8e56e2d5e6b41e ]

The read is taking a considerable amount of time (about 50us on this
machine). The register does not ever hold anything other than the ring
ID that is updated in this exact function, so there is no need for
the read modify write cycle.

This chops off a big chunk of the time spent in hardirq disabled
context, as this function is called multiple times in the interrupt
handler. With this change applied radeon won't show up in the list
of the worst IRQ latency offenders anymore, where it was a regular
before.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/gpu/drm/radeon/ni.c

index 64d3a771920db8a57a04cd343ba210d8ee2fefc7..fc305ee224716be2f222782f58589818b967d16d 100644 (file)
@@ -1371,9 +1371,7 @@ static void cayman_pcie_gart_fini(struct radeon_device *rdev)
 void cayman_cp_int_cntl_setup(struct radeon_device *rdev,
                              int ring, u32 cp_int_cntl)
 {
-       u32 srbm_gfx_cntl = RREG32(SRBM_GFX_CNTL) & ~3;
-
-       WREG32(SRBM_GFX_CNTL, srbm_gfx_cntl | (ring & 3));
+       WREG32(SRBM_GFX_CNTL, RINGID(ring));
        WREG32(CP_INT_CNTL, cp_int_cntl);
 }