Re: drm: Bogus WARN() in drm_atomic_helper_update_legacy_modeset_state() ?

From: Liviu Dudau
Date: Thu Nov 12 2015 - 05:34:55 EST


On Thu, Nov 12, 2015 at 02:34:57PM +0800, Mark yao wrote:

Mark,

> On 2015å11æ12æ 14:27, Mark yao wrote:
>
> On 2015å11æ11æ 00:56, Thierry Reding wrote:
>
> On Tue, Nov 10, 2015 at 03:01:03PM +0000, Liviu Dudau wrote:
>
> Hello,
>
> When booting my Juno board with the HDLCD driver that I have converted to
> atomic operations I'm getting the following warning:
>
> Perhaps you can provide pointers to the source code, that might make it
> easier for people to spot what's going wrong.
>
> Thierry
>

Can you switch your email client to text mode and make it do proper reply quoting? It is
rather difficult to follow where your reply comes when you don't use HTML MUAs.

Best regards,
Liviu


> _______________________________________________
> dri-devel mailing list
> [1]dri-devel@xxxxxxxxxxxxxxxxxxxxx
> [2]http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
> Hi Thierry
> ÂÂÂ I encountered the same problem as Liviu.
> ÂÂÂ I'm coverting rockchip drm to atomic api, when booting with hdmi connected, get under warning:
>
> [ÂÂÂ 1.300156] WARNING: CPU: 0 PID: 26 at drivers/gpu/drm/drm_atomic_helper.c:674 drm_atomic_helper_update_legacy_modeset_state+0x3c/0x1f8()
> [ÂÂÂ 1.300161] Modules linked in:
> [ÂÂÂ 1.300171] CPU: 0 PID: 26 Comm: kworker/0:1 Not tainted 4.3.0-rc5+ #160
> [ÂÂÂ 1.300174] Hardware name: Rockchip (Device Tree)
> [ÂÂÂ 1.300189] Workqueue: events output_poll_execute
> [ÂÂÂ 1.300224] [<c0015e54>] (unwind_backtrace) from [<c00123cc>] (show_stack+0x10/0x14)
> [ÂÂÂ 1.300241] [<c00123cc>] (show_stack) from [<c01a5980>] (dump_stack+0x6c/0x88)
> [ÂÂÂ 1.300255] [<c01a5980>] (dump_stack) from [<c0024050>] (warn_slowpath_common+0x80/0xa8)
> [ÂÂÂ 1.300265] [<c0024050>] (warn_slowpath_common) from [<c0024090>] (warn_slowpath_null+0x18/0x1c)
> [ÂÂÂ 1.300277] [<c0024090>] (warn_slowpath_null) from [<c0221184>] (drm_atomic_helper_update_legacy_modeset_state+0x3c/0x1f8)
> [ÂÂÂ 1.300293] [<c0221184>] (drm_atomic_helper_update_legacy_modeset_state) from [<c0221548>] (drm_atomic_helper_commit_modeset_disables+0x208/0x364)
> [ÂÂÂ 1.300305] [<c0221548>] (drm_atomic_helper_commit_modeset_disables) from [<c0222248>] (drm_atomic_helper_commit+0xf8/0x140)
> [ÂÂÂ 1.300320] [<c0222248>] (drm_atomic_helper_commit) from [<c02404cc>] (drm_atomic_commit+0x50/0x60)
> [ÂÂÂ 1.300333] [<c02404cc>] (drm_atomic_commit) from [<c0223180>] (restore_fbdev_mode+0xf4/0x278)
> [ÂÂÂ 1.300345] [<c0223180>] (restore_fbdev_mode) from [<c0224164>] (drm_fb_helper_restore_fbdev_mode_unlocked+0x30/0x68)
> [ÂÂÂ 1.300357] [<c0224164>] (drm_fb_helper_restore_fbdev_mode_unlocked) from [<c02241d8>] (drm_fb_helper_set_par+0x3c/0x54)
> [ÂÂÂ 1.300368] [<c02241d8>] (drm_fb_helper_set_par) from [<c022411c>] (drm_fb_helper_hotplug_event+0xe4/0xfc)
> [ÂÂÂ 1.300382] [<c022411c>] (drm_fb_helper_hotplug_event) from [<c021ade8>] (drm_kms_helper_hotplug_event+0x24/0x28)
> [ÂÂÂ 1.300396] [<c021ade8>] (drm_kms_helper_hotplug_event) from [<c021af20>] (output_poll_execute+0x134/0x18c)
> [ÂÂÂ 1.300413] [<c021af20>] (output_poll_execute) from [<c00377c0>] (process_one_work+0x1e0/0x318)
> [ÂÂÂ 1.300426] [<c00377c0>] (process_one_work) from [<c0037c70>] (worker_thread+0x378/0x4c4)
> [ÂÂÂ 1.300438] [<c0037c70>] (worker_thread) from [<c003c69c>] (kthread+0xdc/0xf0)
> [ÂÂÂ 1.300450] [<c003c69c>] (kthread) from [<c000f5d8>] (ret_from_fork+0x14/0x3c)
>
> I can't found who can set encoder->crtc value before atomic_commit, what's going wrong?
>
> --
> ïark Yao
>
> Hi
>  here is the message before warning happen (filtering by "dmesg | grep drm"), Hope this helps:
>
> [ÂÂÂ 1.245700] [drm:drm_minor_register]
> [ÂÂÂ 1.245925] [drm:drm_minor_register] new minor registered 64
> [ÂÂÂ 1.245934] [drm:drm_minor_register]
> [ÂÂÂ 1.245942] [drm:drm_minor_register]
> [ÂÂÂ 1.246099] [drm:drm_minor_register] new minor registered 0
> [ÂÂÂ 1.272968] rockchip-drm display-subsystem: bound ff940000.vop (ops vop_component_ops)
> [ÂÂÂ 1.294790] rockchip-drm display-subsystem: bound ff930000.vop (ops vop_component_ops)
> [ÂÂÂ 1.295086] rockchip-drm display-subsystem: bound ff980000.hdmi (ops dw_hdmi_rockchip_ops)
> [ÂÂÂ 1.295218] [drm:drm_sysfs_connector_add] adding "HDMI-A-1" to sysfs
> [ÂÂÂ 1.295222] [drm:drm_sysfs_hotplug_event] generating hotplug event
> [ÂÂÂ 1.295268] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
> [ÂÂÂ 1.295270] [drm] No driver support for vblank timestamp query.
> [ÂÂÂ 1.295290] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:29:HDMI-A-1]
> [ÂÂÂ 1.295304] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:29:HDMI-A-1] status updated from 3 to 1
> [ÂÂÂ 1.295470] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter rk3x-i2c
> [ÂÂÂ 1.295513] [drm:drm_mode_debug_printmodeline] Modeline 30:"640x480" 0 25175 640 656 752 800 480 490 492 525 0x40 0xa
> [ÂÂÂ 1.295518] [drm:drm_mode_prune_invalid] Not using 640x480 mode: BAD
> [ÂÂÂ 1.295531] [drm:drm_mode_debug_printmodeline] Modeline 33:"848x480" 0 33750 848 864 976 1088 480 486 494 517 0x40 0x5
> [ÂÂÂ 1.295535] [drm:drm_mode_prune_invalid] Not using 848x480 mode: BAD
> [ÂÂÂ 1.295543] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:29:HDMI-A-1] probed modes :
> [ÂÂÂ 1.295555] [drm:drm_mode_debug_printmodeline] Modeline 34:"1024x768" 60 65000 1024 1048 1184 1344 768 771 777 806 0x40 0xa
> [ÂÂÂ 1.295564] [drm:drm_mode_debug_printmodeline] Modeline 32:"800x600" 60 40000 800 840 968 1056 600 601 605 628 0x40 0x5
> [ÂÂÂ 1.295573] [drm:drm_mode_debug_printmodeline] Modeline 31:"800x600" 56 36000 800 824 896 1024 600 601 603 625 0x40 0x5
> [ÂÂÂ 1.295581] [drm:drm_setup_crtcs]
> [ÂÂÂ 1.295594] [drm:drm_enable_connectors] connector 29 enabled? yes
> [ÂÂÂ 1.295601] [drm:drm_target_preferred] looking for cmdline mode on connector 29
> [ÂÂÂ 1.295606] [drm:drm_target_preferred] looking for preferred mode on connector 29 0
> [ÂÂÂ 1.295609] [drm:drm_target_preferred] found mode 1024x768
> [ÂÂÂ 1.295614] [drm:drm_setup_crtcs] picking CRTCs for 4096x4096 config
> [ÂÂÂ 1.295623] [drm:drm_setup_crtcs] desired mode 1024x768 set on crtc 20 (0,0)
> [ÂÂÂ 1.299403] [drm:rockchip_drm_fbdev_create] FB [1024x768]-24 kvaddr=f0121000 offset=0 size=3145728
> [ÂÂÂ 1.299512] [drm:drm_sysfs_hotplug_event] generating hotplug event
> [ÂÂÂ 1.299540] [drm:drm_fb_helper_hotplug_event]
> [ÂÂÂ 1.299546] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:29:HDMI-A-1]
> [ÂÂÂ 1.299712] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter rk3x-i2c
> [ÂÂÂ 1.299750] [drm:drm_mode_debug_printmodeline] Modeline 35:"640x480" 0 25175 640 656 752 800 480 490 492 525 0x40 0xa
> [ÂÂÂ 1.299755] [drm:drm_mode_prune_invalid] Not using 640x480 mode: BAD
> [ÂÂÂ 1.299764] [drm:drm_mode_debug_printmodeline] Modeline 38:"848x480" 0 33750 848 864 976 1088 480 486 494 517 0x40 0x5
> [ÂÂÂ 1.299769] [drm:drm_mode_prune_invalid] Not using 848x480 mode: BAD
> [ÂÂÂ 1.299776] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:29:HDMI-A-1] probed modes :
> [ÂÂÂ 1.299786] [drm:drm_mode_debug_printmodeline] Modeline 34:"1024x768" 60 65000 1024 1048 1184 1344 768 771 777 806 0x40 0xa
> [ÂÂÂ 1.299795] [drm:drm_mode_debug_printmodeline] Modeline 32:"800x600" 60 40000 800 840 968 1056 600 601 605 628 0x40 0x5
> [ÂÂÂ 1.299804] [drm:drm_mode_debug_printmodeline] Modeline 31:"800x600" 56 36000 800 824 896 1024 600 601 603 625 0x40 0x5
> [ÂÂÂ 1.299811] [drm:drm_setup_crtcs]
> [ÂÂÂ 1.299818] [drm:drm_enable_connectors] connector 29 enabled? yes
> [ÂÂÂ 1.299822] [drm:drm_target_preferred] looking for cmdline mode on connector 29
> [ÂÂÂ 1.299827] [drm:drm_target_preferred] looking for preferred mode on connector 29 0
> [ÂÂÂ 1.299831] [drm:drm_target_preferred] found mode 1024x768
> [ÂÂÂ 1.299836] [drm:drm_setup_crtcs] picking CRTCs for 4096x4096 config
> [ÂÂÂ 1.299842] [drm:drm_setup_crtcs] desired mode 1024x768 set on crtc 20 (0,0)
> [ÂÂÂ 1.299857] [drm:drm_atomic_state_init] Allocated atomic state ee38ebc0
> [ÂÂÂ 1.299868] [drm:drm_atomic_get_plane_state] Added [PLANE:18] ee38eac0 state to ee38ebc0
> [ÂÂÂ 1.299875] [drm:drm_atomic_get_plane_state] Added [PLANE:19] ee38ea80 state to ee38ebc0
> [ÂÂÂ 1.299880] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38ea80 to [NOCRTC]
> [ÂÂÂ 1.299885] [drm:drm_atomic_set_fb_for_plane] Set [NOFB] for plane state ee38ea80
> [ÂÂÂ 1.299892] [drm:drm_atomic_get_plane_state] Added [PLANE:21] ee38ea40 state to ee38ebc0
> [ÂÂÂ 1.299897] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38ea40 to [NOCRTC]
> [ÂÂÂ 1.299901] [drm:drm_atomic_set_fb_for_plane] Set [NOFB] for plane state ee38ea40
> [ÂÂÂ 1.299907] [drm:drm_atomic_get_plane_state] Added [PLANE:22] ee38ea00 state to ee38ebc0
> [ÂÂÂ 1.299911] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38ea00 to [NOCRTC]
> [ÂÂÂ 1.299916] [drm:drm_atomic_set_fb_for_plane] Set [NOFB] for plane state ee38ea00
> [ÂÂÂ 1.299922] [drm:drm_atomic_get_plane_state] Added [PLANE:23] ee38e9c0 state to ee38ebc0
> [ÂÂÂ 1.299929] [drm:drm_atomic_get_plane_state] Added [PLANE:24] ee38e980 state to ee38ebc0
> [ÂÂÂ 1.299933] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38e980 to [NOCRTC]
> [ÂÂÂ 1.299937] [drm:drm_atomic_set_fb_for_plane] Set [NOFB] for plane state ee38e980
> [ÂÂÂ 1.299943] [drm:drm_atomic_get_plane_state] Added [PLANE:26] ee38e940 state to ee38ebc0
> [ÂÂÂ 1.299947] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38e940 to [NOCRTC]
> [ÂÂÂ 1.299951] [drm:drm_atomic_set_fb_for_plane] Set [NOFB] for plane state ee38e940
> [ÂÂÂ 1.299958] [drm:drm_atomic_get_plane_state] Added [PLANE:27] ee38e900 state to ee38ebc0
> [ÂÂÂ 1.299962] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38e900 to [NOCRTC]
> [ÂÂÂ 1.299966] [drm:drm_atomic_set_fb_for_plane] Set [NOFB] for plane state ee38e900
> [ÂÂÂ 1.299975] [drm:drm_atomic_get_crtc_state] Added [CRTC:20] ee340000 state to ee38ebc0
> [ÂÂÂ 1.299985] [drm:drm_atomic_set_mode_for_crtc] Set [MODE:1024x768] for CRTC state ee340000
> [ÂÂÂ 1.299990] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38eac0 to [CRTC:20]
> [ÂÂÂ 1.299995] [drm:drm_framebuffer_reference] ee20f640: FB ID: 33 (1)
> [ÂÂÂ 1.300000] [drm:drm_atomic_set_fb_for_plane] Set [FB:33] for plane state ee38eac0
> [ÂÂÂ 1.300008] [drm:drm_atomic_get_connector_state] Added [CONNECTOR:29] ee38e8c0 state to ee38ebc0
> [ÂÂÂ 1.300015] [drm:drm_atomic_add_affected_connectors] Adding all current connectors for [CRTC:20] to ee38ebc0
> [ÂÂÂ 1.300021] [drm:drm_atomic_set_crtc_for_connector] Link connector state ee38e8c0 to [CRTC:20]
> [ÂÂÂ 1.300033] [drm:drm_atomic_get_crtc_state] Added [CRTC:25] ee393e00 state to ee38ebc0
> [ÂÂÂ 1.300038] [drm:drm_atomic_set_mode_for_crtc] Set [NOMODE] for CRTC state ee393e00
> [ÂÂÂ 1.300043] [drm:drm_atomic_set_crtc_for_plane] Link plane state ee38e9c0 to [NOCRTC]
> [ÂÂÂ 1.300047] [drm:drm_atomic_set_fb_for_plane] Set [NOFB] for plane state ee38e9c0
> [ÂÂÂ 1.300053] [drm:drm_atomic_add_affected_connectors] Adding all current connectors for [CRTC:20] to ee38ebc0
> [ÂÂÂ 1.300059] [drm:drm_atomic_add_affected_connectors] Adding all current connectors for [CRTC:25] to ee38ebc0
> [ÂÂÂ 1.300067] [drm:drm_atomic_connectors_for_crtc] State ee38ebc0 has 1 connectors for [CRTC:20]
> [ÂÂÂ 1.300071] [drm:drm_atomic_check_only] checking ee38ebc0
> [ÂÂÂ 1.300079] [drm:drm_atomic_helper_check_modeset] [CRTC:20] mode changed
> [ÂÂÂ 1.300083] [drm:drm_atomic_helper_check_modeset] [CRTC:20] enable changed
> [ÂÂÂ 1.300088] [drm:update_connector_routing] Updating routing for [CONNECTOR:29:HDMI-A-1]
> [ÂÂÂ 1.300095] [drm:update_connector_routing] [CONNECTOR:29:HDMI-A-1] using [ENCODER:28:TMDS-28] on [CRTC:20]
> [ÂÂÂ 1.300100] [drm:drm_atomic_helper_check_modeset] [CRTC:20] active changed
> [ÂÂÂ 1.300105] [drm:drm_atomic_helper_check_modeset] [CRTC:20] needs all connectors, enable: y, active: y
> [ÂÂÂ 1.300111] [drm:drm_atomic_add_affected_connectors] Adding all current connectors for [CRTC:20] to ee38ebc0
> [ÂÂÂ 1.300117] [drm:drm_atomic_connectors_for_crtc] State ee38ebc0 has 1 connectors for [CRTC:20]
> [ÂÂÂ 1.300130] [drm:drm_atomic_commit] commiting ee38ebc0
> [ÂÂÂ 1.300156] WARNING: CPU: 0 PID: 26 at drivers/gpu/drm/drm_atomic_helper.c:674 drm_atomic_helper_update_legacy_modeset_state+0x3c/0x1f8()
>
> --
> ïark Yao
>
> References
>
> Visible links
> 1. mailto:dri-devel@xxxxxxxxxxxxxxxxxxxxx
> 2. http://lists.freedesktop.org/mailman/listinfo/dri-devel

--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
Â\_(ã)_/Â
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/