Received: by 10.223.164.202 with SMTP id h10csp1101268wrb; Sun, 26 Nov 2017 20:06:20 -0800 (PST) X-Google-Smtp-Source: AGs4zMaYtIwQpVKrlAd3j1aGuacLtXOojpvHJ3bhFR2f/eYIrcKJ0+2vyDGOBWbyKNSsi+eGHjTH X-Received: by 10.101.98.131 with SMTP id f3mr34867666pgv.366.1511755580189; Sun, 26 Nov 2017 20:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511755580; cv=none; d=google.com; s=arc-20160816; b=kDGOLuwRoUbZSUCqoQG02176fAARmmpM+AbxGZuOJevKtR/wEytNOxph4OH2yyjxmn VAdzO32oF230fRKWqbTVCY5YRMwD16RFup41JWAGO8/FQhjqCVtF4zbR4awAUtPgUDhC oCFAh1YeLkAmh1BPx660B5VJ3w5j500k8fs4LufV5VQi8ZCbH3UNpe0DJUr9fkI5YEUm JXk4qa9RaGYtl9R2IH4XVspy7mfvauIZHMltlznOztGsqkTnZJx3X/TlJkz1kZ/vE/5l m8cjvSUU+MBpR06cLU9v53FSlm3H9LIMhuqXqoAI25aMEt9k5m21NT13+I0/TXm1M3fP OCrw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=vZMzvxoA9FPaaw//Vj1u0Uzb9zYdDyN6vF0BvJ5MQ9o=; b=xtN8GKOwcRDMG7etFRilmgJ7XZtPVftHlD1zJI6+zmG/dBKN0k0wih3LBOlfPixaNb Qq3dOAI/SFWivGolbfUMatI0Shd4+UHTyk8SezB001x7PNW4F6XfYbKXCSrZHvoeOtMD o3NM6MgzNCaZQsu98iOst4NG04EgV6lRVxGm+JM6Pa1Fvwl6m+OK5+dUnsnNwobfKMYR 6xCaU+ael/7WwgOryTlpKieN/slk7DC8QyySI1YOm+7xWk8S4AusirYk8ubbdyVq5DWn s7MkaGHmESWrzdtm4cZOlauXXtcKmaAaJiDI0Z8QhKgxie67FL1sUpLFcSdNuVVlK0CB bPmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=EJc+x4ok; dkim=pass header.i=@codeaurora.org header.s=default header.b=O5gcSQol; 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 o2si21435938plk.297.2017.11.26.20.06.08; Sun, 26 Nov 2017 20:06:20 -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 header.i=@codeaurora.org header.s=default header.b=EJc+x4ok; dkim=pass header.i=@codeaurora.org header.s=default header.b=O5gcSQol; 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 S1751337AbdK0EFQ (ORCPT + 77 others); Sun, 26 Nov 2017 23:05:16 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:45374 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751105AbdK0EFN (ORCPT ); Sun, 26 Nov 2017 23:05:13 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 7883A695D1; Mon, 27 Nov 2017 04:05:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1511755513; bh=PpIK6KLPe8aQRT/+yJy4NbNtSHM9FluakWc+iAPZvU0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=EJc+x4ok38VExL3d2iKfHlNlTPup2kPYVg54KikaCv7lAtdf1FgQE54tMNutQcu3C lDgoU6ljbf7/GynpvUQR9psI4CPta5OB+pmkW3nyY5RZxqy/iTV+WGOE8D3oiFSCs8 TCSmPLBKEegwaO/VzR7gzve8dUJaflIRq3KPVXk4= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.79.40.55] (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: architt@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id D09586958B; Mon, 27 Nov 2017 04:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1511755507; bh=PpIK6KLPe8aQRT/+yJy4NbNtSHM9FluakWc+iAPZvU0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=O5gcSQolZQcYJnXW16g4RpiQFwGVFv5gZyUBE0e+keTgTVjggIF4y+WHSZB6dI0Eh 6ibc6b7M+InjdHD/pnWEvg9GzqIMOpIGqX8DV7QTJ0goRGVQkDXEh6ODMrnxz3rcYa jm+gQW0SkggEnpjm8lqS+fgOqChpx5RWGvFRHXK4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D09586958B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=architt@codeaurora.org Subject: Re: PROBLEM: Asus C201 video mode problems on HDMI hotplug (regression) To: Nick Bowler , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Laurent Pinchart Cc: Linus Torvalds , Dave Airlie , Andrzej Hajda References: <20171116062811.g27zgeejizfxu6oc@aura.draconx.ca> From: Archit Taneja Message-ID: <269ce21a-3685-30e8-fcc8-65070bc59eea@codeaurora.org> Date: Mon, 27 Nov 2017 09:35:03 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20171116062811.g27zgeejizfxu6oc@aura.draconx.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 11/16/2017 11:58 AM, Nick Bowler wrote: > Hi, > > Any ideas on this issue? Are there any additional tests I can perform > to help debug this? > > On 2017-11-05 11:41 -0500, Nick Bowler wrote: >> I completed bisecting this issue. See below. >> >> 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(). 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? 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? Thanks, Archit >> >> Signed-off-by: Laurent Pinchart >> Tested-by: Neil Armstrong >> Reviewed-by: Jose Abreu >> Signed-off-by: Archit Taneja >> Link: http://patchwork.freedesktop.org/patch/msgid/20170305233557.11945-1-laurent.pinchart+renesas@ideasonboard.com >> >> :040000 040000 0defad9d1a61c0355f49c679b18eebae2c4b9495 >> 5d260e6db25d6abc1211d61ec3405be99e693a23 M drivers >> >> This commit does not revert cleanly, but on top of latest master (which has >> the problem) I manually changed the relevant code back to its original state >> and the problem is fixed, like this: >> >> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c >> b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c >> index bf14214fa464..6618aac95a51 100644 >> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c >> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c >> @@ -1100,37 +1100,34 @@ static void dw_hdmi_phy_power_off(struct dw_hdmi *hdmi) >> >> static int dw_hdmi_phy_power_on(struct dw_hdmi *hdmi) >> { >> - const struct dw_hdmi_phy_data *phy = hdmi->phy.data; >> - unsigned int i; >> - u8 val; >> + u8 val, msec; >> >> - 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); >> - return 0; >> - } >> + /* toggle TMDS enable */ >> + dw_hdmi_phy_enable_tmds(hdmi, 0); >> + dw_hdmi_phy_enable_tmds(hdmi, 1); >> >> + /* gen2 tx power on */ >> dw_hdmi_phy_gen2_txpwron(hdmi, 1); >> dw_hdmi_phy_gen2_pddq(hdmi, 0); >> >> /* Wait for PHY PLL lock */ >> - for (i = 0; i < 5; ++i) { >> + msec = 5; >> + do { >> val = hdmi_readb(hdmi, HDMI_PHY_STAT0) & HDMI_PHY_TX_PHY_LOCK; >> - if (val) >> + if (!val) >> break; >> >> - usleep_range(1000, 2000); >> - } >> + if (msec == 0) { >> + dev_err(hdmi->dev, "PHY PLL not locked\n"); >> + return -ETIMEDOUT; >> + } >> >> - if (!val) { >> - dev_err(hdmi->dev, "PHY PLL failed to lock\n"); >> - return -ETIMEDOUT; >> - } >> + udelay(1000); >> + msec--; >> + } while (1); >> >> - dev_dbg(hdmi->dev, "PHY PLL locked %u iterations\n", i); >> return 0; >> } >> > > Thanks, > Nick > -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project From 1584206642637104929@xxx Thu Nov 16 07:26:26 +0000 2017 X-GM-THRID: 1582930237289804218 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread