WSL2-Linux-Kernel/drivers/gpu/drm/mediatek
Tzung-Bi Shih f07980d4ed
drm/mediatek: fix race condition for HDMI jack status reporting
hdmi_conn_detect and mtk_hdmi_audio_hook_plugged_cb would be called
by different threads.

Imaging the following calling sequence:
           Thread A                            Thread B
--------------------------------------------------------------------
mtk_hdmi_audio_hook_plugged_cb()
mtk_cec_hpd_high() -> disconnected
                                     hdmi_conn_detect()
                                     mtk_cec_hpd_high() -> connected
                                     plugged_cb(connected)
plugged_cb(disconnected)

The latest disconnected is false reported.  Makes mtk_cec_hpd_high
and plugged_cb atomic to fix.

Also uses the same lock to protect read/write of plugged_cb and codec_dev.

Fixes: 5d3c644773 ("drm/mediatek: support HDMI jack status reporting")
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Acked-by: CK Hu <ck.hu@mediatek.com>
Link: https://lore.kernel.org/r/20200217105513.2.I477092c2f104fd589133436c3ae4590e6fc6323b@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-17 17:39:13 +00:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile Mediatek DRM Next for Linux 5.6 2020-01-15 16:40:19 +10:00
mtk_cec.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
mtk_cec.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
mtk_disp_color.c drm/mediatek: support CMDQ interface in ddp component 2020-01-09 09:39:08 +08:00
mtk_disp_ovl.c drm/mediatek: Turn off Alpha bit when plane format has no alpha 2020-01-10 14:10:49 +08:00
mtk_disp_rdma.c drm/mediatek: support CMDQ interface in ddp component 2020-01-09 09:39:08 +08:00
mtk_dpi.c drm: Stop including drm_bridge.h from drm_crtc.h 2019-08-28 22:11:03 +02:00
mtk_dpi_regs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
mtk_drm_crtc.c drm/mediatek: Add ctm property support 2020-01-10 14:10:30 +08:00
mtk_drm_crtc.h drm/mediatek: update cursors by using async atomic update 2019-12-20 16:19:11 +08:00
mtk_drm_ddp.c drm/mediatek: add no_clk into ddp private data 2019-10-09 16:58:13 +08:00
mtk_drm_ddp.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
mtk_drm_ddp_comp.c drm/mediatek: Add ctm property support 2020-01-10 14:10:30 +08:00
mtk_drm_ddp_comp.h drm/mediatek: Add ctm property support 2020-01-10 14:10:30 +08:00
mtk_drm_drv.c Mediatek DRM Next for Linux 5.6 2020-01-15 16:40:19 +10:00
mtk_drm_drv.h drm/mediatek: use DRM core's atomic commit helper 2019-12-20 16:19:11 +08:00
mtk_drm_gem.c drm/mediatek: remove cast to pointers passed to kfree 2019-10-24 14:12:21 +02:00
mtk_drm_gem.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
mtk_drm_plane.c Mediatek DRM Next for Linux 5.6 2020-01-15 16:40:19 +10:00
mtk_drm_plane.h drm/mediatek: update cursors by using async atomic update 2019-12-20 16:19:11 +08:00
mtk_dsi.c Linux 5.5-rc7 2020-01-20 11:42:57 +10:00
mtk_hdmi.c drm/mediatek: fix race condition for HDMI jack status reporting 2020-02-17 17:39:13 +00:00
mtk_hdmi.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
mtk_hdmi_ddc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
mtk_hdmi_phy.c drm/mediatek: no change parent rate in round_rate() for MT2701 hdmi phy 2019-04-09 17:47:01 +08:00
mtk_hdmi_phy.h drm/mediatek: no change parent rate in round_rate() for MT2701 hdmi phy 2019-04-09 17:47:01 +08:00
mtk_hdmi_regs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
mtk_mipi_tx.c drm/mediatek: add mipi_tx driver for mt8183 2019-10-07 12:29:37 +08:00
mtk_mipi_tx.h drm/mediatek: add mipi_tx driver for mt8183 2019-10-07 12:29:37 +08:00
mtk_mt2701_hdmi_phy.c drm/mediatek: no change parent rate in round_rate() for MT2701 hdmi phy 2019-04-09 17:47:01 +08:00
mtk_mt8173_hdmi_phy.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
mtk_mt8173_mipi_tx.c drm/mediatek: separate mipi_tx to different file 2019-10-07 12:29:37 +08:00
mtk_mt8183_mipi_tx.c drm/mediatek: add mipi_tx driver for mt8183 2019-10-07 12:29:37 +08:00