Bug 212311 - amdgpu DCN callis sleeping function in illegal context
Summary: amdgpu DCN callis sleeping function in illegal context
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(DRI - non Intel) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_video-dri
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-17 10:46 UTC by Nirmoy
Modified: 2021-03-17 10:50 UTC (History)
0 users

See Also:
Kernel Version: 5.11.0
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Nirmoy 2021-03-17 10:46:43 UTC
Getting below warning on boot with Navi10

[   25.204238] [drm] reserve 0x900000 from 0x81fe400000 for PSP TMR
[   25.243138] amdgpu 0000:44:00.0: amdgpu: RAS: optional ras ta ucode is not available
[   25.247390] amdgpu 0000:44:00.0: amdgpu: RAP: optional rap ta ucode is not available
[   25.247393] amdgpu 0000:44:00.0: amdgpu: SECUREDISPLAY: securedisplay ta ucode is not available
[   25.247497] amdgpu 0000:44:00.0: amdgpu: use vbios provided pptable
[   25.247499] amdgpu 0000:44:00.0: amdgpu: smc_dpm_info table revision(format.content): 4.5
[   25.283692] amdgpu 0000:44:00.0: amdgpu: SMU is initialized successfully!
[   25.283718] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:196
[   25.283735] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 373, name: kworker/6:2
[   25.283749] 2 locks held by kworker/6:2/373:
[   25.283751]  #0: ffff9e7b07c59148 ((wq_completion)events){....}-{0:0}, at: process_one_work+0x1fb/0x4f0
[   25.283760]  #1: ffffaab6441c3e68 ((work_completion)(&wfc.work)){....}-{0:0}, at: process_one_work+0x1fb/0x4f0
[   25.283768] CPU: 6 PID: 373 Comm: kworker/6:2 Tainted: G            E     5.11.0-1-default+ #171
[   25.283770] Hardware name: Gigabyte Technology Co., Ltd. X399 DESIGNARE EX/X399 DESIGNARE EX-CF, BIOS F12i 09/24/2019
[   25.283772] Workqueue: events work_for_cpu_fn
[   25.283776] Call Trace:
[   25.283780]  dump_stack+0x6b/0x83
[   25.283785]  ___might_sleep.cold+0xa7/0xb7
[   25.283789]  kmem_cache_alloc_trace+0x30a/0x360
[   25.283796]  dccg2_create+0x2d/0x80 [amdgpu]
[   25.283985]  dcn20_resource_construct+0x389/0xd30 [amdgpu]
[   25.284146]  ? fs_reclaim_release+0x46/0x80
[   25.284150]  ? dcn20_create_resource_pool+0x25/0x80 [amdgpu]
[   25.284308]  ? kmem_cache_alloc_trace+0x1a4/0x360
[   25.284310]  ? __kmalloc+0x1c1/0x3c0
[   25.284314]  dcn20_create_resource_pool+0x3c/0x80 [amdgpu]
[   25.284472]  dc_create_resource_pool+0x13f/0x1d0 [amdgpu]
[   25.284627]  dc_create+0x203/0x7b0 [amdgpu]
[   25.284783]  amdgpu_dm_init.isra.0+0x1de/0x270 [amdgpu]
[   25.284940]  ? dev_vprintk_emit+0x12c/0x150
[   25.284947]  ? dev_printk_emit+0x4e/0x65
[   25.284958]  dm_hw_init+0xe/0x20 [amdgpu]
[   25.285111]  amdgpu_device_init.cold+0x13e6/0x17ad [amdgpu]
[   25.285265]  ? pci_bus_read_config_word+0x49/0x70
[   25.285271]  amdgpu_driver_load_kms+0x64/0x260 [amdgpu]
[   25.285393]  amdgpu_pci_probe+0x122/0x1b0 [amdgpu]
[   25.285513]  local_pci_probe+0x42/0x80
[   25.285517]  work_for_cpu_fn+0x16/0x20
[   25.285520]  process_one_work+0x28c/0x4f0
[   25.285526]  worker_thread+0x20d/0x3f0
[   25.285528]  ? rescuer_thread+0x390/0x390
[   25.285531]  kthread+0x13a/0x150
[   25.285534]  ? __kthread_bind_mask+0x60/0x60
[   25.285537]  ret_from_fork+0x22/0x30
[   25.285853] [drm] Display Core initialized with v3.2.127!
Comment 1 Nirmoy 2021-03-17 10:50:56 UTC
DCN also calls into SMU which can sleep because of mutex_lock(&smu->mutex)

[    6.547189] amdgpu 0000:44:00.0: amdgpu: SMU is initialized successfully!
[    6.547217] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:935
[    6.547248] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 581, name: kworker/6:2
[    6.547262] 2 locks held by kworker/6:2/581:
[    6.547264]  #0: ffff8906c7c59148 ((wq_completion)events){....}-{0:0}, at: process_one_work+0x1fb/0x4f0
[    6.547275]  #1: ffffa398447e3e68 ((work_completion)(&wfc.work)){....}-{0:0}, at: process_one_work+0x1fb/0x4f0
[    6.547282] CPU: 6 PID: 581 Comm: kworker/6:2 Tainted: G            E     5.11.0-1-default+ #171
[    6.547285] Hardware name: Gigabyte Technology Co., Ltd. X399 DESIGNARE EX/X399 DESIGNARE EX-CF, BIOS F12i 09/24/2019
[    6.547287] Workqueue: events work_for_cpu_fn
[    6.547291] Call Trace:
[    6.547296]  dump_stack+0x6b/0x83
[    6.547300]  ___might_sleep.cold+0xa7/0xb7
[    6.547305]  ? smu_get_max_sustainable_clocks_by_dc+0x38/0x80 [amdgpu]
[    6.547494]  __mutex_lock+0x45/0x8c0
[    6.547500]  ? ___slab_alloc+0x42d/0x640
[    6.547505]  smu_get_max_sustainable_clocks_by_dc+0x38/0x80 [amdgpu]
[    6.547654]  pp_nv_get_maximum_sustainable_clocks+0x2f/0x50 [amdgpu]
[    6.547810]  init_soc_bounding_box+0x111/0x200 [amdgpu]
[    6.547975]  dcn20_resource_construct+0x440/0xd30 [amdgpu]
[    6.548134]  ? fs_reclaim_release+0x46/0x80
[    6.548138]  ? dcn20_create_resource_pool+0x25/0x80 [amdgpu]
[    6.548294]  ? kmem_cache_alloc_trace+0x1a4/0x360
[    6.548296]  ? __kmalloc+0x1c1/0x3c0
[    6.548301]  dcn20_create_resource_pool+0x3c/0x80 [amdgpu]
[    6.548457]  dc_create_resource_pool+0x13f/0x1d0 [amdgpu]
[    6.548611]  dc_create+0x203/0x7b0 [amdgpu]
[    6.548768]  amdgpu_dm_init.isra.0+0x1de/0x270 [amdgpu]
[    6.548923]  ? dev_vprintk_emit+0x12c/0x150
[    6.548931]  ? dev_printk_emit+0x4e/0x65
[    6.548941]  dm_hw_init+0xe/0x20 [amdgpu]
[    6.549094]  amdgpu_device_init.cold+0x13e6/0x17ad [amdgpu]
[    6.549248]  ? pci_bus_read_config_word+0x49/0x70
[    6.549254]  amdgpu_driver_load_kms+0x64/0x260 [amdgpu]
[    6.549376]  amdgpu_pci_probe+0x122/0x1b0 [amdgpu]
[    6.549497]  local_pci_probe+0x42/0x80
[    6.549501]  work_for_cpu_fn+0x16/0x20
[    6.549503]  process_one_work+0x28c/0x4f0
[    6.549509]  worker_thread+0x20d/0x3f0
[    6.549512]  ? rescuer_thread+0x390/0x390
[    6.549515]  kthread+0x13a/0x150
[    6.549517]  ? __kthread_bind_mask+0x60/0x60
[    6.549521]  ret_from_fork+0x22/0x30
[    6.549969] [drm] Display Core initialized with v3.2.127!

Note You need to log in before you can comment on or make changes to this bug.