From patchwork Thu Aug 11 07:54:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yao mark X-Patchwork-Id: 9274595 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3394560231 for ; Thu, 11 Aug 2016 07:54:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FAA426C2F for ; Thu, 11 Aug 2016 07:54:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 114F128554; Thu, 11 Aug 2016 07:54:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5CD4326C2F for ; Thu, 11 Aug 2016 07:54:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 80E746E194; Thu, 11 Aug 2016 07:54:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.99.132]) by gabe.freedesktop.org (Postfix) with ESMTPS id 81E686E194 for ; Thu, 11 Aug 2016 07:54:41 +0000 (UTC) Received: from mark.yao?rock-chips.com (unknown [192.168.167.225]) by regular1.263xmail.com (Postfix) with SMTP id B370994FF; Thu, 11 Aug 2016 15:54:35 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 925F53B0; Thu, 11 Aug 2016 15:54:10 +0800 (CST) X-RL-SENDER: mark.yao@rock-chips.com X-FST-TO: airlied@linux.ie X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: mark.yao@rock-chips.com X-UNIQUE-TAG: <781eedd7f5a97bcdd68ad5a4a2c28b8a> X-ATTACHMENT-NUM: 0 X-SENDER: yzq@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 152724X3FEL; Thu, 11 Aug 2016 15:54:15 +0800 (CST) From: Mark Yao To: David Airlie , Heiko Stuebner , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/bridge: dw-hdmi: fix hdmi display lost Date: Thu, 11 Aug 2016 15:54:03 +0800 Message-Id: <1470902043-23384-1-git-send-email-mark.yao@rock-chips.com> X-Mailer: git-send-email 1.9.1 Cc: Daniel Vetter , Russell King , Fabio Estevam X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP hdmi->disabled maybe not match to the real hardware status. ->dw_hdmi_bridge_enable() hdmi->disabled = false; -->dw_hdmi_update_power() if (hdmi->rxsense) force = DRM_FORCE_ON; else force = DRM_FORCE_OFF; hdmi->rxsense maybe false on bridge enable path, then hdmi->disabled is false, but actually hardware is power off, they are not match. So on dw_hdmi_irq, judge the hardware status with hdmi->disabled is wrong. This bug would cause display lost, unplug/plug can't recovery display. Cc: Russell King Cc: Daniel Vetter Cc: Fabio Estevam Cc: Liu Ying Signed-off-by: Mark Yao --- drivers/gpu/drm/bridge/dw-hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/dw-hdmi.c b/drivers/gpu/drm/bridge/dw-hdmi.c index 77ab473..a4fcb47 100644 --- a/drivers/gpu/drm/bridge/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/dw-hdmi.c @@ -1563,7 +1563,7 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) if (intr_stat & (HDMI_IH_PHY_STAT0_RX_SENSE | HDMI_IH_PHY_STAT0_HPD)) { mutex_lock(&hdmi->mutex); - if (!hdmi->disabled && !hdmi->force) { + if (!hdmi->bridge_is_on && !hdmi->force) { /* * If the RX sense status indicates we're disconnected, * clear the software rxsense status.