From patchwork Thu Jun 18 22:31:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 6641381 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9A30F9F326 for ; Thu, 18 Jun 2015 22:31:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BF33B208A5 for ; Thu, 18 Jun 2015 22:31:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id AEEA9208A1 for ; Thu, 18 Jun 2015 22:31:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD7936E21D; Thu, 18 Jun 2015 15:31:53 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qg0-f43.google.com (mail-qg0-f43.google.com [209.85.192.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 173156E1B2 for ; Thu, 18 Jun 2015 15:31:52 -0700 (PDT) Received: by qged89 with SMTP id d89so31126532qge.0 for ; Thu, 18 Jun 2015 15:31:51 -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 :mime-version:content-type:content-transfer-encoding; bh=optAwqMeRZrGx6jx+T7HLgyMzIf29bVOjwEDt5NqetE=; b=xmXtRNJvlxMkPRhvRIPCxnFzhxVl9MQz8SVTDtOQZ0OqIVCs697XC/PgsYJxBh8+10 09H9JnBJK6a9WDEP5TH4kvWzl1R5bRYJJ59IQUi0N39A/Mg/iGDgJNBnQ+B84zVxSWA0 dNWvVDhJpvzns46E84LKhFpt1ZT/orXXiJtaKwgthT5WCHcilSMwAqDG3O5s5GnxYRRb UaxjmNUE7aH9C8JF1Mdo7x8IwqSPB8+B/fu6xGfb3HYXZrgF0aShFbLGDzp9PN8bvGgS 7UWA4MDq9swEl6gwn6gclEvqb20DEOBN6hWijxuk6PBTj/g3+Bo9YF3mqiEjBpglxjmM dc+g== X-Received: by 10.140.108.201 with SMTP id j67mr17807710qgf.83.1434666711495; Thu, 18 Jun 2015 15:31:51 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by mx.google.com with ESMTPSA id 131sm4618697qhf.14.2015.06.18.15.31.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 15:31:50 -0700 (PDT) From: j.glisse@gmail.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/radeon: SDMA fix hibernation (CI GPU family). Date: Thu, 18 Jun 2015 18:31:37 -0400 Message-Id: <1434666697-6295-2-git-send-email-j.glisse@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1434666697-6295-1-git-send-email-j.glisse@gmail.com> References: <1434666697-6295-1-git-send-email-j.glisse@gmail.com> MIME-Version: 1.0 Cc: =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , stable@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Jérôme Glisse In order for hibernation to reliably work we need to properly turn off the SDMA block, sadly after numerous attemps i haven't not found proper sequence for clean and full shutdown. So simply reset both SDMA block, this makes hibernation works reliably on sea island GPU family (CI) Hibernation and suspend to ram were tested (several times) on : Bonaire Hawaii Mullins Kaveri Kabini Cc: stable@vger.kernel.org Signed-off-by: Jérôme Glisse --- drivers/gpu/drm/radeon/cik_sdma.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/cik_sdma.c b/drivers/gpu/drm/radeon/cik_sdma.c index f86eb54..d16f2ee 100644 --- a/drivers/gpu/drm/radeon/cik_sdma.c +++ b/drivers/gpu/drm/radeon/cik_sdma.c @@ -268,6 +268,17 @@ static void cik_sdma_gfx_stop(struct radeon_device *rdev) } rdev->ring[R600_RING_TYPE_DMA_INDEX].ready = false; rdev->ring[CAYMAN_RING_TYPE_DMA1_INDEX].ready = false; + + /* FIXME use something else than big hammer but after few days can not + * seem to find good combination so reset SDMA blocks as it seems we + * do not shut them down properly. This fix hibernation and does not + * affect suspend to ram. + */ + WREG32(SRBM_SOFT_RESET, SOFT_RESET_SDMA | SOFT_RESET_SDMA1); + (void)RREG32(SRBM_SOFT_RESET); + udelay(50); + WREG32(SRBM_SOFT_RESET, 0); + (void)RREG32(SRBM_SOFT_RESET); } /**