mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolai Stange <nicstange@gmail.com>
To: "Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel.vetter@intel.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Nicolai Stange <nicstange@gmail.com>
Subject: [PATCH] drm/radeon: don't add files at control minor debugfs directory
Date: Sat,  3 Dec 2016 15:47:00 +0100	[thread overview]
Message-ID: <20161203144700.2307-1-nicstange@gmail.com> (raw)

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, radeon_debugfs_add_files() accesses
->control->debugfs_root though. This results in the following Oops:

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
  IP: radeon_debugfs_add_files+0x90/0x100 [radeon]
  PGD 0
  Oops: 0000 [#1] SMP
  [...]
  Call Trace:
   ? work_on_cpu+0xb0/0xb0
   radeon_fence_driver_init+0x120/0x150 [radeon]
   si_init+0x122/0xd50 [radeon]
   ? _raw_spin_unlock_irq+0x2c/0x40
   ? device_pm_check_callbacks+0xb3/0xc0
   radeon_device_init+0x958/0xda0 [radeon]
   radeon_driver_load_kms+0x9a/0x210 [radeon]
   drm_dev_register+0xa9/0xd0 [drm]
   drm_get_pci_dev+0x9c/0x1e0 [drm]
   radeon_pci_probe+0xb8/0xe0 [radeon]
  [...]

Fix this by omitting the drm_debugfs_create_files() call for the
control minor debugfs directory which is now non-existent anyway.

Fixes: 8a357d10043c ("drm: Nerf DRM_CONTROL nodes")
Signed-off-by: Nicolai Stange <nicstange@gmail.com>
---
Tested on top of next-20161202.
That 8a357d10043c ("drm: Nerf DRM_CONTROL nodes")
is in next since 20161201.

 drivers/gpu/drm/radeon/radeon_device.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 60a8920..8a1df2a 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1949,9 +1949,6 @@ int radeon_debugfs_add_files(struct radeon_device *rdev,
 	rdev->debugfs_count = i;
 #if defined(CONFIG_DEBUG_FS)
 	drm_debugfs_create_files(files, nfiles,
-				 rdev->ddev->control->debugfs_root,
-				 rdev->ddev->control);
-	drm_debugfs_create_files(files, nfiles,
 				 rdev->ddev->primary->debugfs_root,
 				 rdev->ddev->primary);
 #endif
@@ -1966,9 +1963,6 @@ static void radeon_debugfs_remove_files(struct radeon_device *rdev)
 	for (i = 0; i < rdev->debugfs_count; i++) {
 		drm_debugfs_remove_files(rdev->debugfs[i].files,
 					 rdev->debugfs[i].num_files,
-					 rdev->ddev->control);
-		drm_debugfs_remove_files(rdev->debugfs[i].files,
-					 rdev->debugfs[i].num_files,
 					 rdev->ddev->primary);
 	}
 #endif
-- 
2.10.2

             reply	other threads:[~2016-12-03 14:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-03 14:47 Nicolai Stange [this message]
2016-12-05  7:27 ` Daniel Vetter
2016-12-05  7:42   ` Christian König
2016-12-05  8:04     ` Daniel Vetter
2016-12-05  8:39     ` Nicolai Stange
2016-12-05  8:48       ` Christian König
2016-12-05  9:11         ` Michel Dänzer
2016-12-05  9:51         ` Daniel Vetter
2016-12-05 20:30         ` [PATCH] drm/amdgpu: " Nicolai Stange
2016-12-05 20:33           ` Deucher, Alexander
     [not found]             ` <CAHbf0-EBX8vZJtA-C=K-ETsdOJbAtLiLiFSsSzA=c8fjaV5HCA@mail.gmail.com>
2016-12-06  7:17               ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161203144700.2307-1-nicstange@gmail.com \
    --to=nicstange@gmail.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome