merged.

Bruce

In message: [linux-yocto][linux-yocto v5.10/standard/sdkv5.4/xlnx-soc] drm: 
xlnx: drv: add gem_free_object_unlocked callback xlnx_drm_driver
on 26/01/2021 [email protected] wrote:

> From: Quanyang Wang <[email protected]>
> 
> When reboot or shutdown system, the function drm_mm_takedown will check
> if there is any gem_obj->vma_node.vm_node in mm->head_node.node_list.
> And if so, it will report a warning as below:
> 
> Memory manager not clean during takedown.
> WARNING: CPU: 3 PID: 1 at drivers/gpu/drm/drm_mm.c:998 
> drm_mm_takedown+0x30/0x40
> Modules linked in:
> CPU: 3 PID: 1 Comm: systemd-shutdow Not tainted 5.10.2-yoctodev-standard+ #93
> Hardware name: ZynqMP ZCU102 Rev1.0 (DT)
> pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--)
> pc : drm_mm_takedown+0x30/0x40
> lr : drm_mm_takedown+0x30/0x40
> sp : ffffffc011ddbb10
> x29: ffffffc011ddbb10 x28: ffffff8800850000 
> x27: 0000000000000000 x26: ffffffc0110c1060 
> x25: dead000000000100 x24: dead000000000122 
> x23: ffffffc0110bd5f8 x22: ffffff8803bf0820 
> x21: ffffff8803bf0800 x20: ffffff8803be2c00 
> x19: ffffff8803b44980 x18: 000000000000000e 
> x17: 0000000000000001 x16: 0000000000000019 
> x15: 0000000000000004 x14: 000000000000004c 
> x13: 0000000000000000 x12: ffffff88004633d8 
> x11: ffffffc0116c8430 x10: ffffffc0116b03f0 
> x9 : ffffffc0100a64d8 x8 : 0000000000017fe8 
> x7 : c0000000ffffefff x6 : 0000000000000001 
> x5 : 0000000000000000 x4 : 0000000000000000 
> x3 : 00000000ffffffff x2 : 0000000000000001 
> x1 : 0000000000000000 x0 : 0000000000000000 
> Call trace:
>  drm_mm_takedown+0x30/0x40
>  drm_vma_offset_manager_destroy+0x1c/0x28
>  drm_gem_init_release+0x1c/0x28
>  drm_managed_release+0xa0/0x100
>  drm_dev_release+0x38/0x50
>  drm_dev_put+0x5c/0x78
>  xlnx_unbind+0x68/0x78
>  take_down_master.part.0+0x28/0x48
>  component_master_del+0xa8/0xb0
>  xlnx_platform_shutdown+0x24/0x30
>  platform_drv_shutdown+0x28/0x38
>  device_shutdown+0x164/0x250
>  kernel_restart_prepare+0x40/0x50
>  kernel_restart+0x20/0x70
>  __do_sys_reboot+0x104/0x230
>  __arm64_sys_reboot+0x2c/0x38
>  el0_svc_common.constprop.0+0xa4/0x1e8
>  do_el0_svc+0x78/0x98
>  el0_svc+0x20/0x30
>  el0_sync_handler+0xb0/0xb8
>  el0_sync+0x174/0x180
> ---[ end trace 58a1f24e09bc49c3 ]---
> 
> This is because that when gem_free_object_unlocked callback is NULL in
> struct drm_driver, the gem_objects which allocated by drm_gem_cma_create
> won't be freed by drm_gem_object_free anymore. So let's make the
> function drm_gem_cma_free_object to be the gem_free_object_unlocked
> callback.
> 
> Signed-off-by: Quanyang Wang <[email protected]>
> ---
>  drivers/gpu/drm/xlnx/xlnx_drv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/xlnx/xlnx_drv.c b/drivers/gpu/drm/xlnx/xlnx_drv.c
> index c1cc8c944a9c..413509a596e5 100644
> --- a/drivers/gpu/drm/xlnx/xlnx_drv.c
> +++ b/drivers/gpu/drm/xlnx/xlnx_drv.c
> @@ -206,6 +206,7 @@ static struct drm_driver xlnx_drm_driver = {
>       .gem_prime_vunmap               = drm_gem_cma_prime_vunmap,
>       .gem_prime_mmap                 = drm_gem_cma_prime_mmap,
>       .gem_vm_ops                     = &drm_gem_cma_vm_ops,
> +     .gem_free_object_unlocked       = drm_gem_cma_free_object,
>       .dumb_create                    = xlnx_gem_cma_dumb_create,
>       .dumb_destroy                   = drm_gem_dumb_destroy,
>  
> -- 
> 2.25.1
> 
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9433): 
https://lists.yoctoproject.org/g/linux-yocto/message/9433
Mute This Topic: https://lists.yoctoproject.org/mt/80127739/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to