From patchwork Wed Jun 19 14:02:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 2749711 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 502A4C0AB1 for ; Wed, 19 Jun 2013 14:07:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 33E6320342 for ; Wed, 19 Jun 2013 14:07:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7B7F72035D for ; Wed, 19 Jun 2013 14:06:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 315BEE6249 for ; Wed, 19 Jun 2013 07:06:59 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qe0-f41.google.com (mail-qe0-f41.google.com [209.85.128.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 1495BE6192 for ; Wed, 19 Jun 2013 07:06:02 -0700 (PDT) Received: by mail-qe0-f41.google.com with SMTP id b4so3294097qen.28 for ; Wed, 19 Jun 2013 07:06:02 -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:x-mailer; bh=rudklnNAs2zWAAroP36aD5icW942g8vgn1jiEuDgcec=; b=iKCQie1vwsJWe6y+lFQDFaODDskfJyn2NhOCRZVqVAzAIFfSSus44cDhH0m9v2Zbco lCVmwi4gt7pFvhd8c2VRC03DzX1XvkIIcvs7wfmNWCVrgR3SG9T+JBcZg39QKOxpStWK lGdh+0pE0AKQcd9WHUg/Bsjr3RJa2ybzEo5FsHJLh74+lK3UMHnp1GuuS3Did8NN0sCQ V863IxIYaXuopWoU0p8xmQGdKQgn6pydCTKl56CEvbzeaKkD2T+dSVgOHIzDB0wIp7zE Lm/s0xan36QIz0PnQ1yL62xEjkfcra7MZtCDGHWKaHc8+viLaGgCia4B6/jGuiIm4+w8 iMsw== X-Received: by 10.49.84.164 with SMTP id a4mr3783000qez.4.1371650762525; Wed, 19 Jun 2013 07:06:02 -0700 (PDT) Received: from localhost.boston.devel.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by mx.google.com with ESMTPSA id w2sm34280312qec.8.2013.06.19.07.06.01 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 19 Jun 2013 07:06:02 -0700 (PDT) From: j.glisse@gmail.com To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: update lockup tracking when scheduling in empty ring Date: Wed, 19 Jun 2013 10:02:28 -0400 Message-Id: <1371650548-1896-1-git-send-email-j.glisse@gmail.com> X-Mailer: git-send-email 1.7.11.7 Cc: Jerome Glisse , 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+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-5.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: Jerome Glisse There might be issue with lockup detection when scheduling on an empty ring that have been sitting idle for a while. Thus update the lockup tracking data when scheduling new work in an empty ring. Signed-off-by: Jerome Glisse Tested-by: Andy Lutomirski Cc: stable@vger.kernel.org Reviewed-by: Christian König --- drivers/gpu/drm/radeon/radeon_ring.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c index e17faa7..82434018 100644 --- a/drivers/gpu/drm/radeon/radeon_ring.c +++ b/drivers/gpu/drm/radeon/radeon_ring.c @@ -402,6 +402,13 @@ int radeon_ring_alloc(struct radeon_device *rdev, struct radeon_ring *ring, unsi return -ENOMEM; /* Align requested size with padding so unlock_commit can * pad safely */ + radeon_ring_free_size(rdev, ring); + if (ring->ring_free_dw == (ring->ring_size / 4)) { + /* This is an empty ring update lockup info to avoid + * false positive. + */ + radeon_ring_lockup_update(ring); + } ndw = (ndw + ring->align_mask) & ~ring->align_mask; while (ndw > (ring->ring_free_dw - 1)) { radeon_ring_free_size(rdev, ring);