From patchwork Wed Mar 12 19:38:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 3820651 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 691E69F369 for ; Wed, 12 Mar 2014 19:39:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 84A7E20165 for ; Wed, 12 Mar 2014 19:39:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A6F442015A for ; Wed, 12 Mar 2014 19:39:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E0E93FB071; Wed, 12 Mar 2014 12:39:01 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qa0-f43.google.com (mail-qa0-f43.google.com [209.85.216.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 88C44FB26B for ; Wed, 12 Mar 2014 12:38:57 -0700 (PDT) Received: by mail-qa0-f43.google.com with SMTP id j15so10386838qaq.2 for ; Wed, 12 Mar 2014 12:38:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FLbwbMvC3eBCukhHy3TP1p4eaoKwxdOSwMp24rS0hD4=; b=t/9eCNrscimrqn9yzxFoiJDQZ0n8acnc1KzeZ7NqoERXw1/tMUmAJANU/7H92x9j0A QG2x/ALS2mK7EKjbcTERtLsYTxiO0Z+m/wijR809HNREOxoYJ9WKSPqKSBlk/eT5F12b OlCTHKOeTWa3JN5P+WaCAj8Xb/dSN8tW/M68irzRPuJVuncLx99a94FwpwVfGsP+b/m/ zJcFQbknkvCYJAT8tMxgfWMIu37qoYQm6LH7LYOQIsDen3E+bh1h3K6Y6PaRaYgTmuIf Ilou4CFJU69WKySl8hFHHrtEMPZ3LlTmfeR/RUC9e/AleKlffuEpzpw/W6AR8uzvLODG hRfw== X-Received: by 10.224.135.132 with SMTP id n4mr4775885qat.97.1394653137308; Wed, 12 Mar 2014 12:38:57 -0700 (PDT) Received: from localhost.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by mx.google.com with ESMTPSA id d30sm4177814qga.9.2014.03.12.12.38.56 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Wed, 12 Mar 2014 12:38:57 -0700 (PDT) From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/radeon/cik: stop the sdma engines in the enable() function Date: Wed, 12 Mar 2014 15:38:49 -0400 Message-Id: <1394653129-2104-2-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1394653129-2104-1-git-send-email-alexander.deucher@amd.com> References: <1394653129-2104-1-git-send-email-alexander.deucher@amd.com> Cc: Alex Deucher , stable@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We always stop the rings when disabling the engines so just call the stop functions directly from the sdma enable function. This way the rings' status is set correctly on suspend so there are no problems on resume. Fixes resume failures that result in acceleration getting disabled. Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org --- drivers/gpu/drm/radeon/cik_sdma.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/radeon/cik_sdma.c b/drivers/gpu/drm/radeon/cik_sdma.c index 5d7a5fa..94626ea 100644 --- a/drivers/gpu/drm/radeon/cik_sdma.c +++ b/drivers/gpu/drm/radeon/cik_sdma.c @@ -293,6 +293,11 @@ void cik_sdma_enable(struct radeon_device *rdev, bool enable) u32 me_cntl, reg_offset; int i; + if (enable == false) { + cik_sdma_gfx_stop(rdev); + cik_sdma_rlc_stop(rdev); + } + for (i = 0; i < 2; i++) { if (i == 0) reg_offset = SDMA0_REGISTER_OFFSET; @@ -422,10 +427,6 @@ static int cik_sdma_load_microcode(struct radeon_device *rdev) if (!rdev->sdma_fw) return -EINVAL; - /* stop the gfx rings and rlc compute queues */ - cik_sdma_gfx_stop(rdev); - cik_sdma_rlc_stop(rdev); - /* halt the MEs */ cik_sdma_enable(rdev, false); @@ -494,9 +495,6 @@ int cik_sdma_resume(struct radeon_device *rdev) */ void cik_sdma_fini(struct radeon_device *rdev) { - /* stop the gfx rings and rlc compute queues */ - cik_sdma_gfx_stop(rdev); - cik_sdma_rlc_stop(rdev); /* halt the MEs */ cik_sdma_enable(rdev, false); radeon_ring_fini(rdev, &rdev->ring[R600_RING_TYPE_DMA_INDEX]);