Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2738308ybp; Thu, 10 Oct 2019 11:50:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqhcu+i1y3GN900RKOd1fpegnVHq8tiDQQLFU2fFxwpejV7UmcquPiyVW4PeRzrFthy5Gs X-Received: by 2002:aa7:ce8e:: with SMTP id y14mr9574535edv.5.1570733407138; Thu, 10 Oct 2019 11:50:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570733407; cv=none; d=google.com; s=arc-20160816; b=Bj3kGi34DDRwjfgERLAO6PmVnmRbfE/0oCXPtzbe/ijcewvAHOKvi9xIVeHBreJV6V 2a/QW6lwqhE1rCz1Rv06VhbPcMLcZgHHcVq03FAtjKI4KucCi/N/IsbFEey3fJ956FDD l5uEg1+2gYj3oZF3HrBjpWpqA5JQv+qT+NIM1kSHA+OgGvX4LUT8XIliaKJgYOhqEqEp hoFnNNNYWc1SwWVpzbQ4NpN6FQoz06/J+/2iWxB1cCcYo7U5Id/doU46ZnlGXlKOY33O kL1IuN90gR+/nEj2QWP7PrwlDutnnJJMDxwrNkuamFLS1d6QTMT6PNtDMBArh1+98OZ2 /Dgg== 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=n9glmzMsjEQ54wWh9m1TLXnnqt0zz0o1L0ZQOtKhkaY=; b=c7TgQtKjqOUddU7vEXpPbrmH//GEBSlfY+E8ccuwSPMYOLaEtHv6KzNMOc7ItFwBNb P8SojM/B5AZkZtJvM75YIVerbbzJhcvWl3n54Y3JxV0PvA07DowwmwvQWvsGz14ZgXho zbPBLcEaoF6fExmV//JQYqf0Rnczq7ICElvWZSPS2qWfJ41BZHQSwnb+67G8npmAMItj 4P40NqyIdFytOOs5ya1MrtEIG6iQY/pmFDE3UDuq/lgXCONNslkNFD2zM8FNSpZTJ1Xq Nn0eYxgwrmWW5Tm6yANCn/C+K623x5gyQnSrlix0ABqZ/ClI8aZvDX/7omvnGb0tf3G8 N8mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=fDdQv6Zq; 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 f21si4309683edb.379.2019.10.10.11.49.43; Thu, 10 Oct 2019 11:50:07 -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=@poorly.run header.s=google header.b=fDdQv6Zq; 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 S1726773AbfJJStf (ORCPT + 99 others); Thu, 10 Oct 2019 14:49:35 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:39230 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbfJJSte (ORCPT ); Thu, 10 Oct 2019 14:49:34 -0400 Received: by mail-yb1-f195.google.com with SMTP id v37so2277618ybi.6 for ; Thu, 10 Oct 2019 11:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=n9glmzMsjEQ54wWh9m1TLXnnqt0zz0o1L0ZQOtKhkaY=; b=fDdQv6ZqcWcquRA0TqInY5GiGIZQO3lADzd19fpsRGR6VxXATIBGBh0cAm1MT69jW6 fezVNb3MvUHgvELpLib8es8l5CGYbc8+ZeHVwm5pd2oCvKl5dN0dIfJFJlR2IeeNW81N xODItm3Q1JB4veO/2+rLOtqc5wFGXPm/XCdevrrGnQ1L8ZF3GR+VtmD+4fURxM22Tl+j 8e6ZMiTeIV5oyEf5j5Uilzmd9fzfE60h4zXloDON32Iug1gvf5m8/eQLQA8d09A05dpu WiFvmJQ2fltbQ8xbgb0iZ55JkTQE94yd+YgfXV00R+2Dke1JqkRvEm9R1UsuDXmy84gK 9IhQ== 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=n9glmzMsjEQ54wWh9m1TLXnnqt0zz0o1L0ZQOtKhkaY=; b=rx2xxg/kT1Y2XI7HtoT6yJP0EvsR16hPqbhouRVG7FXDu1phYk/I1JiF/I3h9VdAVM DLCKVk/PlOe91sfe1iLJnqkRaRFPjGrsJESBhWEIFce4p6dOIQlfqnf5FJLckmke547j sVGrH8xya90EAAqriMPaGwzdDx6dZay6p495D0Mke4y0BXXC8TsT7ZVg+69YXRldAPJz Qr1/cs/DfLNqUv7uWWa0sZMT6zw0Vtpl8f6tZC5S9LM7i54R39WDfgppu9HRC2jhEJIu MXcOsjbwCdRKutzCSyP3t9bvNg+uvaS8so9e1VsFcc3ZcA1rB9lsoFW6k6Xh+do3tFTJ EX2Q== X-Gm-Message-State: APjAAAUdrNTmRhhiW3rPFlPLiZJSi/nSYxDwP6/burKILJQu5nyoPgA6 Z9k3PMwakwShXx4MQcYF1VlXu9RbxSM0GdJUMOEozw== X-Received: by 2002:a25:348e:: with SMTP id b136mr7032957yba.159.1570733373815; Thu, 10 Oct 2019 11:49:33 -0700 (PDT) MIME-Version: 1.0 References: <20191009213454.32891-1-jeffrey.l.hugo@gmail.com> <20191010184544.GK85762@art_vandelay> In-Reply-To: <20191010184544.GK85762@art_vandelay> From: Sean Paul Date: Thu, 10 Oct 2019 14:48:57 -0400 Message-ID: Subject: Re: [PATCH] drm/msm/dsi: Implement reset correctly To: Jeffrey Hugo Cc: Rob Clark , Dave Airlie , Daniel Vetter , linux-arm-msm , dri-devel , freedreno , LKML 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 On Thu, Oct 10, 2019 at 2:45 PM Sean Paul wrote: > > On Wed, Oct 09, 2019 at 02:34:54PM -0700, Jeffrey Hugo wrote: > > On msm8998, vblank timeouts are observed because the DSI controller is not > > reset properly, which ends up stalling the MDP. This is because the reset > > logic is not correct per the hardware documentation. > > > > The documentation states that after asserting reset, software should wait > > some time (no indication of how long), or poll the status register until it > > returns 0 before deasserting reset. > > > > wmb() is insufficient for this purpose since it just ensures ordering, not > > timing between writes. Since asserting and deasserting reset occurs on the > > same register, ordering is already guaranteed by the architecture, making > > the wmb extraneous. > > > > Since we would define a timeout for polling the status register to avoid a > > possible infinite loop, lets just use a static delay of 20 ms, since 16.666 > > ms is the time available to process one frame at 60 fps. > > > > Fixes: a689554ba6ed (drm/msm: Initial add DSI connector support) > > Signed-off-by: Jeffrey Hugo > > --- > > > > Rob et al, is it possible for this to go into a 5.4-rc? Sorry, I missed this on the first go-around, I'm Ok with this getting into 5.4. Rob, if you're Ok with this, I can send it through -misc unless you're planning an msm-fixes PR. > > > > drivers/gpu/drm/msm/dsi/dsi_host.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c > > index 663ff9f4fac9..68ded9b4735d 100644 > > --- a/drivers/gpu/drm/msm/dsi/dsi_host.c > > +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c > > @@ -986,7 +986,7 @@ static void dsi_sw_reset(struct msm_dsi_host *msm_host) > > wmb(); /* clocks need to be enabled before reset */ > > > > dsi_write(msm_host, REG_DSI_RESET, 1); > > - wmb(); /* make sure reset happen */ > > + msleep(20); /* make sure reset happen */ > > Could you please pull this out into a #define used for both in case we decide to > tweak it? I don't want these 2 values to drift. > oh yeah, and with that fixed, Reviewed-by: Sean Paul > Thanks, > Sean > > > dsi_write(msm_host, REG_DSI_RESET, 0); > > } > > > > @@ -1396,7 +1396,7 @@ static void dsi_sw_reset_restore(struct msm_dsi_host *msm_host) > > > > /* dsi controller can only be reset while clocks are running */ > > dsi_write(msm_host, REG_DSI_RESET, 1); > > - wmb(); /* make sure reset happen */ > > + msleep(20); /* make sure reset happen */ > > dsi_write(msm_host, REG_DSI_RESET, 0); > > wmb(); /* controller out of reset */ > > dsi_write(msm_host, REG_DSI_CTRL, data0); > > -- > > 2.17.1 > > > > -- > Sean Paul, Software Engineer, Google / Chromium OS