From patchwork Mon Aug 13 21:30:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10564843 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AD9E414E2 for ; Mon, 13 Aug 2018 21:31:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E0F2296D3 for ; Mon, 13 Aug 2018 21:31:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90DC6296FA; Mon, 13 Aug 2018 21:31:48 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 4C313296D3 for ; Mon, 13 Aug 2018 21:31:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4AEAE6E080; Mon, 13 Aug 2018 21:31:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc44.google.com (mail-yw1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7192D6E0F7 for ; Mon, 13 Aug 2018 21:31:45 +0000 (UTC) Received: by mail-yw1-xc44.google.com with SMTP id w76-v6so14712081ywg.4 for ; Mon, 13 Aug 2018 14:31:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ys8SW3GC1L+75WhEiQDh4VTBjEQaoUqZQQXkF3DbMH8=; b=rWo1XUn6/nUp2Kx/YlYT99eCGNkXfroQlI9U36YFGdZyDpgjeuf5PUgon/+PDkjR0d lnGFwK+A5ZEgYt72pk3fYjJWnyn2qG/wdkazWKNB+K8iy2l947sFw19AA1GQWA0Y0pSy PGrsWFZ3ywHFeRZhGBAJp6MnJr8PJ44YRzK83L8dPnh0NbZiCDmTVZDlwwHzQOYVIPuP DAX9HTNgSXJTOqDsb/V66TtUJJJgceGGC3VWiqfBqVJRGKJM+dT0wMDh2NwMtQdmLSS/ wQguBzPdaJKWxdLLA9O2fupT160Skr17WchKZ302oX3hMuC3Y/B/5btGArbKQo0tfqC/ F+Ig== X-Gm-Message-State: AOUpUlGLwbkoB3ERHFTMZUdeC4t/vm2fc64inJWAjgubX7Tfb9NSzj9S mDOV341tlzvkSot7/ILAANu0/v8+JbM= X-Google-Smtp-Source: AA+uWPwPoA6WHhd8G1pRB4NRqql1C6tcZ094EUbLnzJmcZKD0vNb9MbWpo6V5gk2dNW1fLGSRf58Uw== X-Received: by 2002:a81:7404:: with SMTP id p4-v6mr10263246ywc.407.1534195904643; Mon, 13 Aug 2018 14:31:44 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id m82-v6sm26715319ywm.19.2018.08.13.14.31.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 14:31:44 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 7/7] drm/bridge: ti-sn65dsi86: Add mystery delay to enable() Date: Mon, 13 Aug 2018 17:30:46 -0400 Message-Id: <20180813213058.184821-8-sean@poorly.run> X-Mailer: git-send-email 2.18.0.597.ga71716f1ad-goog In-Reply-To: <20180813213058.184821-1-sean@poorly.run> References: <20180813213058.184821-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sandeep Panda , Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul This patch adds a 70ms mystery delay to the bridge driver in enable. By experimentation, it seems like it can go anywhere up until we initiate semi-auto link training. If we don't have the delay, link training fails. I tried to root cause this as best I could, but neither the datasheet for the panel nor the bridge mention a delay of this magnitude in their timing requirements. So for now, add the mystery delay until someone figures out a better fix. Changes in v3: - Added to the set Cc: Sandeep Panda Signed-off-by: Sean Paul Reviewed-by: Sandeep Panda --- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index d3e27e52ea759..f8a931cf3665e 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -458,6 +458,18 @@ static void ti_sn_bridge_enable(struct drm_bridge *bridge) unsigned int val; int ret; + /* + * FIXME: + * This 70ms was found necessary by experimentation. If it's not + * present, link training fails. It seems like it can go anywhere from + * pre_enable() up to semi-auto link training initiation below. + * + * Neither the datasheet for the bridge nor the panel tested mention a + * delay of this magnitude in the timing requirements. So for now, add + * the mystery delay until someone figures out a better fix. + */ + msleep(70); + /* DSI_A lane config */ val = CHA_DSI_LANES(4 - pdata->dsi->lanes); regmap_update_bits(pdata->regmap, SN_DSI_LANES_REG,