From patchwork Fri Oct 30 01:17:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11868733 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCDEEC61DD8 for ; Fri, 30 Oct 2020 08:25:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6ADF222210 for ; Fri, 30 Oct 2020 08:25:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Oe5wxWNn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6ADF222210 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0804C6ECE7; Fri, 30 Oct 2020 08:25:20 +0000 (UTC) Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id D4F6A6E946 for ; Fri, 30 Oct 2020 01:17:43 +0000 (UTC) Received: by mail-pf1-x441.google.com with SMTP id e15so3856726pfh.6 for ; Thu, 29 Oct 2020 18:17:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Bd9wyHuVLCFuoo+uR0VpYuko8KnuaddorUz56unAlSM=; b=Oe5wxWNnvQ9eFlBIuzDEJsO0w0uOadc2EQV2r7nsTQfk5AnTdC50fNEmA1X/7+fO+2 j9UGXevXdEb9/Y1yqJCFvmM+a02Z/0tEgHEw0YKgLH7WKzWTy4pnvudB8vLUNs4NXaDe edxsHmzkVU5UOPtC+oWAtoJ5nLkpdGfvzzs8g= 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=Bd9wyHuVLCFuoo+uR0VpYuko8KnuaddorUz56unAlSM=; b=gHlZy+aZa/WLeM1+UO7NJEw8UcT1sZ/e4AYsPxZ84c/YZ+pqRvKFYuQJwL6i+abhSh j5Ec6vwhvVM3NBuHyAD6sIERVbZ/2EQ4z8+vKZEcKC1Kl0kJS0O03nb80rMJFiSux+sM wrkDc8gCQn/NoFe0YwJ+CIpTwbmPL6A4Tfq2CfhVB9CCRZwWUPtnOi/4PfU+u6Fyjgfr Q/3jsEsvfZ341/X1Ia4Ug3S3gpShhHDx/GkM9kgEpYLJPiuorVEalQDsPUa3dRBdTEKz cu/HM8YxhyWB4gKWM5hN1K9150UtplzjB8XQbTsz61T6cXj/Rqjbux6M/mPnUADl9Kn8 jgrw== X-Gm-Message-State: AOAM530UvliHWzugvqFgEO5DadcYOOQDF2XQJsS2/RdEtopeMmLKvYhI K/fp6jbJHkwWXDN5zhH6JDn0iA== X-Google-Smtp-Source: ABdhPJwZNGBc2+B0BGbpbZzFyHysHQxtULqVw9MiqUX8PQT5YzKL7R8AjHlHL79uwXnq5+xv0EWaXQ== X-Received: by 2002:a63:595a:: with SMTP id j26mr18073pgm.37.1604020663485; Thu, 29 Oct 2020 18:17:43 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id z26sm4477854pfq.131.2020.10.29.18.17.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 18:17:42 -0700 (PDT) From: Stephen Boyd To: Andrzej Hajda , Neil Armstrong Subject: [PATCH v2 2/4] drm/bridge: ti-sn65dsi86: Make polling a busy loop Date: Thu, 29 Oct 2020 18:17:36 -0700 Message-Id: <20201030011738.2028313-3-swboyd@chromium.org> X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog In-Reply-To: <20201030011738.2028313-1-swboyd@chromium.org> References: <20201030011738.2028313-1-swboyd@chromium.org> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 30 Oct 2020 08:23:17 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jernej Skrabec , Jonas Karlman , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Douglas Anderson , Sean Paul , Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There's no reason we need to wait here to poll a register over i2c. The i2c bus is inherently slow and delays are practically part of the protocol because we have to wait for the device to respond to any request for a register. Let's rely on the sleeping of the i2c controller instead of adding any sort of delay here in the bridge driver. Reviewed-by: Douglas Anderson Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Cc: Sean Paul Signed-off-by: Stephen Boyd --- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index a1ebfa95088c..c77f46a21aae 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -881,9 +881,9 @@ static ssize_t ti_sn_aux_transfer(struct drm_dp_aux *aux, regmap_write(pdata->regmap, SN_AUX_CMD_REG, request_val | AUX_CMD_SEND); + /* Zero delay loop because i2c transactions are slow already */ ret = regmap_read_poll_timeout(pdata->regmap, SN_AUX_CMD_REG, val, - !(val & AUX_CMD_SEND), 200, - 50 * 1000); + !(val & AUX_CMD_SEND), 0, 50 * 1000); if (ret) return ret;