hdmi: fix a dead lock in tegra_hdmi_hpd_worker()
authorHaley Teng <hteng@nvidia.com>
Thu, 25 Aug 2016 09:29:01 +0000 (17:29 +0800)
committermobile promotions <svcmobile_promotions@nvidia.com>
Fri, 25 Nov 2016 04:59:43 +0000 (20:59 -0800)
commit389ed7af6df50b8e35ede8fff5f004425751c54e
tree5ec956d170aafba248ffab6376f346e962f59179
parent84b9f5eb041c1ee9a2a8baedd4605f1db03432c4
hdmi: fix a dead lock in tegra_hdmi_hpd_worker()

We should not call cancel_delayed_work_sync() in tegra_hdmi_hpd_worker()
since tegra_hdmi_hpd_worker() is a function called by workqueue.
Replacing cancel_delayed_work_sync() by cancel_delayed_work() in
tegra_hdmi_hpd_worker().

The below backtrace is an example of the dead lock issue.

[   81.663560] kworker/5:2     D ffffffc000085de8     0   173      2 0x00000000
[   81.670634] Workqueue: events tegra_hdmi_hpd_worker
[   81.675520] Call trace:
[   81.677959] [<ffffffc000085de8>] __switch_to+0x94/0xa8
[   81.683099] [<ffffffc000b6a048>] __schedule+0x284/0x788
[   81.688326] [<ffffffc000b6a590>] schedule+0x44/0xb0
[   81.693213] [<ffffffc0000b8e98>] __cancel_work_timer+0x18c/0x190
[   81.699216] [<ffffffc0000b8ec4>] cancel_delayed_work_sync+0x10/0x18
[   81.705483] [<ffffffc000447d74>] tegra_hdmi_hpd_worker+0x134/0x28c
[   81.711668] [<ffffffc0000b87b4>] process_one_work+0x158/0x44c
[   81.717415] [<ffffffc0000b95e4>] worker_thread+0x134/0x4a8
[   81.722899] [<ffffffc0000be8c0>] kthread+0xe0/0xf4
[   81.727691] [<ffffffc000084c90>] ret_from_fork+0x10/0x40
......
[   86.791409] sh              D ffffffc000085de8     0  1879   1782 0x00000000
[   86.798477] Call trace:
[   86.800916] [<ffffffc000085de8>] __switch_to+0x94/0xa8
[   86.806055] [<ffffffc000b6a048>] __schedule+0x284/0x788
[   86.811280] [<ffffffc000b6a590>] schedule+0x44/0xb0
[   86.816161] [<ffffffc000b6d1fc>] schedule_timeout+0x1f0/0x280
[   86.821908] [<ffffffc000b6b110>] wait_for_common+0xa0/0x144
[   86.827486] [<ffffffc000b6b1c8>] wait_for_completion+0x14/0x1c
[   86.833322] [<ffffffc0000b80ec>] flush_work+0xd0/0x188
[   86.838460] [<ffffffc0000b8da4>] __cancel_work_timer+0x98/0x190
[   86.844383] [<ffffffc0000b8ec4>] cancel_delayed_work_sync+0x10/0x18
[   86.850652] [<ffffffc00044a380>] tegra_hdmi_set_hotplug_state+0x48/0xc0
[   86.857264] [<ffffffc00044a448>] tegra_hdmi_hotplug_dbg_write+0x50/0x84
[   86.863877] [<ffffffc0001c2d88>] __vfs_write+0x2c/0xe0
[   86.869019] [<ffffffc0001c370c>] vfs_write+0x90/0x19c
[   86.874070] [<ffffffc0001c4214>] SyS_write+0x44/0xa0
[   86.879038] [<ffffffc000084cf0>] el0_svc_naked+0x24/0x28

Bug 200228986

Change-Id: I431e7903a283324f4ed482464ac150790a1ec8e1
Signed-off-by: Haley Teng <hteng@nvidia.com>
Reviewed-on: http://git-master/r/1207728
Reviewed-on: http://git-master/r/1258745
Tested-by: Prafull Suryawanshi <prafulls@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Santosh Galma <galmar@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>
drivers/video/tegra/dc/hdmi2.0.c