As pointed out by Daniel Vetter, we should be usinng drm_drv_uses_atomic_modeset() for determining whether or not we want to make the debugfs nodes for atomic instead of checking DRIVER_ATOMIC, as the former isn't an accurate representation of whether or not the driver is actually using atomic modesetting internally (even though it might not be exposing atomic capabilities).
Signed-off-by: Lyude Paul lyude@redhat.com Cc: Daniel Vetter daniel.vetter@ffwll.ch Cc: stable@vger.kernel.org --- drivers/gpu/drm/drm_atomic.c | 2 +- drivers/gpu/drm/drm_debugfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 3eb061e11e2e..018fcdb353d2 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -2067,7 +2067,7 @@ static void __drm_state_dump(struct drm_device *dev, struct drm_printer *p, struct drm_connector *connector; struct drm_connector_list_iter conn_iter;
- if (!drm_core_check_feature(dev, DRIVER_ATOMIC)) + if (!drm_drv_uses_atomic_modeset(dev)) return;
list_for_each_entry(plane, &config->plane_list, head) { diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index 6f28fe58f169..373bd4c2b698 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -151,7 +151,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, return ret; }
- if (drm_core_check_feature(dev, DRIVER_ATOMIC)) { + if (drm_drv_uses_atomic_modeset(dev)) { ret = drm_atomic_debugfs_init(minor); if (ret) { DRM_ERROR("Failed to create atomic debugfs files\n");
On Mon, Sep 17, 2018 at 01:37:33PM -0400, Lyude Paul wrote:
As pointed out by Daniel Vetter, we should be usinng drm_drv_uses_atomic_modeset() for determining whether or not we want to make the debugfs nodes for atomic instead of checking DRIVER_ATOMIC, as the former isn't an accurate representation of whether or not the driver is actually using atomic modesetting internally (even though it might not be exposing atomic capabilities).
Signed-off-by: Lyude Paul lyude@redhat.com
Reviewed-by: Sean Paul seanpaul@chromium.org
Cc: Daniel Vetter daniel.vetter@ffwll.ch Cc: stable@vger.kernel.org
drivers/gpu/drm/drm_atomic.c | 2 +- drivers/gpu/drm/drm_debugfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 3eb061e11e2e..018fcdb353d2 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -2067,7 +2067,7 @@ static void __drm_state_dump(struct drm_device *dev, struct drm_printer *p, struct drm_connector *connector; struct drm_connector_list_iter conn_iter;
- if (!drm_core_check_feature(dev, DRIVER_ATOMIC))
- if (!drm_drv_uses_atomic_modeset(dev)) return;
list_for_each_entry(plane, &config->plane_list, head) { diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index 6f28fe58f169..373bd4c2b698 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -151,7 +151,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, return ret; }
- if (drm_core_check_feature(dev, DRIVER_ATOMIC)) {
- if (drm_drv_uses_atomic_modeset(dev)) { ret = drm_atomic_debugfs_init(minor); if (ret) { DRM_ERROR("Failed to create atomic debugfs files\n");
-- 2.17.1
FYI, we noticed the following commit (built with gcc-6):
commit: 79ef5c1b820e59bcc240e133cd9df59b2b20415f ("[PATCH] drm/atomic: Use drm_drv_uses_atomic_modeset() for debugfs creation") url: https://github.com/0day-ci/linux/commits/Lyude-Paul/drm-atomic-Use-drm_drv_u...
in testcase: boot
on test machine: qemu-system-x86_64 -enable-kvm -cpu qemu64,+ssse3 -smp 4 -m 8G
caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):
+--------------------------------------------------------------------------------------+------------+------------+ | | ad3273d5f1 | 79ef5c1b82 | +--------------------------------------------------------------------------------------+------------+------------+ | boot_successes | 6 | 0 | | boot_failures | 2 | 6 | | BUG:kernel_hang_in_early-boot_stage,last_printk:Probing_EDD(edd=off_to_disable)...ok | 2 | 2 | | general_protection_fault:#[##] | 0 | 4 | | RIP:drm_debugfs_init | 0 | 4 | | Kernel_panic-not_syncing:Fatal_exception | 0 | 4 | +--------------------------------------------------------------------------------------+------------+------------+
[ 185.861767] [drm] Driver supports precise vblank timestamp query. [ 185.866054] [drm] Initialized vkms 1.0.0 20180514 for virtual device on minor 0 [ 185.870315] usbcore: registered new interface driver udl [ 185.872276] kasan: CONFIG_KASAN_INLINE enabled [ 185.873048] kasan: GPF could be caused by NULL-ptr deref or user memory access [ 185.874526] general protection fault: 0000 [#1] SMP KASAN PTI [ 185.875263] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.19.0-rc4-00023-g79ef5c1 #1 [ 185.875263] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014 [ 185.875263] RIP: 0010:drm_debugfs_init+0x2fd/0x510 [ 185.875263] Code: 48 c1 e9 03 80 3c 11 00 0f 85 10 02 00 00 49 8b 96 00 0b 00 00 48 b9 00 00 00 00 00 fc ff df 48 8d 7a 28 48 89 fe 48 c1 ee 03 <80> 3c 0e 00 0f 85 a8 01 00 00 48 83 7a 28 00 0f 85 ab fe ff ff e9 [ 185.882598] RSP: 0000:ffff880107f9fa90 EFLAGS: 00010206 [ 185.882598] RAX: 0000000000000000 RBX: ffff8801071da000 RCX: dffffc0000000000 [ 185.882598] RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000028 [ 185.882598] RBP: 1ffff10020ff3f54 R08: ffffed0020e3b407 R09: ffffed0020e3b406 [ 185.882598] R10: ffff8801071da037 R11: ffffed0020e3b407 R12: ffffffff86852de0 [ 185.882598] R13: 0000000000000000 R14: ffff8801d521d500 R15: 0000000000003000 [ 185.882598] FS: 0000000000000000(0000) GS:ffff8801e9e00000(0000) knlGS:0000000000000000 [ 185.882598] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 185.882598] CR2: 00000000ffffffff CR3: 0000000005624000 CR4: 00000000000006e0 [ 185.882598] Call Trace: [ 185.882598] ? __kmalloc_track_caller+0x14f/0x2e0 [ 185.882598] ? drm_debugfs_create_files+0x420/0x420 [ 185.882598] ? memcpy+0x34/0x50 [ 185.882598] ? kstrdup+0x5a/0x70 [ 185.882598] ? lock_acquired+0x3f1/0xbf0 [ 185.898672] drm_minor_register+0xa4/0x220 [ 185.898672] drm_dev_register+0x10f/0x610 [ 185.898672] drm_get_pci_dev+0x195/0x4d0 [ 185.898672] bochs_pci_probe+0x1e6/0x2f0 [ 185.898672] pci_device_probe+0x2a7/0x4b0 [ 185.898672] ? pci_device_remove+0x2c0/0x2c0 [ 185.902591] really_probe+0x4db/0x780 [ 185.902591] driver_probe_device+0xe7/0x240 [ 185.902591] __driver_attach+0x262/0x2d0 [ 185.902591] ? driver_probe_device+0x240/0x240 [ 185.902591] bus_for_each_dev+0x138/0x1d0 [ 185.902591] ? bus_remove_file+0xe0/0xe0 [ 185.902591] bus_add_driver+0x2c5/0x5e0 [ 185.902591] ? qxl_init+0x7b/0x7b [ 185.902591] driver_register+0x1b7/0x420 [ 185.902591] bochs_init+0x33/0x3e [ 185.902591] do_one_initcall+0x11b/0x389 [ 185.902591] ? start_kernel+0x769/0x769 [ 185.902591] ? lock_downgrade+0x660/0x660 [ 185.902591] ? do_early_param+0x124/0x124 [ 185.902591] kernel_init_freeable+0x4c1/0x579 [ 185.902591] ? rest_init+0x130/0x130 [ 185.918576] kernel_init+0x14/0x190 [ 185.918576] ? _raw_spin_unlock_irq+0x29/0x70 [ 185.918576] ? rest_init+0x130/0x130 [ 185.918576] ret_from_fork+0x24/0x30 [ 185.932602] ---[ end trace 14d3235039b65adf ]--- [ 185.934465] RIP: 0010:drm_debugfs_init+0x2fd/0x510 [ 185.936354] Code: 48 c1 e9 03 80 3c 11 00 0f 85 10 02 00 00 49 8b 96 00 0b 00 00 48 b9 00 00 00 00 00 fc ff df 48 8d 7a 28 48 89 fe 48 c1 ee 03 <80> 3c 0e 00 0f 85 a8 01 00 00 48 83 7a 28 00 0f 85 ab fe ff ff e9 [ 185.949797] RSP: 0000:ffff880107f9fa90 EFLAGS: 00010206 [ 185.950782] RAX: 0000000000000000 RBX: ffff8801071da000 RCX: dffffc0000000000 [ 185.952070] RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000028 [ 185.953367] RBP: 1ffff10020ff3f54 R08: ffffed0020e3b407 R09: ffffed0020e3b406 [ 185.954667] R10: ffff8801071da037 R11: ffffed0020e3b407 R12: ffffffff86852de0 [ 185.955950] R13: 0000000000000000 R14: ffff8801d521d500 R15: 0000000000003000 [ 185.957247] FS: 0000000000000000(0000) GS:ffff8801e9e00000(0000) knlGS:0000000000000000 [ 185.958712] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 185.959753] CR2: 00000000ffffffff CR3: 0000000005624000 CR4: 00000000000006e0 [ 185.961037] Kernel panic - not syncing: Fatal exception [ 185.962695] Kernel Offset: disabled
Elapsed time: 190
#!/bin/bash
To reproduce:
git clone https://github.com/intel/lkp-tests.git cd lkp-tests bin/lkp qemu -k <bzImage> job-script # job-script is attached in this email
Thanks, lkp
linux-stable-mirror@lists.linaro.org