From patchwork Mon Dec 5 20:07:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9461441 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3C05B60236 for ; Mon, 5 Dec 2016 20:07:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EA3927F80 for ; Mon, 5 Dec 2016 20:07:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23A6527FAC; Mon, 5 Dec 2016 20:07:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D18D027F80 for ; Mon, 5 Dec 2016 20:07:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA4C689FAC; Mon, 5 Dec 2016 20:07:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt0-x243.google.com (mail-qt0-x243.google.com [IPv6:2607:f8b0:400d:c0d::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2B21889FAC; Mon, 5 Dec 2016 20:07:46 +0000 (UTC) Received: by mail-qt0-x243.google.com with SMTP id n6so37435034qtd.0; Mon, 05 Dec 2016 12:07:46 -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; bh=obBJ5ru3S6ZyowVFvL2HZPVbHs07RRcFMKpa4i8guUk=; b=NydCqsroOI/3vtbcEZRpl7bufVuDsRBQJ8U4toUR+TAYaetYVX4hzcJ4sBdqnh3JDM M1dwh65vGu9CPwuNOoDlTEiF10MHV/EgsxDpOFnkkBRu5meztJDP0LPl8Cg4wc32PzO4 PSm9YWkiBpivcxe79YT7IcKUxXntBXD9O+VWezWjrZRlwjeUd+RouGFXg0iR6YK72jFz AcYKskkdQI6KqCIOq56OGuh7OI+w6z7CyscnTbAe+ixEtOzIsB4j029TR/UyzhxZAzkH KfsOfN8QeSimfHmVP3Ux8xKTES+KfrETnhVbnlF2neqGeReqG91DwLhCNOijm8s4TpUx NP2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=obBJ5ru3S6ZyowVFvL2HZPVbHs07RRcFMKpa4i8guUk=; b=NKx0+1vZJxaKfLl8cOE6ks4Fd0cjYpKSV3XK72gw57h9r6l8UEFpZ8gq54ma1zod1g ig1fzlJQsw0Z7kMuNOhY1eH/KrSahOzbBCa2LvkwClrS/DouN79p37fad+HN+OZhY5yA MBBfHpvq6sOihk3H12eVyNcOIlTroBr7knvE4OXPcTEPG5Wt92ymVZNc0YqBB9cNcgd7 SfZEeHky7g2YzTT3x0DGyGsC3Dogt23ohdaDkrDNBRIrQVUStBmhi0D9TYAqgalKFtrE pz6g8mrHqjgg/bxoK9DTWvcnrOP71omlQG2C/vCwj4EOp9Q4w48i/0FdXsdxI3PDfU5d 5woQ== X-Gm-Message-State: AKaTC01w13E2/vpn9i1lqVHrL+YIBgL2mLDoZxTswDIu344Oaa7hwlLAtGKLiXUc7dTffg== X-Received: by 10.200.40.66 with SMTP id 2mr51439051qtr.287.1480968465034; Mon, 05 Dec 2016 12:07:45 -0800 (PST) Received: from cm.localdomain (va-67-76-166-195.sta.embarqhsd.net. [67.76.166.195]) by smtp.gmail.com with ESMTPSA id d127sm10210002qkf.34.2016.12.05.12.07.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Dec 2016 12:07:44 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/amdgpu: don't add files at control minor debugfs directory Date: Mon, 5 Dec 2016 15:07:38 -0500 Message-Id: <1480968458-2270-1-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 Cc: Alex Deucher 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Since commit 8a357d10043c ("drm: Nerf DRM_CONTROL nodes"), a struct drm_device's ->control member is always NULL. In the case of CONFIG_DEBUG_FS=y, amdgpu_debugfs_add_files() accesses ->control->debugfs_root though. This results in the following Oops: [ 9.627636] BUG: unable to handle kernel NULL pointer dereference at 0000000000000018 [ 9.628274] IP: amdgpu_debugfs_add_files+0x8d/0x100 [amdgpu] [ 9.628867] PGD 2514c7067 [ 9.628876] PUD 2514c8067 [ 9.629448] PMD 0 [ 9.630026] Oops: 0000 [#1] PREEMPT SMP [...] [ 9.639906] Call Trace: [ 9.640538] amdgpu_fence_driver_init+0x1e/0x40 [amdgpu] [ 9.641186] amdgpu_device_init+0xa6d/0x1410 [amdgpu] [ 9.641900] ? kmalloc_order_trace+0x2e/0x100 [ 9.642587] amdgpu_driver_load_kms+0x5b/0x200 [amdgpu] [ 9.643355] drm_dev_register+0xa7/0xd0 [ 9.644016] drm_get_pci_dev+0xde/0x1d0 [ 9.644659] amdgpu_pci_probe+0xbe/0xf0 [amdgpu] [...] Fix this by omitting the drm_debugfs_create_files() call for the control minor debugfs directory which is now non-existent anyway. Port of Nicolai Stange's radeon patch to amdgpu. bug: https://bugs.freedesktop.org/show_bug.cgi?id=98915 Fixes: 8a357d10043c ("drm: Nerf DRM_CONTROL nodes") Signed-off-by: Alex Deucher Reviewed-by: Michel Dänzer Reviewed-by: Christian König . Tested-by: Shawn Starr --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 4701d94..a578540 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2512,9 +2512,6 @@ int amdgpu_debugfs_add_files(struct amdgpu_device *adev, adev->debugfs_count = i; #if defined(CONFIG_DEBUG_FS) drm_debugfs_create_files(files, nfiles, - adev->ddev->control->debugfs_root, - adev->ddev->control); - drm_debugfs_create_files(files, nfiles, adev->ddev->primary->debugfs_root, adev->ddev->primary); #endif @@ -2529,9 +2526,6 @@ static void amdgpu_debugfs_remove_files(struct amdgpu_device *adev) for (i = 0; i < adev->debugfs_count; i++) { drm_debugfs_remove_files(adev->debugfs[i].files, adev->debugfs[i].num_files, - adev->ddev->control); - drm_debugfs_remove_files(adev->debugfs[i].files, - adev->debugfs[i].num_files, adev->ddev->primary); } #endif