mbox series

[00/15] amdgpu: remove load and unload callbacks (v2)

Message ID 20200205154000.536145-1-alexander.deucher@amd.com (mailing list archive)
Headers show
Series amdgpu: remove load and unload callbacks (v2) | expand

Message

Alex Deucher Feb. 5, 2020, 3:39 p.m. UTC
These are deprecated and the drm will soon start warning when drivers still
use them.  It was a long and twisty road, but seems to work.

v2: Add additional patch (13/15) which should fix the crash reported by
Thomas Zimmermann.

Alex Deucher (15):
  drm/amdgpu: rename amdgpu_debugfs_preempt_cleanup
  drm/amdgpu/ttm: move debugfs init into core amdgpu debugfs
  drm/amdgpu/pm: move debugfs init into core amdgpu debugfs
  drm/amdgpu/sa: move debugfs init into core amdgpu debugfs
  drm/amdgpu/fence: move debugfs init into core amdgpu debugfs
  drm/amdgpu/gem: move debugfs init into core amdgpu debugfs
  drm/amdgpu/regs: move debugfs init into core amdgpu debugfs
  drm/amdgpu/firmware: move debugfs init into core amdgpu debugfs
  drm/amdgpu: don't call drm_connector_register for non-MST ports
  drm/amdgpu/display: move debugfs init into core amdgpu debugfs
  drm/amd/display: move dpcd debugfs members setup
  drm/amdgpu/display: add a late register connector callback
  drm/amdgpu/display: split dp connector registration
  drm/amdgpu/ring: move debugfs init into core amdgpu debugfs
  drm/amdgpu: drop legacy drm load and unload callbacks

 .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    | 11 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c   | 67 ++++++++++++++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h   |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    | 17 -----
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       | 13 +++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c     |  3 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c        |  7 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.h    |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c        |  9 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h        |  2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c      | 15 +----
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h      |  4 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c       | 14 +---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h       |  3 +
 drivers/gpu/drm/amd/amdgpu/atombios_dp.c      |  8 +--
 drivers/gpu/drm/amd/amdgpu/dce_virtual.c      |  1 -
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 26 +++----
 .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c |  3 +
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   | 13 ++--
 19 files changed, 131 insertions(+), 88 deletions(-)

Comments

Thomas Zimmermann Feb. 5, 2020, 4:23 p.m. UTC | #1
Hi

Am 05.02.20 um 16:39 schrieb Alex Deucher:
> These are deprecated and the drm will soon start warning when drivers still
> use them.  It was a long and twisty road, but seems to work.
> 
> v2: Add additional patch (13/15) which should fix the crash reported by
> Thomas Zimmermann.

I tried again, but there's still a bug.

[   10.976846]
==================================================================
[   10.984099] BUG: KASAN: null-ptr-deref in drm_dp_aux_register+0xcc/0xf0
[   10.990705] Read of size 8 at addr 0000000000000050 by task
systemd-udevd/385
[   10.997828]
[   11.000633]
==================================================================
[   11.007889] BUG: kernel NULL pointer dereference, address:
0000000000000050
[   11.014836] #PF: supervisor read access in kernel mode
[   11.019962] #PF: error_code(0x0000) - not-present page
[   11.025087] PGD 0 P4D 0
[   11.027614] Oops: 0000 [#1] SMP KASAN PTI
[   11.031614] CPU: 5 PID: 385 Comm: systemd-udevd Tainted: G    B
 E     5.5.0-1-default+ #235
[   11.040464] Hardware name: Dell Inc. OptiPlex 9020/0N4YC8, BIOS A24
10/24/2018
[   11.047671] RIP: 0010:drm_dp_aux_register+0xcc/0xf0
[   11.052536] Code: 41 5c c3 4c 89 e7 e8 53 b4 28 00 85 c0 74 eb 48 89
ef 89 44 24 04 e8 23 1d 02 00 8b 44 24 04 eb d9 48 8d 7b 50 e8 d4 98 8f
ff <48> 8b 73 50 48 85 f6 75 aa 48 89 df e8 c3 98 8f ff 48 8b 33 eb 9d
[   11.071266] RSP: 0018:ffffc90000a6f600 EFLAGS: 00010282
[   11.076480] RAX: ffff8886da438700 RBX: 0000000000000000 RCX:
dffffc0000000000
[   11.083599] RDX: 0000000000000007 RSI: 0000000000000004 RDI:
0000000000000297
[   11.090716] RBP: ffff8886c0ca8900 R08: ffffffffaf19ec71 R09:
fffffbfff6246b5d
[   11.097834] R10: fffffbfff6246b5c R11: ffffffffb1235ae3 R12:
ffff8886c0ca8908
[   11.104953] R13: ffff8886baa0d050 R14: ffff8886baa0d100 R15:
ffffffffc0bdb180
[   11.112073] FS:  00007fcdc3effdc0(0000) GS:ffff8886fc200000(0000)
knlGS:0000000000000000
[   11.120147] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   11.125878] CR2: 0000000000000050 CR3: 00000006da450006 CR4:
00000000001606e0
[   11.132997] Call Trace:
[   11.135441]  drm_connector_register.part.0+0x92/0xe0
[   11.140396]  drm_connector_register_all+0xb9/0x110
[   11.145178]  ? drm_connector_unregister_all+0xc0/0xc0
[   11.150221]  drm_modeset_register_all+0x5b/0x70
[   11.154742]  drm_dev_register+0x1cd/0x210
[   11.158886]  amdgpu_pci_probe+0x142/0x1d0 [amdgpu]
[   11.163809]  ? amdgpu_pmops_runtime_idle+0xf0/0xf0 [amdgpu]
[   11.169371]  local_pci_probe+0x74/0xc0
[   11.173115]  pci_device_probe+0x1c9/0x2d0
[   11.177115]  ? pci_device_remove+0x180/0x180
[   11.181378]  ? sysfs_do_create_link_sd.isra.0+0x74/0xd0
[   11.186595]  really_probe+0x184/0x530
[   11.190263]  driver_probe_device+0x119/0x180
[   11.194526]  device_driver_attach+0x87/0x90
[   11.198701]  ? device_driver_attach+0x90/0x90
[   11.203049]  __driver_attach+0xb0/0x1a0
[   11.206877]  ? device_driver_attach+0x90/0x90
[   11.211226]  bus_for_each_dev+0xdd/0x120
[   11.215141]  ? subsys_dev_iter_exit+0x10/0x10
[   11.219493]  bus_add_driver+0x22c/0x2e0
[   11.223321]  driver_register+0xd8/0x160
[   11.227148]  ? 0xffffffffc0d8f000
[   11.230456]  do_one_initcall+0xbd/0x3c0
[   11.234283]  ? trace_event_raw_event_initcall_finish+0x120/0x120
[   11.240275]  ? rcu_read_lock_sched_held+0x85/0x90
[   11.244970]  ? rcu_read_lock_bh_held+0xa0/0xa0
[   11.249404]  ? debug_lockdep_rcu_enabled.part.0+0x16/0x30
[   11.254792]  ? kmem_cache_alloc_trace+0x51e/0x6b0
[   11.259487]  ? kasan_unpoison_shadow+0x33/0x40
[   11.263924]  do_init_module+0xfd/0x390
[   11.267664]  load_module+0x255b/0x2910
[   11.271415]  ? layout_and_allocate+0x850/0x850
[   11.275849]  ? ima_post_read_file+0x141/0x150
[   11.280197]  ? ima_read_file+0x10/0x10
[   11.283938]  ? kernel_read+0x9b/0xc0
[   11.287513]  ? __do_sys_finit_module+0x110/0x180
[   11.292122]  __do_sys_finit_module+0x110/0x180
[   11.296558]  ? __ia32_sys_init_module+0x40/0x40
[   11.301088]  ? lockdep_hardirqs_off+0xbe/0x100
[   11.305523]  ? mark_held_locks+0x23/0xa0
[   11.309438]  ? do_syscall_64+0x14/0x2f0
[   11.313267]  do_syscall_64+0x72/0x2f0
[   11.316921]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
[   11.321960] RIP: 0033:0x7fcdc4b60059
[   11.325528] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f
05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f7 5d 0c 00 f7 d8 64 89 01 48
[   11.344260] RSP: 002b:00007ffc3abc6008 EFLAGS: 00000246 ORIG_RAX:
0000000000000139
[   11.351815] RAX: ffffffffffffffda RBX: 0000564c25e0fb30 RCX:
00007fcdc4b60059
[   11.358934] RDX: 0000000000000000 RSI: 00007fcdc47a989d RDI:
0000000000000010
[   11.366050] RBP: 0000000000020000 R08: 0000000000000000 R09:
0000564c25e0f380
[   11.373169] R10: 0000000000000010 R11: 0000000000000246 R12:
00007fcdc47a989d
[   11.380289] R13: 0000000000000000 R14: 0000564c25e42910 R15:
0000564c25e0fb30
[   11.387412] Modules linked in: sr_mod(E) crc32c_intel(E) cdrom(E)
serio_raw(E) amdgpu(E+) uas(E) usb_storage(E) amd_iommu_v2(E)
gpu_sched(E) ttm(E) wmi(E) video(E) sg(E) dm_multipath(E) dm_mod(E)
scsi_dh_rdac(E) scsi_dh_emc(E) scsi_dh)
[   11.408846] CR2: 0000000000000050
[   11.412167] ---[ end trace fc1f8e4f7508319c ]---
[   11.416798] RIP: 0010:drm_dp_aux_register+0xcc/0xf0
[   11.421673] Code: 41 5c c3 4c 89 e7 e8 53 b4 28 00 85 c0 74 eb 48 89
ef 89 44 24 04 e8 23 1d 02 00 8b 44 24 04 eb d9 48 8d 7b 50 e8 d4 98 8f
ff <48> 8b 73 50 48 85 f6 75 aa 48 89 df e8 c3 98 8f ff 48 8b 33 eb 9d
[   11.440432] RSP: 0018:ffffc90000a6f600 EFLAGS: 00010282
[   11.445668] RAX: ffff8886da438700 RBX: 0000000000000000 RCX:
dffffc0000000000
[   11.452812] RDX: 0000000000000007 RSI: 0000000000000004 RDI:
0000000000000297
[   11.459956] RBP: ffff8886c0ca8900 R08: ffffffffaf19ec71 R09:
fffffbfff6246b5d
[   11.467100] R10: fffffbfff6246b5c R11: ffffffffb1235ae3 R12:
ffff8886c0ca8908
[   11.474243] R13: ffff8886baa0d050 R14: ffff8886baa0d100 R15:
ffffffffc0bdb180
[   11.481391] FS:  00007fcdc3effdc0(0000) GS:ffff8886fc200000(0000)
knlGS:0000000000000000
[   11.489488] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   11.495244] CR2: 0000000000000050 CR3: 00000006da450006 CR4:
00000000001606e0


Best regards
Thomas


> 
> Alex Deucher (15):
>   drm/amdgpu: rename amdgpu_debugfs_preempt_cleanup
>   drm/amdgpu/ttm: move debugfs init into core amdgpu debugfs
>   drm/amdgpu/pm: move debugfs init into core amdgpu debugfs
>   drm/amdgpu/sa: move debugfs init into core amdgpu debugfs
>   drm/amdgpu/fence: move debugfs init into core amdgpu debugfs
>   drm/amdgpu/gem: move debugfs init into core amdgpu debugfs
>   drm/amdgpu/regs: move debugfs init into core amdgpu debugfs
>   drm/amdgpu/firmware: move debugfs init into core amdgpu debugfs
>   drm/amdgpu: don't call drm_connector_register for non-MST ports
>   drm/amdgpu/display: move debugfs init into core amdgpu debugfs
>   drm/amd/display: move dpcd debugfs members setup
>   drm/amdgpu/display: add a late register connector callback
>   drm/amdgpu/display: split dp connector registration
>   drm/amdgpu/ring: move debugfs init into core amdgpu debugfs
>   drm/amdgpu: drop legacy drm load and unload callbacks
> 
>  .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    | 11 ++-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c   | 67 ++++++++++++++++++-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h   |  2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    | 17 -----
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       | 13 +++-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c     |  3 -
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c        |  7 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.h    |  1 +
>  drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c        |  9 +--
>  drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h        |  2 +
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c      | 15 +----
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h      |  4 ++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c       | 14 +---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h       |  3 +
>  drivers/gpu/drm/amd/amdgpu/atombios_dp.c      |  8 +--
>  drivers/gpu/drm/amd/amdgpu/dce_virtual.c      |  1 -
>  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 26 +++----
>  .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c |  3 +
>  .../display/amdgpu_dm/amdgpu_dm_mst_types.c   | 13 ++--
>  19 files changed, 131 insertions(+), 88 deletions(-)
>