Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2673373ima; Mon, 22 Oct 2018 13:55:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV61ENAW8RW8TcpdkTGMaWc0c3QSZy4d8G+Y4IXA5rqjQi2WGLrJFrkr/LuqfBG8y6W9BTwpZ X-Received: by 2002:a17:902:d806:: with SMTP id a6-v6mr12542969plz.301.1540241747632; Mon, 22 Oct 2018 13:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540241747; cv=none; d=google.com; s=arc-20160816; b=piHSnbtoVfOBRHz8xW9ZwAlzH9P4JepD+TMD9kWRsgSUMAouDlvKBlFwqSjkWFjYPp BA8ZDsM8ZqHnk0nMD4zesThL8H2t2v2LhaWgNL/ea5CpOs1TTfD2jRcW/rsGv0zVEaln W65gIEsCJdpZGoLKkE+1ZwRrLEVl9lIfkk/Gst6ulBTG/Lli7Yv8YYuoOYNRcIIADC/4 IPIy3pYX0e0EVM71HxJI3JHe9E2vCN010Ep0JruKz0R8i3BWG7gbpQpnFuqGeHj/L/6r +AS/LNWAwF/LCi+nzmOYuQ7UltSSWGFsm1VISrS2u2//pIraJJ9Y0ZR856dkFnb/qNEX 7DaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=rBe0nUFTKXNl1wdkj6jYjc/TJUFR4EDZLqNOxMXo7Iw=; b=K9rxVUZsxn8C6OfFElYILWFjqa4UoRqAuXMDvb4gwqkTnNRI8h3Og6GmDZKUlisumX 1GmGnpNlArI17UgDwMcdNFKOFyMp4ifddyqQrhbdRV5LzcKkUnyexOCx/AKk8UmYVBvu 9WjGSt132WYKoY94xm99sPg4uECOo4z77YFDdNyV+JrRWBJPEDbvWv8Ec4VMaLr1eW2c EzdZNdihquS+98LEl/vJQ45Y//MFKdajs+f7LXYGd7fhXshSjFETC32f88/uk6kLgVsH WREiulFafP7AVpCZQ/ZiI089TzRs7aQh/D5b8wQOcD8FY35fsxPphm21MnZ7b/iYOF5p uTSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bZDvvawW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c81-v6si37952662pfb.153.2018.10.22.13.55.32; Mon, 22 Oct 2018 13:55:47 -0700 (PDT) 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=@chromium.org header.s=google header.b=bZDvvawW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729384AbeJWFOs (ORCPT + 99 others); Tue, 23 Oct 2018 01:14:48 -0400 Received: from mail-ua1-f68.google.com ([209.85.222.68]:35541 "EHLO mail-ua1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727063AbeJWFOr (ORCPT ); Tue, 23 Oct 2018 01:14:47 -0400 Received: by mail-ua1-f68.google.com with SMTP id m18so10509600uaq.2 for ; Mon, 22 Oct 2018 13:54:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rBe0nUFTKXNl1wdkj6jYjc/TJUFR4EDZLqNOxMXo7Iw=; b=bZDvvawWH0rs5rSI2DvQoEY/aA3736xt2YkBi5pVs+3fI+wnrG4VJPDR/LbE1SkXf9 aC0kGr11iyYyFri2O4tM5zTPvI/8UNcgL95d4KeU8/csBC4YAHK39TxkfzsActgCblxo HvCNJCWIOkFFJ8A4zUYjA+uEmbg+4bJBy4S2Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rBe0nUFTKXNl1wdkj6jYjc/TJUFR4EDZLqNOxMXo7Iw=; b=Db63+5DOOr6diRIIbaW8o+sk8Riqx39pgNYCMTDV7MnIgtJFaJ+H81bG6c6dcW7LlJ Vtkgyc54OD2RuXEyk/qxChtbxzxyHYBzJsMlYaVGuR1o6javTWlH13yeWjAFwCZk0ugE NjKKbGvi2zRQv8S75rPCHMPjN7K1HQhLjpqDQCY3eH2XjLaQnDDlxYLoucgqr9r1Hwoy IM0M0vse0d+HNVPocJNreQ2HTjMQqBKokWwytYVPrdbH+7EbiITZZCpMV8T11M6hVhdH Iupt22OVxBD2EFg5yPH6JEgXfjbXV9yCgCdw88j2J0/CrFNHjx2RZOrllmMY1Vrav7Fq Y0tA== X-Gm-Message-State: ABuFfog0HEtTbZA2RikiSJWXcBTqAV1raPWpSkGdg5FAUfEe3tdgk7CQ gtAK4ECfgJipywQPNuF/tXAWj95krOU= X-Received: by 2002:ab0:15c5:: with SMTP id j5mr12873694uae.50.1540241678778; Mon, 22 Oct 2018 13:54:38 -0700 (PDT) Received: from mail-ua1-f51.google.com (mail-ua1-f51.google.com. [209.85.222.51]) by smtp.gmail.com with ESMTPSA id q62sm2508236vkq.7.2018.10.22.13.54.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 13:54:38 -0700 (PDT) Received: by mail-ua1-f51.google.com with SMTP id j13so10511556ual.0 for ; Mon, 22 Oct 2018 13:54:37 -0700 (PDT) X-Received: by 2002:a9f:3743:: with SMTP id a3mr21246703uae.86.1540241677375; Mon, 22 Oct 2018 13:54:37 -0700 (PDT) MIME-Version: 1.0 References: <20181019201940.138179-1-dianders@chromium.org> <20181019201940.138179-2-dianders@chromium.org> In-Reply-To: <20181019201940.138179-2-dianders@chromium.org> From: Doug Anderson Date: Mon, 22 Oct 2018 13:54:26 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] drm/bridge: ti-sn65dsi86: Allow DT to set "HPD delay" To: Sandeep Panda , Sean Paul Cc: linux-arm-msm , Jeykumar Sankaran , ryandcase@chromium.org, Andrzej Hajda , Archit Taneja , LKML , dri-devel , David Airlie , Laurent Pinchart Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, Oct 19, 2018 at 1:20 PM Douglas Anderson wrote: > > Let's solve the mystery of commit bf1178c98930 ("drm/bridge: > ti-sn65dsi86: Add mystery delay to enable()"). Specifically the > reason we needed that mystery delay is that we weren't paying > attention to HPD. > > Looking at the datasheet for the same panel that was tested for the > original commit, I see there's a timing "t3" that times from power on > to the aux channel being operational. This time is specced as 0 - 200 > ms. The datasheet says that the aux channel is operational at exactly > the same time that HPD is asserted. > > Scoping the signals on this board showed that HPD was asserted 84 ms > after power was asserted. That very closely matches the magic 70 ms > delay that we had. ...and actually, in my esting the 70 ms wasn't > quite enough of a delay and some percentage of the time the display > didn't come up until I bumped it to 100 ms. > > To solve this, we tried to hook up the HPD signal in the bridge. > ...but in doing so we found that that the bridge didn't report that > HPD was asserted until ~280 ms after we powered it (!). This is > explained by looking at the sn65dsi86 datasheet section "8.4.5.1 HPD > (Hot Plug/Unplug Detection)". Reading there we see that the bridge > isn't even intended to report HPD until 100 ms after it's asserted. > ...but that would have left us at 184 ms. The extra 100 ms > (presumably) comes from this part in the datasheet: > > > The HPD state machine operates off an internal ring oscillator. The > > ring oscillator frequency will vary [ ... ]. The min/max range in > > the HPD State Diagram refers to the possible times based off > > variation in the ring oscillator frequency. > > Given that the 280 ms we'll end up delaying if we hook up HPD is > _slower_ than the 200 ms we could just hardcode, for now we'll solve > the problem by just allowing boards to hardcode a value. If someone > using this part finds that they can get things to work more quickly by > actually hooking up HPD that can always be a future patch. > > One last note is that I tried to solve this through another way: In > ti_sn_bridge_enable() I tried to use various combinations of > dp_dpcd_writeb() and dp_dpcd_readb() to detect when the aux channel > was up. In theory that would let me detect _exactly_ when I could > continue and do link training. Unfortunately even if I did an aux > transfer w/out waiting I couldn't see any errors. Possibly I could > keep looping over link training until it came back with success, but > that seemed a little overly hacky to me. > > Signed-off-by: Douglas Anderson > --- > > drivers/gpu/drm/bridge/ti-sn65dsi86.c | 45 ++++++++++++++++++++++----- > 1 file changed, 37 insertions(+), 8 deletions(-) Adding breadcrumbs to point to the new version of this patch at AKA ("[4/6] drm/bridge: ti-sn65dsi86: Remove the mystery delay"). I didn't call that a v2 since it's a pretty different approach compared to this one, but (assuming people are OK w/ it) it replaces this patch. Thanks! -Doug