Return-Path: Received: from mx2.suse.de ([195.135.220.15]:53302 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934866AbcKVWks (ORCPT ); Tue, 22 Nov 2016 17:40:48 -0500 From: Jiri Slaby To: stable@vger.kernel.org Cc: Lucas Stach , Alex Deucher , Jiri Slaby Subject: [patch added to 3.12-stable] drm/radeon: drop register readback in cayman_cp_int_cntl_setup Date: Tue, 22 Nov 2016 23:40:21 +0100 Message-Id: <20161122224029.29962-33-jslaby@suse.cz> In-Reply-To: <20161122224029.29962-1-jslaby@suse.cz> References: <20161122224029.29962-1-jslaby@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: From: Lucas Stach This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== commit 537b4b462caa8bfb9726d9695b8e56e2d5e6b41e upstream. 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 Signed-off-by: Lucas Stach Signed-off-by: Alex Deucher Signed-off-by: Jiri Slaby --- drivers/gpu/drm/radeon/ni.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index 7dcf2ffddccf..a10125442041 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c @@ -1322,9 +1322,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); } -- 2.10.2