Received: by 10.223.164.202 with SMTP id h10csp1334096wrb; Mon, 27 Nov 2017 01:01:38 -0800 (PST) X-Google-Smtp-Source: AGs4zMbcTNthpcMNoOIUtaN5dvhMW+H+YfqxbhiICgBysMqwCG32qg54aIkB4jNg+NnE9Q+9GWCV X-Received: by 10.101.85.135 with SMTP id j7mr35687473pgs.17.1511773298199; Mon, 27 Nov 2017 01:01:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511773298; cv=none; d=google.com; s=arc-20160816; b=mMoDubO5hhr1oQUCQOT/USur5egchVcc5acLSFhwytu6itqJ4wDfOpdj66bfvhB9xe TUqKw1w/99/fnwKMMwG56hFRs/YPyk3cD1zAQkplncwby4H0WxGSJn5pwRe1ssOpwcre Z9MZHVUCjwpTBmcYQnZLlOZFYNADbW2hBnaYTf7m+0+GY8UAwj6HNAxXtLcYUZaYia3d 3JcenamK/IUBdXQE1vDPA8E/e5iy8vXy70x074j7nTphT36vCbI+2+8eJ3HW7MmONh9j 8KrwCYei8LflPnTK818AEEu7zqMsr05oivSOR3OEnoiRgYeSNdALWsl5SuQwM3h9GMot swEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=xToBwwzcthfkabvEzVkhQwAEfmRy+isnU3NOh7xsjnk=; b=a0F00r50d4LebOggSQ1IdqS/H1Nh6Rq+ShChaofTQY6Gb1BfUDKFC96j+XiTl4HqGH kC+pQI3vizP0kKkmaX1De6oWSmXVhOP4NJFhHnP8XCdiJ6TPz5zftHC+n530SJK0CJvt crJApXeawPD5bTilrx3S1b+vobFnji72fI2z3p7/ddo7/BUpRYwDmyylBQP3CIVJ9Irf cvZ4XU4dbyiTRgq9HSMCkAaug38Y1COttN4eC52Z3wRodj7tPTXBs6HQUJxkmAOUMXJs Nsx+cErIgXX0a8QeC21C9ouRnzUid1rcbg9AhiHJRn317TLFX2SO7HLzvzHEz6yEJpyJ fZNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=pcH7iEur; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10si22819264plp.37.2017.11.27.01.01.26; Mon, 27 Nov 2017 01:01:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=pcH7iEur; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751445AbdK0JA0 (ORCPT + 78 others); Mon, 27 Nov 2017 04:00:26 -0500 Received: from galahad.ideasonboard.com ([185.26.127.97]:41057 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751252AbdK0JAZ (ORCPT ); Mon, 27 Nov 2017 04:00:25 -0500 Received: from avalon.localnet (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id A58D320115; Mon, 27 Nov 2017 09:58:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1511773129; bh=evDhiKlmWv0GvZaumi+1sliw9xoOhCRu01P7V5EZ4XM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pcH7iEura+o/yiF7CeuvnvX78PFudaNQIX2JBLNGM9cQXQ/RJoczs63ttO1C7pRqJ 74S1/B8uoTiP1dh7edThoWhqD1zAolUhEbS6PRa1WqDMbzmFCaa1NFRUvraJRuqpt1 bU7+uKsXDv3vdvw7jl6VbJkF7Qi1pallHhJjCuBQ= From: Laurent Pinchart To: Archit Taneja Cc: Nick Bowler , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Laurent Pinchart , Linus Torvalds , Dave Airlie , Andrzej Hajda Subject: Re: PROBLEM: Asus C201 video mode problems on HDMI hotplug (regression) Date: Mon, 27 Nov 2017 11:00:28 +0200 Message-ID: <13872912.d01MB1IQ9u@avalon> Organization: Ideas on Board Oy In-Reply-To: <269ce21a-3685-30e8-fcc8-65070bc59eea@codeaurora.org> References: <20171116062811.g27zgeejizfxu6oc@aura.draconx.ca> <269ce21a-3685-30e8-fcc8-65070bc59eea@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Archit, Thank you for handling this, and sorry for missing the original bug report (and for breaking this in the first place). On Monday, 27 November 2017 06:05:03 EET Archit Taneja wrote: > On 11/16/2017 11:58 AM, Nick Bowler wrote: > > On 2017-11-05 11:41 -0500, Nick Bowler wrote: > >> On 2017-11-02, Nick Bowler wrote: > >>> ~50% of the time after a hotplug, there is a vertical pink bar on the > >>> left of the display area and audio is not working at all. According to > >>> the sink device the display size is 1282x720 which seems pretty wrong > >>> (normal and working situation is 1280x720). > >>> > >>> I posted photos of non-working versus working states here: > >>> https://imgur.com/a/qhAZG > >>> > >>> Unplugging and plugging the cable again will correct the issue (it seems > >>> to, for the most part, alternate between working and not-working states, > >>> although not always). It always works on power up with the cable > >>> initially connected. > >>> > >>> This is a regression from 4.11, where hotplug works perfectly every > >>> time. > >> > >> Bisection implicates the following commit: > >> > >> 181e0ef092a4952aa523c5b9cb21394cf43bcd46 is the first bad commit > >> commit 181e0ef092a4952aa523c5b9cb21394cf43bcd46 > >> Author: Laurent Pinchart > >> Date: Mon Mar 6 01:35:57 2017 +0200 > >> > >> drm: bridge: dw-hdmi: Fix the PHY power up sequence > >> > >> When powering the PHY up we need to wait for the PLL to lock. This > >> is done by polling the TX_PHY_LOCK bit in the HDMI_PHY_STAT0 > >> register (interrupt-based wait could be implemented as well but is > >> likely overkill). The bit is asserted when the PLL locks, but the > >> current code incorrectly waits for the bit to be deasserted. Fix it, > >> and while at it, replace the udelay() with a sleep as the code never > >> runs in non-sleepable context. > >> > >> To be consistent with the power down implementation move the poll > >> loop to the power off function. > > The two main things the commit below does it to a) correctly wait on the > TX_PHY_LOCK bit to be asserted and b) use usleep_range() instead of > udelay(). Another difference is that the PWDN and TMDS signals, in theory needed for Gen1 PHYs only, are not set anymore for Gen2 PHYs. Nick, could you test the following change to see if it makes a difference ? diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/ bridge/synopsys/dw-hdmi.c index b172139502d6..1c18ff1bf24a 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -1104,14 +1104,14 @@ static int dw_hdmi_phy_power_on(struct dw_hdmi *hdmi) unsigned int i; u8 val; - if (phy->gen == 1) { - dw_hdmi_phy_enable_powerdown(hdmi, false); + dw_hdmi_phy_enable_powerdown(hdmi, false); - /* Toggle TMDS enable. */ - dw_hdmi_phy_enable_tmds(hdmi, 0); - dw_hdmi_phy_enable_tmds(hdmi, 1); + /* Toggle TMDS enable. */ + dw_hdmi_phy_enable_tmds(hdmi, 0); + dw_hdmi_phy_enable_tmds(hdmi, 1); + + if (phy->gen == 1) return 0; - } dw_hdmi_phy_gen2_txpwron(hdmi, 1); dw_hdmi_phy_gen2_pddq(hdmi, 0); > I don't see (b) being a problem. About (a), it's possible that the bit above > is interpreted differently on a rockchip SoC versus a renesas chip. Could > you print the value of HDMI_PHY_STAT0 that's read back? The driver should print a "PHY PLL failed to lock" error message to the kernel log in that case. Nick, does that happen on your system ? > If the code returns an -ETIMEDOUT, hdmi->phy.ops->init() will return an > -ETIMEDOUT. This will cause dw_hdmi_setup() to bail out early, before we > get a chance to configure the AVI infoframe and other stuff. I've seen > other HDMI HW throwing up pink strips if the AVI infoframe stuff isn't > configured properly. > > As an experiment, could you forcefully return 0 instead of -ETIMEDOUT and > see if things return back to normal? -- Regards, Laurent Pinchart From 1585190619338191171@xxx Mon Nov 27 04:06:20 +0000 2017 X-GM-THRID: 1582930237289804218 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread