From 86155ccebcc10b7edc57e97ede993c474f579558 Mon Sep 17 00:00:00 2001 From: Algea Cao Date: Thu, 28 Dec 2017 15:43:10 +0800 Subject: [PATCH] drm/bridge/synopsys: Move cec_notifier_set_phys_addr out of rxsense setup If put cec_notifier_set_phys_addr in rxsense setup, hdmi->mutex may become deadlock. Because cec_notifier_set_phys_addr will call dw_hdmi_cec_enable which cause hdmi->mutex become deadlock. Change-Id: I4fed641c9e9d7674451402a973196ef0efeb198f Signed-off-by: Algea Cao --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 06897dc3abeb..908147e3df81 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -320,6 +320,7 @@ static void repo_hpd_event(struct work_struct *p_work) if (hdmi->bridge.dev) drm_helper_hpd_irq_event(hdmi->bridge.dev); + #ifdef CONFIG_SWITCH if (hdmi->hpd_state) switch_set_state(&hdmi->switchdev, 1); @@ -2809,14 +2810,13 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) if (phy_stat & HDMI_PHY_HPD) hdmi->rxsense = true; - if (!(phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD))) - cec_notifier_set_phys_addr(hdmi->cec_notifier, - 0xffff); - dw_hdmi_update_power(hdmi); dw_hdmi_update_phy_mask(hdmi); } mutex_unlock(&hdmi->mutex); + if (!(phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD))) + cec_notifier_set_phys_addr(hdmi->cec_notifier, + CEC_PHYS_ADDR_INVALID); } check_hdmi_irq(hdmi, intr_stat, phy_int_pol);