From mboxrd@z Thu Jan 1 00:00:00 1970 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.8 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 87BF6C433E0 for ; Thu, 30 Jul 2020 08:13:12 +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 5FBD92250E for ; Thu, 30 Jul 2020 08:13:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cANn2wRU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5FBD92250E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.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 D7B476E894; Thu, 30 Jul 2020 08:13:11 +0000 (UTC) Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id A94E96E894 for ; Thu, 30 Jul 2020 08:13:10 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id t23so4396530ljc.3 for ; Thu, 30 Jul 2020 01:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lWJRHZ1ZuaSX3iNfV25S/VOHlfOESHtRVBg0I8TPzUw=; b=cANn2wRUPVKWJuI9G6aYy8rgZx8aO7NV1kLe/4J5F5CAC6CUcf/2cbiVetS+62V6i/ jsDvNUzaIRK885Fyu7YP1sSYoCTazThhkSjqPkzqPKD4TKtq27OOHNtIaLg/McdH/b2W Isi1KQaznweqRBKe86fUQ/LvSAQYXVGMBsTJZsLnHqPP+HDRgybPUsjd96ewYHcYafVf SwVRJfEjtZjS217nwR7AdJPQ+45RgCncZA1zhkVWdSdtss2O6BTtCpAqBSLhi8Z0A3Nv x5YGEApi1xRfwJJEO0tMPLCj9fcgRIqNoYDqzPx5WHfsKvGC239ECKrGcmKndwWvS1fs B5kQ== 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:mime-version :content-transfer-encoding; bh=lWJRHZ1ZuaSX3iNfV25S/VOHlfOESHtRVBg0I8TPzUw=; b=RmnVGGYBnISARPdu2Yfgqd2UFjS9jgodeyIr4JfluxkF2/QWNIWAsob59nXATfYEGk vEeG3nScF3BUULt0xmmtkescUqYF+82G2h41uEQy093VBIcSHwDqNiankwRtJ5qQ0MeH PRx9l0EmjgKNhd8cnWlqXaAAD+OrwH0olONE1vV+iXPadJ8IwJ7xVb9Qa1rk7M/lFBqH iOk7yj15mJIezHuc2V9rCIfEjYeu9Ln+W6Cu9Qi1T1mZe93oMbK701g9gY7kMS1OoPFl RdVSvSO7cmeK0ZnJwzlJELS2zPrrNdnU3VupnpvqeHYg8lSoIzNXITEt4lT55sg/g5wJ 5IBQ== X-Gm-Message-State: AOAM531mrPQrqluxLEnwXFRYBzr2RpERXRP1OQtpa8eCU9q5KYbuRg4W ZhN5j+Dxe9HXwGShGAtHNZCNk82mxHuj+w== X-Google-Smtp-Source: ABdhPJzKZg/UXw12STP712u9tGhyTgIpfolQi9JWx7nN61izSi/1xgactqExZJ3LmpxW08WTiTvJtw== X-Received: by 2002:a2e:b0e9:: with SMTP id h9mr964976ljl.3.1596096788855; Thu, 30 Jul 2020 01:13:08 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id z186sm1015860lfa.6.2020.07.30.01.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2020 01:13:08 -0700 (PDT) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul Subject: [PATCH] drm/mcde: Retry DSI read/write transactions Date: Thu, 30 Jul 2020 10:13:06 +0200 Message-Id: <20200730081306.34783-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 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: Stephan Gerhold , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The vendor driver makes a few retries on read DSI transactions, something that is needed especially in case of read (such as reading the panel MTP ID) while the panel is running in video mode. This happens on the Samsung s6e63m0 panel on the Golden device. Retry reads and writes alike two times. Cc: Stephan Gerhold Signed-off-by: Linus Walleij --- drivers/gpu/drm/mcde/mcde_dsi.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c index 337c4c5e3947..76fecd7ab658 100644 --- a/drivers/gpu/drm/mcde/mcde_dsi.c +++ b/drivers/gpu/drm/mcde/mcde_dsi.c @@ -207,8 +207,8 @@ static int mcde_dsi_host_detach(struct mipi_dsi_host *host, (type == MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM) || \ (type == MIPI_DSI_DCS_READ)) -static ssize_t mcde_dsi_host_transfer(struct mipi_dsi_host *host, - const struct mipi_dsi_msg *msg) +static ssize_t mcde_dsi_host_transfer_commit(struct mipi_dsi_host *host, + const struct mipi_dsi_msg *msg) { struct mcde_dsi *d = host_to_mcde_dsi(host); const u32 loop_delay_us = 10; /* us */ @@ -353,6 +353,23 @@ static ssize_t mcde_dsi_host_transfer(struct mipi_dsi_host *host, return ret; } +static ssize_t mcde_dsi_host_transfer(struct mipi_dsi_host *host, + const struct mipi_dsi_msg *msg) +{ + struct mcde_dsi *d = host_to_mcde_dsi(host); + int retries = 2; + ssize_t ret; + + while (retries--) { + ret = mcde_dsi_host_transfer_commit(host, msg); + if (ret >= 0) + return ret; + } + + dev_err(d->dev, "gave up transfer after retrying\n"); + return ret; +} + static const struct mipi_dsi_host_ops mcde_dsi_host_ops = { .attach = mcde_dsi_host_attach, .detach = mcde_dsi_host_detach, -- 2.26.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel