Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2736518ybp; Thu, 10 Oct 2019 11:48:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzoJeqESpeJ7DNKn0Lepwvn1KyxZVMr5QNS7zncwC/VmUolnxC4apPV9t1mgKI0UOl0hK6c X-Received: by 2002:a05:6402:7d7:: with SMTP id u23mr9568861edy.218.1570733288777; Thu, 10 Oct 2019 11:48:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570733288; cv=none; d=google.com; s=arc-20160816; b=O2mVyQlaM/gaBWtZo2HnsZNemwZdZEiTE0/g2ba7eLY1olkjwxZq6TZ2tXOXobDM/F JJlDYmzME6T04ZeQ4fPhN/Gzbe7ewIkKBo9i1pgi8eYLEv4gfhnFPJqXEAOYpOKVips+ oB99sw3FpboZnbNtn3OtgMcfgnf3jD/VabL+tcwQ5IriLkpUXvhnlBG4KDvA6+1AOeoL Gin55k+t0snXltb2U8aANGIiuu8fodSD4ECtw8bAaNW4XNbq+iSL/VBRRBMpMqOXp8n1 pzc6ihCvd+jgDAwU6E9x8wtDbNdrrmje4lGI5L6OzfMjGuLymJtqxsCLDERFxP3UDsuT COdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=A/ttt3bFmMs3oe08RcmXuhu4LizkiCyYFIE0laa45So=; b=qxhcF5n4ClTx7ma6rja2lCmfc1zDS75Vc8uITvUGLoCIjouqVIeYleD8Uok8bdBQPk pLIpDugVWDpgCShIHY+/bQrcrvx8JT85mKVKLJMwdeCvQmYybJraXh8yZ2c8Lzd95X62 O47rxTrwnp8lXIavCepxZtMsGNbJSiJ2CQqn8+10GyekiPWiSCKxelX55bsNouq8l040 OAhvAVZIPcSXweYm9DPGpG5sUGqSw4KTdoD5OXIUR8+Z2CxmfMwjpNL8DXudoSVPWmgx yobFT2/N2oHvWyXr0v7Rkua49IUm9gX0U8luK7r5qa5cjiPkY00ZTp2p8ZQKg5YCpyJJ Z7yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=IyjR386B; 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 va7si3648398ejb.4.2019.10.10.11.47.45; Thu, 10 Oct 2019 11:48:08 -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=IyjR386B; 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 S1726900AbfJJSqS (ORCPT + 99 others); Thu, 10 Oct 2019 14:46:18 -0400 Received: from mail-yb1-f194.google.com ([209.85.219.194]:38577 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727194AbfJJSpq (ORCPT ); Thu, 10 Oct 2019 14:45:46 -0400 Received: by mail-yb1-f194.google.com with SMTP id r68so2276795ybf.5 for ; Thu, 10 Oct 2019 11:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=A/ttt3bFmMs3oe08RcmXuhu4LizkiCyYFIE0laa45So=; b=IyjR386BAgPPWowRuqUZTRmePv2ormX4YmToHCVqZVPMdy7A3ol3aZwvXdIydzup9K przYrp1X0Hv1wH8j6k0fnoNR5Pl9UkSctcdX23cXDOxQ6R54KO/UfVG7tOVLbwdpuls5 oxPa8TshABAWqRdYX5+QCIONLi/e3rSqLbVNV2+bsjDegRpDiCYXWUFhnrD/YsPxXc6l kMw8l9PgWqLd+n+Aqv3piQLUzjoywgzTh7ISxEKBTfPvQQDF5B4Jtfi/qRxqTT42N1cW fJZW3r8z7gW9RgQcC8KX+qOHw9k3xrwWRaXWPBPtauKpuV2lr0qgjs/CMsahE6havdRp qAFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=A/ttt3bFmMs3oe08RcmXuhu4LizkiCyYFIE0laa45So=; b=ACpJVElzmdCXka8t17aZERLguKBsWuSrKpSZT0XP5az5NPL3PUfEv+1gzobeUZywzi 5n1HLDE56mytop4dReX1YhT9kHv3stANnlF0drYf6TFGOlUva6zEu659WOWK3U3e/lhZ GVsik0VopuYWrUc1jAKpQG119b44WIz+S739YQmBZgcheO7+vuz2wdAjUj7c+E8Rtkj8 oyWeadIdtHGvzN0AyOYaTF9GS67VIciWf0J7IBt7N0jSYXqJ54uKDo51VMDEg6torD4w ot9jc4M+3aEzYMSlO6TLPc70o1hvRTU0kX9E07SSQXhDVLFJDeLCXaTcIbJZaeVBNb+I 09vA== X-Gm-Message-State: APjAAAVLn78hnb3sOfeeUdgfVevbQwAPNyCz2cyDEZvfL/AYP5Nk7wcW 5gSjR1V4j9HcjeHYLLB3fpPbXX0hicQ= X-Received: by 2002:a25:84ce:: with SMTP id x14mr7606863ybm.437.1570733145768; Thu, 10 Oct 2019 11:45:45 -0700 (PDT) Received: from localhost ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id y129sm1682398ywy.41.2019.10.10.11.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 11:45:45 -0700 (PDT) Date: Thu, 10 Oct 2019 14:45:44 -0400 From: Sean Paul To: Jeffrey Hugo Cc: robdclark@gmail.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/msm/dsi: Implement reset correctly Message-ID: <20191010184544.GK85762@art_vandelay> References: <20191009213454.32891-1-jeffrey.l.hugo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191009213454.32891-1-jeffrey.l.hugo@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > > 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. 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