From patchwork Thu Nov 29 15:29:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 1822391 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 04EC9DF23A for ; Thu, 29 Nov 2012 20:31:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C571DE66C9 for ; Thu, 29 Nov 2012 12:31:05 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qa0-f49.google.com (mail-qa0-f49.google.com [209.85.216.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B222E5FB4 for ; Thu, 29 Nov 2012 12:30:52 -0800 (PST) Received: by mail-qa0-f49.google.com with SMTP id hg5so675208qab.15 for ; Thu, 29 Nov 2012 12:30:51 -0800 (PST) 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=ofGtS3+VqXDW0X23463W3bcrkZ7Hzf9zfJ5F7w3wqwo=; b=RuyaGH5ckX0t3VKa6RsiwIEd+8x0qMoz3CxOhjxy2NI4VD50lslYzq7016cbiyFjeW QnXxHw+jb1zaDAlPfBBU4E5DweMu/W9p3sthzUaxmjX1hkjTYmq2UZyWuA7gWvYyKBF2 cBsdR4IUXF4jD4kQM4NGzQCuA75DEbbJ+GyBWWfFyyLXOrCHgFZGRN7vIJDSjkK9geJ5 CWAczEVviVFPIkzMVekfZlA2WsIhvasT7rk6lgAodsHGgcm2EFqI2mPG16zTHQxAWHPt POWS8mGBApyCrRN5PeorBOsyPfCrGL+n1AxJUWWCrKo6nBGqEbZRawvdsVRGSKPDswA1 CFuQ== Received: by 10.224.35.137 with SMTP id p9mr27263608qad.85.1354221051438; Thu, 29 Nov 2012 12:30:51 -0800 (PST) Received: from homer.localdomain.com ([66.187.233.206]) by mx.google.com with ESMTPS id r13sm1467906qaa.20.2012.11.29.12.30.49 (version=SSLv3 cipher=OTHER); Thu, 29 Nov 2012 12:30:50 -0800 (PST) From: j.glisse@gmail.com To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: fix rare segfault after gpu lockup on r7xx Date: Thu, 29 Nov 2012 10:29:54 -0500 Message-Id: <1354202994-3926-1-git-send-email-j.glisse@gmail.com> X-Mailer: git-send-email 1.7.11.7 Cc: Jerome Glisse 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 From: Jerome Glisse If GPU reset fails the gart table ptr might be NULL avoid a kernel segfault in this rare event. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/r600.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index cda280d..0e3a68a 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c @@ -843,7 +843,9 @@ void r600_pcie_gart_tlb_flush(struct radeon_device *rdev) * method for them. */ WREG32(HDP_DEBUG1, 0); - tmp = readl((void __iomem *)ptr); + if (ptr) { + tmp = readl((void __iomem *)ptr); + } } else WREG32(R_005480_HDP_MEM_COHERENCY_FLUSH_CNTL, 0x1);