* [PATCH] drm/radeon: don't add files at control minor debugfs directory
@ 2016-12-03 14:47 Nicolai Stange
2016-12-05 7:27 ` Daniel Vetter
0 siblings, 1 reply; 21+ messages in thread
From: Nicolai Stange @ 2016-12-03 14:47 UTC (permalink / raw)
To: Alex Deucher, Christian König
Cc: David Airlie, Daniel Vetter, dri-devel, linux-kernel,
Nicolai Stange
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
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH] drm/radeon: don't add files at control minor debugfs directory 2016-12-03 14:47 [PATCH] drm/radeon: don't add files at control minor debugfs directory Nicolai Stange @ 2016-12-05 7:27 ` Daniel Vetter 0 siblings, 0 replies; 21+ messages in thread From: Daniel Vetter @ 2016-12-05 7:27 UTC (permalink / raw) To: Nicolai Stange Cc: Alex Deucher, Daniel Vetter, Christian König, dri-devel, linux-kernel On Sat, Dec 03, 2016 at 03:47:00PM +0100, Nicolai Stange wrote: > 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> Applied to drm-misc with Dave's irc ack, thanks for your patch. -Daniel > --- > 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 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/radeon: don't add files at control minor debugfs directory @ 2016-12-05 7:27 ` Daniel Vetter 0 siblings, 0 replies; 21+ messages in thread From: Daniel Vetter @ 2016-12-05 7:27 UTC (permalink / raw) To: Nicolai Stange Cc: Alex Deucher, Christian König, Daniel Vetter, linux-kernel, dri-devel On Sat, Dec 03, 2016 at 03:47:00PM +0100, Nicolai Stange wrote: > 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> Applied to drm-misc with Dave's irc ack, thanks for your patch. -Daniel > --- > 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 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/radeon: don't add files at control minor debugfs directory 2016-12-05 7:27 ` Daniel Vetter @ 2016-12-05 7:42 ` Christian König -1 siblings, 0 replies; 21+ messages in thread From: Christian König @ 2016-12-05 7:42 UTC (permalink / raw) To: Nicolai Stange, Alex Deucher, Daniel Vetter, linux-kernel, dri-devel Am 05.12.2016 um 08:27 schrieb Daniel Vetter: > On Sat, Dec 03, 2016 at 03:47:00PM +0100, Nicolai Stange wrote: >> 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> > Applied to drm-misc with Dave's irc ack, thanks for your patch. If it's still worth it the patch is Reviewed-by: Christian König <christian.koenig@amd.com>. On the other hand when ->control is always NULL, why do we still have ->control anyway? And BTW: Please double check the other drivers as well. Regards, Christian. > -Daniel > >> --- >> 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 >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/radeon: don't add files at control minor debugfs directory @ 2016-12-05 7:42 ` Christian König 0 siblings, 0 replies; 21+ messages in thread From: Christian König @ 2016-12-05 7:42 UTC (permalink / raw) To: Nicolai Stange, Alex Deucher, Daniel Vetter, linux-kernel, dri-devel Am 05.12.2016 um 08:27 schrieb Daniel Vetter: > On Sat, Dec 03, 2016 at 03:47:00PM +0100, Nicolai Stange wrote: >> 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> > Applied to drm-misc with Dave's irc ack, thanks for your patch. If it's still worth it the patch is Reviewed-by: Christian König <christian.koenig@amd.com>. On the other hand when ->control is always NULL, why do we still have ->control anyway? And BTW: Please double check the other drivers as well. Regards, Christian. > -Daniel > >> --- >> 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 >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/radeon: don't add files at control minor debugfs directory 2016-12-05 7:42 ` Christian König @ 2016-12-05 8:04 ` Daniel Vetter -1 siblings, 0 replies; 21+ messages in thread From: Daniel Vetter @ 2016-12-05 8:04 UTC (permalink / raw) To: Christian König Cc: Alex Deucher, Daniel Vetter, Nicolai Stange, linux-kernel, dri-devel On Mon, Dec 05, 2016 at 08:42:49AM +0100, Christian König wrote: > Am 05.12.2016 um 08:27 schrieb Daniel Vetter: > > On Sat, Dec 03, 2016 at 03:47:00PM +0100, Nicolai Stange wrote: > > > 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> > > Applied to drm-misc with Dave's irc ack, thanks for your patch. > > If it's still worth it the patch is Reviewed-by: Christian König > <christian.koenig@amd.com>. > > On the other hand when ->control is always NULL, why do we still have > ->control anyway? I'm chicken and didn't want to mass-delete code from the start. But yeah after a few kernel releases to make sure no one noticed the removal of control nodes we can garbage collected. I guess I've been bitten a few too many times when trying to remove old stuff ;-) > And BTW: Please double check the other drivers as well. Yeah, I've done a full audit, only qxl turned up to have similar code. Already merged with Dave's irc ack. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/radeon: don't add files at control minor debugfs directory @ 2016-12-05 8:04 ` Daniel Vetter 0 siblings, 0 replies; 21+ messages in thread From: Daniel Vetter @ 2016-12-05 8:04 UTC (permalink / raw) To: Christian König Cc: Nicolai Stange, Alex Deucher, Daniel Vetter, linux-kernel, dri-devel On Mon, Dec 05, 2016 at 08:42:49AM +0100, Christian König wrote: > Am 05.12.2016 um 08:27 schrieb Daniel Vetter: > > On Sat, Dec 03, 2016 at 03:47:00PM +0100, Nicolai Stange wrote: > > > 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> > > Applied to drm-misc with Dave's irc ack, thanks for your patch. > > If it's still worth it the patch is Reviewed-by: Christian König > <christian.koenig@amd.com>. > > On the other hand when ->control is always NULL, why do we still have > ->control anyway? I'm chicken and didn't want to mass-delete code from the start. But yeah after a few kernel releases to make sure no one noticed the removal of control nodes we can garbage collected. I guess I've been bitten a few too many times when trying to remove old stuff ;-) > And BTW: Please double check the other drivers as well. Yeah, I've done a full audit, only qxl turned up to have similar code. Already merged with Dave's irc ack. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/radeon: don't add files at control minor debugfs directory 2016-12-05 7:42 ` Christian König @ 2016-12-05 8:39 ` Nicolai Stange -1 siblings, 0 replies; 21+ messages in thread From: Nicolai Stange @ 2016-12-05 8:39 UTC (permalink / raw) To: Christian König Cc: Nicolai Stange, Alex Deucher, Daniel Vetter, linux-kernel, dri-devel Christian König <christian.koenig@amd.com> writes: > Am 05.12.2016 um 08:27 schrieb Daniel Vetter: >> On Sat, Dec 03, 2016 at 03:47:00PM +0100, Nicolai Stange wrote: >>> 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> >> Applied to drm-misc with Dave's irc ack, thanks for your patch. > > If it's still worth it the patch is Reviewed-by: Christian König > <christian.koenig@amd.com>. > > On the other hand when ->control is always NULL, why do we still have > ->control anyway? Yes, I was wondering about that, too. Quoting from 8a357d10043c ("drm: Nerf DRM_CONTROL nodes"): Since I don't like dead uabi, let's remove it. But since this would be a really big change I think it's better to start out small by simply not registering anything. We can garbage-collect the dead code later on, once we're sure it's really not used anywhere. I'd too prefer compile time errors by purging ->control here. Daniel? > And BTW: Please double check the other drivers as well. # git grep '\->control' -- drivers/gpu/ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control->debugfs_root, drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control); drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control); Oops. drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c: ib_packet->control = (1 << 23) | (1 << 31) | drivers/gpu/drm/drm_drv.c: return &dev->control; That's drm_minor_get_slot(dev, type), but grepping for DRM_MINOR_CONTROL doesn't yield anything -> dead code. drivers/gpu/drm/gma500/psb_intel_sdvo.c: switch (sdvo->controlled_output) { drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0; drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1; drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= type; drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1; drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1; drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output = 0; drivers/gpu/drm/i915/intel_sdvo.c: switch (sdvo->controlled_output) { drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0; drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1; drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= type; drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1; drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1; drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output = 0; drivers/gpu/drm/msm/msm_debugfs.c: ret = late_init_minor(dev->control); Not an oops but dead code. drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control->debugfs_root, drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control); drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control); Oops. I'll send compile-only tested patches either tonight or tomorrow. Shall they cover the oopses only or the dead code as well? Thanks, Nicolai ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/radeon: don't add files at control minor debugfs directory @ 2016-12-05 8:39 ` Nicolai Stange 0 siblings, 0 replies; 21+ messages in thread From: Nicolai Stange @ 2016-12-05 8:39 UTC (permalink / raw) To: Christian König Cc: Nicolai Stange, Alex Deucher, Daniel Vetter, linux-kernel, dri-devel Christian König <christian.koenig@amd.com> writes: > Am 05.12.2016 um 08:27 schrieb Daniel Vetter: >> On Sat, Dec 03, 2016 at 03:47:00PM +0100, Nicolai Stange wrote: >>> 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> >> Applied to drm-misc with Dave's irc ack, thanks for your patch. > > If it's still worth it the patch is Reviewed-by: Christian König > <christian.koenig@amd.com>. > > On the other hand when ->control is always NULL, why do we still have > ->control anyway? Yes, I was wondering about that, too. Quoting from 8a357d10043c ("drm: Nerf DRM_CONTROL nodes"): Since I don't like dead uabi, let's remove it. But since this would be a really big change I think it's better to start out small by simply not registering anything. We can garbage-collect the dead code later on, once we're sure it's really not used anywhere. I'd too prefer compile time errors by purging ->control here. Daniel? > And BTW: Please double check the other drivers as well. # git grep '\->control' -- drivers/gpu/ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control->debugfs_root, drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control); drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control); Oops. drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c: ib_packet->control = (1 << 23) | (1 << 31) | drivers/gpu/drm/drm_drv.c: return &dev->control; That's drm_minor_get_slot(dev, type), but grepping for DRM_MINOR_CONTROL doesn't yield anything -> dead code. drivers/gpu/drm/gma500/psb_intel_sdvo.c: switch (sdvo->controlled_output) { drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0; drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1; drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= type; drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1; drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1; drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output = 0; drivers/gpu/drm/i915/intel_sdvo.c: switch (sdvo->controlled_output) { drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0; drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1; drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= type; drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1; drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1; drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output = 0; drivers/gpu/drm/msm/msm_debugfs.c: ret = late_init_minor(dev->control); Not an oops but dead code. drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control->debugfs_root, drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control); drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control); Oops. I'll send compile-only tested patches either tonight or tomorrow. Shall they cover the oopses only or the dead code as well? Thanks, Nicolai ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/radeon: don't add files at control minor debugfs directory 2016-12-05 8:39 ` Nicolai Stange @ 2016-12-05 8:48 ` Christian König -1 siblings, 0 replies; 21+ messages in thread From: Christian König @ 2016-12-05 8:48 UTC (permalink / raw) To: Nicolai Stange; +Cc: Alex Deucher, Daniel Vetter, linux-kernel, dri-devel Am 05.12.2016 um 09:39 schrieb Nicolai Stange: > Christian König <christian.koenig@amd.com> writes: > >> Am 05.12.2016 um 08:27 schrieb Daniel Vetter: >>> On Sat, Dec 03, 2016 at 03:47:00PM +0100, Nicolai Stange wrote: >>>> 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> >>> Applied to drm-misc with Dave's irc ack, thanks for your patch. >> If it's still worth it the patch is Reviewed-by: Christian König >> <christian.koenig@amd.com>. >> >> On the other hand when ->control is always NULL, why do we still have >> ->control anyway? > Yes, I was wondering about that, too. > > Quoting from 8a357d10043c ("drm: Nerf DRM_CONTROL nodes"): > > Since I don't like dead uabi, let's remove it. But since this would be > a really big change I think it's better to start out small by simply > not registering anything. We can garbage-collect the dead code later > on, once we're sure it's really not used anywhere. > > I'd too prefer compile time errors by purging ->control here. Daniel? Seconded. > > >> And BTW: Please double check the other drivers as well. > # git grep '\->control' -- drivers/gpu/ > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control->debugfs_root, > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control); > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control); > > Oops. Yeah, that's what I expected as well but Daniel said it would only affect qxl. > > drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c: ib_packet->control = (1 << 23) | (1 << 31) | > drivers/gpu/drm/drm_drv.c: return &dev->control; > > That's drm_minor_get_slot(dev, type), but grepping for DRM_MINOR_CONTROL > doesn't yield anything -> dead code. > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: switch (sdvo->controlled_output) { > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0; > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1; > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= type; > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1; > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1; > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output = 0; > drivers/gpu/drm/i915/intel_sdvo.c: switch (sdvo->controlled_output) { > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0; > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1; > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= type; > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1; > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1; > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output = 0; > drivers/gpu/drm/msm/msm_debugfs.c: ret = late_init_minor(dev->control); > > Not an oops but dead code. > > drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control->debugfs_root, > drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control); > drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control); > > Oops. > > > I'll send compile-only tested patches either tonight or tomorrow. Shall > they cover the oopses only or the dead code as well? Please start with the ops, cause we certainly will get complains about that rather fast. Regards, Christian. > > > Thanks, > > Nicolai _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/radeon: don't add files at control minor debugfs directory @ 2016-12-05 8:48 ` Christian König 0 siblings, 0 replies; 21+ messages in thread From: Christian König @ 2016-12-05 8:48 UTC (permalink / raw) To: Nicolai Stange; +Cc: Alex Deucher, Daniel Vetter, linux-kernel, dri-devel Am 05.12.2016 um 09:39 schrieb Nicolai Stange: > Christian König <christian.koenig@amd.com> writes: > >> Am 05.12.2016 um 08:27 schrieb Daniel Vetter: >>> On Sat, Dec 03, 2016 at 03:47:00PM +0100, Nicolai Stange wrote: >>>> 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> >>> Applied to drm-misc with Dave's irc ack, thanks for your patch. >> If it's still worth it the patch is Reviewed-by: Christian König >> <christian.koenig@amd.com>. >> >> On the other hand when ->control is always NULL, why do we still have >> ->control anyway? > Yes, I was wondering about that, too. > > Quoting from 8a357d10043c ("drm: Nerf DRM_CONTROL nodes"): > > Since I don't like dead uabi, let's remove it. But since this would be > a really big change I think it's better to start out small by simply > not registering anything. We can garbage-collect the dead code later > on, once we're sure it's really not used anywhere. > > I'd too prefer compile time errors by purging ->control here. Daniel? Seconded. > > >> And BTW: Please double check the other drivers as well. > # git grep '\->control' -- drivers/gpu/ > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control->debugfs_root, > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control); > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control); > > Oops. Yeah, that's what I expected as well but Daniel said it would only affect qxl. > > drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c: ib_packet->control = (1 << 23) | (1 << 31) | > drivers/gpu/drm/drm_drv.c: return &dev->control; > > That's drm_minor_get_slot(dev, type), but grepping for DRM_MINOR_CONTROL > doesn't yield anything -> dead code. > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: switch (sdvo->controlled_output) { > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0; > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1; > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= type; > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1; > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1; > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output = 0; > drivers/gpu/drm/i915/intel_sdvo.c: switch (sdvo->controlled_output) { > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0; > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1; > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= type; > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1; > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1; > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output = 0; > drivers/gpu/drm/msm/msm_debugfs.c: ret = late_init_minor(dev->control); > > Not an oops but dead code. > > drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control->debugfs_root, > drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control); > drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control); > > Oops. > > > I'll send compile-only tested patches either tonight or tomorrow. Shall > they cover the oopses only or the dead code as well? Please start with the ops, cause we certainly will get complains about that rather fast. Regards, Christian. > > > Thanks, > > Nicolai ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/radeon: don't add files at control minor debugfs directory 2016-12-05 8:48 ` Christian König @ 2016-12-05 9:11 ` Michel Dänzer -1 siblings, 0 replies; 21+ messages in thread From: Michel Dänzer @ 2016-12-05 9:11 UTC (permalink / raw) To: Christian König, Nicolai Stange Cc: Alex Deucher, Daniel Vetter, linux-kernel, dri-devel On 05/12/16 05:48 PM, Christian König wrote: > Am 05.12.2016 um 09:39 schrieb Nicolai Stange:>> >> I'll send compile-only tested patches either tonight or tomorrow. Shall >> they cover the oopses only or the dead code as well? > > Please start with the ops, cause we certainly will get complains about > that rather fast. Suspect we already did: https://bugs.freedesktop.org/show_bug.cgi?id=98915 -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/radeon: don't add files at control minor debugfs directory @ 2016-12-05 9:11 ` Michel Dänzer 0 siblings, 0 replies; 21+ messages in thread From: Michel Dänzer @ 2016-12-05 9:11 UTC (permalink / raw) To: Christian König, Nicolai Stange Cc: Alex Deucher, Daniel Vetter, linux-kernel, dri-devel On 05/12/16 05:48 PM, Christian König wrote: > Am 05.12.2016 um 09:39 schrieb Nicolai Stange:>> >> I'll send compile-only tested patches either tonight or tomorrow. Shall >> they cover the oopses only or the dead code as well? > > Please start with the ops, cause we certainly will get complains about > that rather fast. Suspect we already did: https://bugs.freedesktop.org/show_bug.cgi?id=98915 -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/radeon: don't add files at control minor debugfs directory 2016-12-05 8:48 ` Christian König @ 2016-12-05 9:51 ` Daniel Vetter -1 siblings, 0 replies; 21+ messages in thread From: Daniel Vetter @ 2016-12-05 9:51 UTC (permalink / raw) To: Christian König Cc: Alex Deucher, Daniel Vetter, Nicolai Stange, linux-kernel, dri-devel On Mon, Dec 05, 2016 at 09:48:02AM +0100, Christian König wrote: > Am 05.12.2016 um 09:39 schrieb Nicolai Stange: > > Christian König <christian.koenig@amd.com> writes: > > > > > Am 05.12.2016 um 08:27 schrieb Daniel Vetter: > > > > On Sat, Dec 03, 2016 at 03:47:00PM +0100, Nicolai Stange wrote: > > > > > 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> > > > > Applied to drm-misc with Dave's irc ack, thanks for your patch. > > > If it's still worth it the patch is Reviewed-by: Christian König > > > <christian.koenig@amd.com>. > > > > > > On the other hand when ->control is always NULL, why do we still have > > > ->control anyway? > > Yes, I was wondering about that, too. > > > > Quoting from 8a357d10043c ("drm: Nerf DRM_CONTROL nodes"): > > > > Since I don't like dead uabi, let's remove it. But since this would be > > a really big change I think it's better to start out small by simply > > not registering anything. We can garbage-collect the dead code later > > on, once we're sure it's really not used anywhere. > > > > I'd too prefer compile time errors by purging ->control here. Daniel? > > Seconded. We're super-late for 4.10, I think that'd would need to be postponened for 4.11. Not need to wait with creating the patches (drm-misc is always open), but wee need to plug the oopses first. > > > And BTW: Please double check the other drivers as well. > > # git grep '\->control' -- drivers/gpu/ > > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control->debugfs_root, > > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control); > > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control); > > > > Oops. > > Yeah, that's what I expected as well but Daniel said it would only affect > qxl. No idea why I've missed that, I guess coffee wasn't working. > > drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c: ib_packet->control = (1 << 23) | (1 << 31) | > > drivers/gpu/drm/drm_drv.c: return &dev->control; > > > > That's drm_minor_get_slot(dev, type), but grepping for DRM_MINOR_CONTROL > > doesn't yield anything -> dead code. > > > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: switch (sdvo->controlled_output) { > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0; > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1; > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= type; > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1; > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1; > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output = 0; > > drivers/gpu/drm/i915/intel_sdvo.c: switch (sdvo->controlled_output) { > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0; > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1; > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= type; > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1; > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1; > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output = 0; > > drivers/gpu/drm/msm/msm_debugfs.c: ret = late_init_minor(dev->control); > > > > Not an oops but dead code. > > > > drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control->debugfs_root, > > drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control); > > drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control); > > > > Oops. > > > > > > I'll send compile-only tested patches either tonight or tomorrow. Shall > > they cover the oopses only or the dead code as well? > > Please start with the ops, cause we certainly will get complains about that > rather fast. I sent out qxl already, and yes oops patches first pls. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/radeon: don't add files at control minor debugfs directory @ 2016-12-05 9:51 ` Daniel Vetter 0 siblings, 0 replies; 21+ messages in thread From: Daniel Vetter @ 2016-12-05 9:51 UTC (permalink / raw) To: Christian König Cc: Nicolai Stange, Alex Deucher, Daniel Vetter, linux-kernel, dri-devel On Mon, Dec 05, 2016 at 09:48:02AM +0100, Christian König wrote: > Am 05.12.2016 um 09:39 schrieb Nicolai Stange: > > Christian König <christian.koenig@amd.com> writes: > > > > > Am 05.12.2016 um 08:27 schrieb Daniel Vetter: > > > > On Sat, Dec 03, 2016 at 03:47:00PM +0100, Nicolai Stange wrote: > > > > > 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> > > > > Applied to drm-misc with Dave's irc ack, thanks for your patch. > > > If it's still worth it the patch is Reviewed-by: Christian König > > > <christian.koenig@amd.com>. > > > > > > On the other hand when ->control is always NULL, why do we still have > > > ->control anyway? > > Yes, I was wondering about that, too. > > > > Quoting from 8a357d10043c ("drm: Nerf DRM_CONTROL nodes"): > > > > Since I don't like dead uabi, let's remove it. But since this would be > > a really big change I think it's better to start out small by simply > > not registering anything. We can garbage-collect the dead code later > > on, once we're sure it's really not used anywhere. > > > > I'd too prefer compile time errors by purging ->control here. Daniel? > > Seconded. We're super-late for 4.10, I think that'd would need to be postponened for 4.11. Not need to wait with creating the patches (drm-misc is always open), but wee need to plug the oopses first. > > > And BTW: Please double check the other drivers as well. > > # git grep '\->control' -- drivers/gpu/ > > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control->debugfs_root, > > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control); > > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: adev->ddev->control); > > > > Oops. > > Yeah, that's what I expected as well but Daniel said it would only affect > qxl. No idea why I've missed that, I guess coffee wasn't working. > > drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c: ib_packet->control = (1 << 23) | (1 << 31) | > > drivers/gpu/drm/drm_drv.c: return &dev->control; > > > > That's drm_minor_get_slot(dev, type), but grepping for DRM_MINOR_CONTROL > > doesn't yield anything -> dead code. > > > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: switch (sdvo->controlled_output) { > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0; > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1; > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= type; > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1; > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1; > > drivers/gpu/drm/gma500/psb_intel_sdvo.c: psb_intel_sdvo->controlled_output = 0; > > drivers/gpu/drm/i915/intel_sdvo.c: switch (sdvo->controlled_output) { > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0; > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1; > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= type; > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1; > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1; > > drivers/gpu/drm/i915/intel_sdvo.c: intel_sdvo->controlled_output = 0; > > drivers/gpu/drm/msm/msm_debugfs.c: ret = late_init_minor(dev->control); > > > > Not an oops but dead code. > > > > drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control->debugfs_root, > > drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control); > > drivers/gpu/drm/qxl/qxl_debugfs.c: qdev->ddev->control); > > > > Oops. > > > > > > I'll send compile-only tested patches either tonight or tomorrow. Shall > > they cover the oopses only or the dead code as well? > > Please start with the ops, cause we certainly will get complains about that > rather fast. I sent out qxl already, and yes oops patches first pls. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH] drm/amdgpu: don't add files at control minor debugfs directory 2016-12-05 8:48 ` Christian König ` (2 preceding siblings ...) (?) @ 2016-12-05 20:30 ` Nicolai Stange 2016-12-05 20:33 ` Deucher, Alexander -1 siblings, 1 reply; 21+ messages in thread From: Nicolai Stange @ 2016-12-05 20:30 UTC (permalink / raw) To: Daniel Vetter Cc: Alex Deucher, Christian König, Michel Dänzer, linux-kernel, dri-devel, Nicolai Stange 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 a NULL pointer dereference. 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> --- Applicable to next-20161202. Compile-only tested. 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 deee2db..0cb3e82 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2493,9 +2493,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 @@ -2510,9 +2507,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 -- 2.10.2 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* RE: [PATCH] drm/amdgpu: don't add files at control minor debugfs directory 2016-12-05 20:30 ` [PATCH] drm/amdgpu: " Nicolai Stange @ 2016-12-05 20:33 ` Deucher, Alexander 0 siblings, 0 replies; 21+ messages in thread From: Deucher, Alexander @ 2016-12-05 20:33 UTC (permalink / raw) To: 'Nicolai Stange', Daniel Vetter Cc: Michel Dänzer, Koenig, Christian, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org > -----Original Message----- > From: Nicolai Stange [mailto:nicstange@gmail.com] > Sent: Monday, December 05, 2016 3:30 PM > To: Daniel Vetter > Cc: Deucher, Alexander; Koenig, Christian; Michel Dänzer; linux- > kernel@vger.kernel.org; dri-devel@lists.freedesktop.org; Nicolai Stange > Subject: [PATCH] drm/amdgpu: don't add files at control minor debugfs > directory > > 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 a NULL pointer > dereference. > > 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> Please add the bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98915 With that, Reviewed-by: Alex Deucher <alexander.deucher@amd.com> > --- > Applicable to next-20161202. Compile-only tested. > > 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 deee2db..0cb3e82 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -2493,9 +2493,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 > @@ -2510,9 +2507,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 > -- > 2.10.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH] drm/amdgpu: don't add files at control minor debugfs directory @ 2016-12-05 20:33 ` Deucher, Alexander 0 siblings, 0 replies; 21+ messages in thread From: Deucher, Alexander @ 2016-12-05 20:33 UTC (permalink / raw) To: 'Nicolai Stange', Daniel Vetter Cc: Koenig, Christian, Michel Dänzer, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org > -----Original Message----- > From: Nicolai Stange [mailto:nicstange@gmail.com] > Sent: Monday, December 05, 2016 3:30 PM > To: Daniel Vetter > Cc: Deucher, Alexander; Koenig, Christian; Michel Dänzer; linux- > kernel@vger.kernel.org; dri-devel@lists.freedesktop.org; Nicolai Stange > Subject: [PATCH] drm/amdgpu: don't add files at control minor debugfs > directory > > 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 a NULL pointer > dereference. > > 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> Please add the bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98915 With that, Reviewed-by: Alex Deucher <alexander.deucher@amd.com> > --- > Applicable to next-20161202. Compile-only tested. > > 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 deee2db..0cb3e82 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -2493,9 +2493,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 > @@ -2510,9 +2507,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 > -- > 2.10.2 ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/amdgpu: don't add files at control minor debugfs directory 2016-12-05 20:33 ` Deucher, Alexander (?) @ 2016-12-06 2:01 ` Mike Lothian 2016-12-06 7:17 ` Daniel Vetter -1 siblings, 1 reply; 21+ messages in thread From: Mike Lothian @ 2016-12-06 2:01 UTC (permalink / raw) To: Deucher, Alexander, Nicolai Stange, Daniel Vetter Cc: Michel Dänzer, Koenig, Christian, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org [-- Attachment #1.1: Type: text/plain, Size: 3013 bytes --] Feel free to add a tested by from myself Thanks for the fix On Mon, 5 Dec 2016 at 20:33 Deucher, Alexander <Alexander.Deucher@amd.com> wrote: > > -----Original Message----- > > From: Nicolai Stange [mailto:nicstange@gmail.com] > > Sent: Monday, December 05, 2016 3:30 PM > > To: Daniel Vetter > > Cc: Deucher, Alexander; Koenig, Christian; Michel Dänzer; linux- > > kernel@vger.kernel.org; dri-devel@lists.freedesktop.org; Nicolai Stange > > Subject: [PATCH] drm/amdgpu: don't add files at control minor debugfs > > directory > > > > 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 a NULL pointer > > dereference. > > > > 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> > > Please add the bugzilla: > https://bugs.freedesktop.org/show_bug.cgi?id=98915 > With that, > Reviewed-by: Alex Deucher <alexander.deucher@amd.com> > > > --- > > Applicable to next-20161202. Compile-only tested. > > > > 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 deee2db..0cb3e82 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > > @@ -2493,9 +2493,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 > > @@ -2510,9 +2507,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 > > -- > > 2.10.2 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel > [-- Attachment #1.2: Type: text/html, Size: 5797 bytes --] [-- Attachment #2: Type: text/plain, Size: 160 bytes --] _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/amdgpu: don't add files at control minor debugfs directory 2016-12-06 2:01 ` Mike Lothian @ 2016-12-06 7:17 ` Daniel Vetter 0 siblings, 0 replies; 21+ messages in thread From: Daniel Vetter @ 2016-12-06 7:17 UTC (permalink / raw) To: Mike Lothian Cc: Michel Dänzer, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Nicolai Stange, Deucher, Alexander, Daniel Vetter, Koenig, Christian On Tue, Dec 06, 2016 at 02:01:37AM +0000, Mike Lothian wrote: > Feel free to add a tested by from myself > > Thanks for the fix > > On Mon, 5 Dec 2016 at 20:33 Deucher, Alexander <Alexander.Deucher@amd.com> > wrote: > > > > -----Original Message----- > > > From: Nicolai Stange [mailto:nicstange@gmail.com] > > > Sent: Monday, December 05, 2016 3:30 PM > > > To: Daniel Vetter > > > Cc: Deucher, Alexander; Koenig, Christian; Michel Dänzer; linux- > > > kernel@vger.kernel.org; dri-devel@lists.freedesktop.org; Nicolai Stange > > > Subject: [PATCH] drm/amdgpu: don't add files at control minor debugfs > > > directory > > > > > > 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 a NULL pointer > > > dereference. > > > > > > 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> > > > > Please add the bugzilla: > > https://bugs.freedesktop.org/show_bug.cgi?id=98915 > > With that, > > Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Applied to drm-misc, thanks for catching this and sorry for the fallout I caused. -Daniel > > > > > --- > > > Applicable to next-20161202. Compile-only tested. > > > > > > 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 deee2db..0cb3e82 100644 > > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > > > @@ -2493,9 +2493,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 > > > @@ -2510,9 +2507,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 > > > -- > > > 2.10.2 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] drm/amdgpu: don't add files at control minor debugfs directory @ 2016-12-06 7:17 ` Daniel Vetter 0 siblings, 0 replies; 21+ messages in thread From: Daniel Vetter @ 2016-12-06 7:17 UTC (permalink / raw) To: Mike Lothian Cc: Deucher, Alexander, Nicolai Stange, Daniel Vetter, Michel Dänzer, Koenig, Christian, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org On Tue, Dec 06, 2016 at 02:01:37AM +0000, Mike Lothian wrote: > Feel free to add a tested by from myself > > Thanks for the fix > > On Mon, 5 Dec 2016 at 20:33 Deucher, Alexander <Alexander.Deucher@amd.com> > wrote: > > > > -----Original Message----- > > > From: Nicolai Stange [mailto:nicstange@gmail.com] > > > Sent: Monday, December 05, 2016 3:30 PM > > > To: Daniel Vetter > > > Cc: Deucher, Alexander; Koenig, Christian; Michel Dänzer; linux- > > > kernel@vger.kernel.org; dri-devel@lists.freedesktop.org; Nicolai Stange > > > Subject: [PATCH] drm/amdgpu: don't add files at control minor debugfs > > > directory > > > > > > 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 a NULL pointer > > > dereference. > > > > > > 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> > > > > Please add the bugzilla: > > https://bugs.freedesktop.org/show_bug.cgi?id=98915 > > With that, > > Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Applied to drm-misc, thanks for catching this and sorry for the fallout I caused. -Daniel > > > > > --- > > > Applicable to next-20161202. Compile-only tested. > > > > > > 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 deee2db..0cb3e82 100644 > > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > > > @@ -2493,9 +2493,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 > > > @@ -2510,9 +2507,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 > > > -- > > > 2.10.2 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2016-12-06 7:17 UTC | newest] Thread overview: 21+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-12-03 14:47 [PATCH] drm/radeon: don't add files at control minor debugfs directory Nicolai Stange 2016-12-05 7:27 ` Daniel Vetter 2016-12-05 7:27 ` Daniel Vetter 2016-12-05 7:42 ` Christian König 2016-12-05 7:42 ` Christian König 2016-12-05 8:04 ` Daniel Vetter 2016-12-05 8:04 ` Daniel Vetter 2016-12-05 8:39 ` Nicolai Stange 2016-12-05 8:39 ` Nicolai Stange 2016-12-05 8:48 ` Christian König 2016-12-05 8:48 ` Christian König 2016-12-05 9:11 ` Michel Dänzer 2016-12-05 9:11 ` Michel Dänzer 2016-12-05 9:51 ` Daniel Vetter 2016-12-05 9:51 ` Daniel Vetter 2016-12-05 20:30 ` [PATCH] drm/amdgpu: " Nicolai Stange 2016-12-05 20:33 ` Deucher, Alexander 2016-12-05 20:33 ` Deucher, Alexander 2016-12-06 2:01 ` Mike Lothian 2016-12-06 7:17 ` Daniel Vetter 2016-12-06 7:17 ` Daniel Vetter
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.