From patchwork Sun Sep 22 01:18:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Ivanov X-Patchwork-Id: 2923351 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 614EE9F1BF for ; Sun, 22 Sep 2013 01:19:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A69B204C7 for ; Sun, 22 Sep 2013 01:19:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 26DAE204C4 for ; Sun, 22 Sep 2013 01:19:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1C85CE61EA for ; Sat, 21 Sep 2013 18:19:00 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from forward4l.mail.yandex.net (forward4l.mail.yandex.net [84.201.143.137]) by gabe.freedesktop.org (Postfix) with ESMTP id 4A8AFE5ED8 for ; Sat, 21 Sep 2013 18:18:45 -0700 (PDT) Received: from smtp12.mail.yandex.net (smtp12.mail.yandex.net [95.108.131.191]) by forward4l.mail.yandex.net (Yandex) with ESMTP id 66BAF1440D77; Sun, 22 Sep 2013 05:18:43 +0400 (MSK) Received: from smtp12.mail.yandex.net (localhost [127.0.0.1]) by smtp12.mail.yandex.net (Yandex) with ESMTP id 0ED2816A05EA; Sun, 22 Sep 2013 05:18:42 +0400 (MSK) Received: from relay.gero.in (relay.gero.in [77.37.212.15]) by smtp12.mail.yandex.net (nwsmtp/Yandex) with ESMTP id xno64vYnxJ-IgH8qIwm; Sun, 22 Sep 2013 05:18:42 +0400 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: [PATCH 1/1] drm/radeon: Don't run tests when underlying memory was uninitialized From: Alex Ivanov In-Reply-To: Date: Sun, 22 Sep 2013 05:18:40 +0400 Message-Id: <81629B7E-5291-4566-89BD-5520C3D6A7CA@p0n4ik.tk> References: To: Alex Deucher X-Mailer: Apple Mail (2.1510) Cc: Maling list - DRI developers 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: , 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=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 20.09.2013, ? 22:33, Alex Deucher ???????(?): > On Fri, Sep 20, 2013 at 9:36 AM, Alex Ivanov wrote: >> Prevent NULL pointer dereference in case when radeon_ring_fini() did it's job. >> >> Reading of r100_cp_ring_info and radeon_ring_gfx debugfs entries will lead to a KP if ring buffer was deallocated, e.g. on failed ring test. >> Seen on PA-RISC machine having "radeon: ring test failed (scratch(0x8504)=0xCAFEDEAD)" issue. >> >> Signed-off-by: Alex Ivanov > > Applied. thanks! > > Alex One more. Thank you! Signed-off-by: Alex Ivanov diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index e29faa7..e6d1897 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -1319,6 +1319,11 @@ int radeon_device_init(struct radeon_device *rdev, if (r) return r; } + /* If ring buffer or PCI GART got uninitialized, we should't run tests */ + if (!rdev->accel_working) { + DRM_INFO("radeon: acceleration disabled, skipping tests and benchmark.\n"); + return 0; + } if ((radeon_testing & 1)) { radeon_test_moves(rdev); }