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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19C37C4332F for ; Mon, 28 Mar 2022 01:46:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237356AbiC1BsB (ORCPT ); Sun, 27 Mar 2022 21:48:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237386AbiC1Br6 (ORCPT ); Sun, 27 Mar 2022 21:47:58 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE62C4FC4D; Sun, 27 Mar 2022 18:46:14 -0700 (PDT) X-UUID: cc02df59dc6545e4b2e68572709dce71-20220328 X-UUID: cc02df59dc6545e4b2e68572709dce71-20220328 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1747605447; Mon, 28 Mar 2022 09:46:08 +0800 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Mon, 28 Mar 2022 09:46:06 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 28 Mar 2022 09:46:06 +0800 Received: from mtksdccf07 (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 28 Mar 2022 09:46:06 +0800 Message-ID: Subject: Re: [PATCH v9 21/22] drm/mediatek: change the aux retries times when receiving AUX_DEFER From: Rex-BC Chen To: Guillaume Ranquet , , , , , , , , , , , , , , , , , CC: , , , , , , , Date: Mon, 28 Mar 2022 09:46:06 +0800 In-Reply-To: <20220327223927.20848-22-granquet@baylibre.com> References: <20220327223927.20848-1-granquet@baylibre.com> <20220327223927.20848-22-granquet@baylibre.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2022-03-28 at 00:39 +0200, Guillaume Ranquet wrote: > From: Jitao Shi > > DP 1.4a Section 2.8.7.1.5.6.1: > A DP Source device shall retry at least seven times upon receiving > AUX_DEFER before giving up the AUX transaction. > > Aux should retry to send msg whether how many bytes. > > Signed-off-by: Jitao Shi > Signed-off-by: Guillaume Ranquet > --- > drivers/gpu/drm/mediatek/mtk_dp.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c > b/drivers/gpu/drm/mediatek/mtk_dp.c > index e099491cc6a4..7a197c4a7143 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dp.c > +++ b/drivers/gpu/drm/mediatek/mtk_dp.c > @@ -2016,7 +2016,7 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > bool is_read; > u8 request; > size_t accessed_bytes = 0; > - int retry = 3, ret = 0; > + int retry, ret = 0; > > mtk_dp = container_of(mtk_aux, struct mtk_dp, aux); > > @@ -2050,14 +2050,21 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > } > > if (msg->size == 0) { > - ret = mtk_dp_aux_do_transfer(mtk_dp, is_read, request, > - msg->address + > accessed_bytes, > - msg->buffer + > accessed_bytes, 0); > + retry = 32; > + while (retry--) { > + ret = mtk_dp_aux_do_transfer(mtk_dp, is_read, > request, > + msg->address + > accessed_bytes, > + msg->buffer + > accessed_bytes, 0); > + if (ret == 0) > + break; > + usleep_range(500, 600); > + } > } else { > while (accessed_bytes < msg->size) { > size_t to_access = > min_t(size_t, DP_AUX_MAX_PAYLOAD_BYTES, > msg->size - accessed_bytes); > + retry = 32; > while (retry--) { > ret = mtk_dp_aux_do_transfer(mtk_dp, > is_read, > request, > @@ -2066,7 +2073,7 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > to_access) > ; > if (ret == 0) > break; > - usleep_range(50, 100); > + usleep_range(500, 600); > } > if (!retry || ret) { > drm_info(mtk_dp->drm_dev, Reviewed-by: Rex-BC Chen 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 65B9FC433EF for ; Mon, 28 Mar 2022 01:46:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AD76E10EA09; Mon, 28 Mar 2022 01:46:17 +0000 (UTC) Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by gabe.freedesktop.org (Postfix) with ESMTPS id 80D4510E0EB for ; Mon, 28 Mar 2022 01:46:15 +0000 (UTC) X-UUID: cc02df59dc6545e4b2e68572709dce71-20220328 X-UUID: cc02df59dc6545e4b2e68572709dce71-20220328 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1747605447; Mon, 28 Mar 2022 09:46:08 +0800 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Mon, 28 Mar 2022 09:46:06 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 28 Mar 2022 09:46:06 +0800 Received: from mtksdccf07 (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 28 Mar 2022 09:46:06 +0800 Message-ID: Subject: Re: [PATCH v9 21/22] drm/mediatek: change the aux retries times when receiving AUX_DEFER From: Rex-BC Chen To: Guillaume Ranquet , , , , , , , , , , , , , , , , , Date: Mon, 28 Mar 2022 09:46:06 +0800 In-Reply-To: <20220327223927.20848-22-granquet@baylibre.com> References: <20220327223927.20848-1-granquet@baylibre.com> <20220327223927.20848-22-granquet@baylibre.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N 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: devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, markyacoub@google.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, 2022-03-28 at 00:39 +0200, Guillaume Ranquet wrote: > From: Jitao Shi > > DP 1.4a Section 2.8.7.1.5.6.1: > A DP Source device shall retry at least seven times upon receiving > AUX_DEFER before giving up the AUX transaction. > > Aux should retry to send msg whether how many bytes. > > Signed-off-by: Jitao Shi > Signed-off-by: Guillaume Ranquet > --- > drivers/gpu/drm/mediatek/mtk_dp.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c > b/drivers/gpu/drm/mediatek/mtk_dp.c > index e099491cc6a4..7a197c4a7143 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dp.c > +++ b/drivers/gpu/drm/mediatek/mtk_dp.c > @@ -2016,7 +2016,7 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > bool is_read; > u8 request; > size_t accessed_bytes = 0; > - int retry = 3, ret = 0; > + int retry, ret = 0; > > mtk_dp = container_of(mtk_aux, struct mtk_dp, aux); > > @@ -2050,14 +2050,21 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > } > > if (msg->size == 0) { > - ret = mtk_dp_aux_do_transfer(mtk_dp, is_read, request, > - msg->address + > accessed_bytes, > - msg->buffer + > accessed_bytes, 0); > + retry = 32; > + while (retry--) { > + ret = mtk_dp_aux_do_transfer(mtk_dp, is_read, > request, > + msg->address + > accessed_bytes, > + msg->buffer + > accessed_bytes, 0); > + if (ret == 0) > + break; > + usleep_range(500, 600); > + } > } else { > while (accessed_bytes < msg->size) { > size_t to_access = > min_t(size_t, DP_AUX_MAX_PAYLOAD_BYTES, > msg->size - accessed_bytes); > + retry = 32; > while (retry--) { > ret = mtk_dp_aux_do_transfer(mtk_dp, > is_read, > request, > @@ -2066,7 +2073,7 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > to_access) > ; > if (ret == 0) > break; > - usleep_range(50, 100); > + usleep_range(500, 600); > } > if (!retry || ret) { > drm_info(mtk_dp->drm_dev, Reviewed-by: Rex-BC Chen 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6444BC433EF for ; Mon, 28 Mar 2022 01:48:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:CC:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bNL1L2BLDFIWwmfdVNoGFFHAINIwR9J91EcfICMLHC4=; b=WRZ9VnIIG6qdFa +IkLnWJr/jo0tx++GvUkG9zwTNev43y/0ozBQnn0MVmL0P7tXKd9RO5vUhlkJG5us5ZhtPRsspRlM su5TFiJ1/bdedz8VeRcP9+WPy3TqqzNmJJ8fIJLLZ6KiC1WwjUTZ8su1k5L4eZqwa256CwO2CibJT CnEUUIcsxqmZJ4iXIGDL2t6eLUDTAFKW5xjYxCevv+RlOQRycWQ9JA/hen16LdIkluYXss3McWuKo q/zn1OgzKUe87MjK296awGNdvBLasicBdfDNr3c4vQLQamB+nKDuvZhJ4ikxaMkNDQeGCuF6EYM5B h8FGh10bLhRbVLjKNJ3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYeUu-00727j-MQ; Mon, 28 Mar 2022 01:48:44 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYeUq-00725t-9o; Mon, 28 Mar 2022 01:48:41 +0000 X-UUID: ec0f73f2a2334446a39c73259606d3b3-20220327 X-UUID: ec0f73f2a2334446a39c73259606d3b3-20220327 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 554164551; Sun, 27 Mar 2022 18:48:29 -0700 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 27 Mar 2022 18:46:19 -0700 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 28 Mar 2022 09:46:06 +0800 Received: from mtksdccf07 (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 28 Mar 2022 09:46:06 +0800 Message-ID: Subject: Re: [PATCH v9 21/22] drm/mediatek: change the aux retries times when receiving AUX_DEFER From: Rex-BC Chen To: Guillaume Ranquet , , , , , , , , , , , , , , , , , CC: , , , , , , , Date: Mon, 28 Mar 2022 09:46:06 +0800 In-Reply-To: <20220327223927.20848-22-granquet@baylibre.com> References: <20220327223927.20848-1-granquet@baylibre.com> <20220327223927.20848-22-granquet@baylibre.com> X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220327_184840_354196_68A735B9 X-CRM114-Status: GOOD ( 16.59 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Mon, 2022-03-28 at 00:39 +0200, Guillaume Ranquet wrote: > From: Jitao Shi > > DP 1.4a Section 2.8.7.1.5.6.1: > A DP Source device shall retry at least seven times upon receiving > AUX_DEFER before giving up the AUX transaction. > > Aux should retry to send msg whether how many bytes. > > Signed-off-by: Jitao Shi > Signed-off-by: Guillaume Ranquet > --- > drivers/gpu/drm/mediatek/mtk_dp.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c > b/drivers/gpu/drm/mediatek/mtk_dp.c > index e099491cc6a4..7a197c4a7143 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dp.c > +++ b/drivers/gpu/drm/mediatek/mtk_dp.c > @@ -2016,7 +2016,7 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > bool is_read; > u8 request; > size_t accessed_bytes = 0; > - int retry = 3, ret = 0; > + int retry, ret = 0; > > mtk_dp = container_of(mtk_aux, struct mtk_dp, aux); > > @@ -2050,14 +2050,21 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > } > > if (msg->size == 0) { > - ret = mtk_dp_aux_do_transfer(mtk_dp, is_read, request, > - msg->address + > accessed_bytes, > - msg->buffer + > accessed_bytes, 0); > + retry = 32; > + while (retry--) { > + ret = mtk_dp_aux_do_transfer(mtk_dp, is_read, > request, > + msg->address + > accessed_bytes, > + msg->buffer + > accessed_bytes, 0); > + if (ret == 0) > + break; > + usleep_range(500, 600); > + } > } else { > while (accessed_bytes < msg->size) { > size_t to_access = > min_t(size_t, DP_AUX_MAX_PAYLOAD_BYTES, > msg->size - accessed_bytes); > + retry = 32; > while (retry--) { > ret = mtk_dp_aux_do_transfer(mtk_dp, > is_read, > request, > @@ -2066,7 +2073,7 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > to_access) > ; > if (ret == 0) > break; > - usleep_range(50, 100); > + usleep_range(500, 600); > } > if (!retry || ret) { > drm_info(mtk_dp->drm_dev, Reviewed-by: Rex-BC Chen _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1C50C433EF for ; Mon, 28 Mar 2022 01:48:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:CC:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=S+EBInHNbJ5ue5idnjqdY48YlQBywG1G5lb02MaZh0Q=; b=R8Dw8vj0kTCFqK yKd7r2OWMt3kIV5e2Bfd72ScqUd7ezZ9U2oZWU2nXWoZPgndan21yOE0IdpQpHl1Cp6C6EWk2jyYS usPdWoMJqtSOLnW9328KK5vOvAJ2XCd4R0leJtLAfZNzCsrFqnlEC7qX4ae3Gd5wE/Eoz8qQz/7LA v4dZpOFXnyBT7H5mSOcKikB+efNAwprj2d0P4x9mgJIwlR5kwzXPJMqOOswxx6vtyIcg4an99bQEA a2mlzxY/b1aeJd4Y1r+LmFW3dhKHFiucqT7oWt7z/x+JFyg9mp+30NDTPu7hY8ZyTR4mJ211HOIvB w8Dy+Ye5Te6Qb1LZ4Q0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYeUt-00727e-7w; Mon, 28 Mar 2022 01:48:43 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYeUq-00725t-9o; Mon, 28 Mar 2022 01:48:41 +0000 X-UUID: ec0f73f2a2334446a39c73259606d3b3-20220327 X-UUID: ec0f73f2a2334446a39c73259606d3b3-20220327 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 554164551; Sun, 27 Mar 2022 18:48:29 -0700 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 27 Mar 2022 18:46:19 -0700 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 28 Mar 2022 09:46:06 +0800 Received: from mtksdccf07 (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 28 Mar 2022 09:46:06 +0800 Message-ID: Subject: Re: [PATCH v9 21/22] drm/mediatek: change the aux retries times when receiving AUX_DEFER From: Rex-BC Chen To: Guillaume Ranquet , , , , , , , , , , , , , , , , , CC: , , , , , , , Date: Mon, 28 Mar 2022 09:46:06 +0800 In-Reply-To: <20220327223927.20848-22-granquet@baylibre.com> References: <20220327223927.20848-1-granquet@baylibre.com> <20220327223927.20848-22-granquet@baylibre.com> X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220327_184840_354196_68A735B9 X-CRM114-Status: GOOD ( 16.59 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On Mon, 2022-03-28 at 00:39 +0200, Guillaume Ranquet wrote: > From: Jitao Shi > > DP 1.4a Section 2.8.7.1.5.6.1: > A DP Source device shall retry at least seven times upon receiving > AUX_DEFER before giving up the AUX transaction. > > Aux should retry to send msg whether how many bytes. > > Signed-off-by: Jitao Shi > Signed-off-by: Guillaume Ranquet > --- > drivers/gpu/drm/mediatek/mtk_dp.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c > b/drivers/gpu/drm/mediatek/mtk_dp.c > index e099491cc6a4..7a197c4a7143 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dp.c > +++ b/drivers/gpu/drm/mediatek/mtk_dp.c > @@ -2016,7 +2016,7 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > bool is_read; > u8 request; > size_t accessed_bytes = 0; > - int retry = 3, ret = 0; > + int retry, ret = 0; > > mtk_dp = container_of(mtk_aux, struct mtk_dp, aux); > > @@ -2050,14 +2050,21 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > } > > if (msg->size == 0) { > - ret = mtk_dp_aux_do_transfer(mtk_dp, is_read, request, > - msg->address + > accessed_bytes, > - msg->buffer + > accessed_bytes, 0); > + retry = 32; > + while (retry--) { > + ret = mtk_dp_aux_do_transfer(mtk_dp, is_read, > request, > + msg->address + > accessed_bytes, > + msg->buffer + > accessed_bytes, 0); > + if (ret == 0) > + break; > + usleep_range(500, 600); > + } > } else { > while (accessed_bytes < msg->size) { > size_t to_access = > min_t(size_t, DP_AUX_MAX_PAYLOAD_BYTES, > msg->size - accessed_bytes); > + retry = 32; > while (retry--) { > ret = mtk_dp_aux_do_transfer(mtk_dp, > is_read, > request, > @@ -2066,7 +2073,7 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > to_access) > ; > if (ret == 0) > break; > - usleep_range(50, 100); > + usleep_range(500, 600); > } > if (!retry || ret) { > drm_info(mtk_dp->drm_dev, Reviewed-by: Rex-BC Chen -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8977CC433F5 for ; Mon, 28 Mar 2022 01:49:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:CC:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PDmaF+fJ9bHG8H6M/W9nhmI9AFV+KoF3ABhlLKaS1QE=; b=xWW6yUAMC2IaDu sf8qWrkyZBKkFAV8to8Gyj1asVIky8gcjpmRj7hQBNAwR4y+a1KoHeT+coJ44zYfnCZU4Zc+PVWjI EsrMoCs6yAN4vATXt+XKvZaYNi6Q7d5pifgY4zdzFbZSzGDC4u06gppQDkFWYuqg8QceBEl1LLB08 ZJkLQ1g9i6TTsU/vQ7EW5ZAd5MjWjJlUkYrK86PJcS91+61YsJ2Fch6vTg25bGNqGOVsPEWgrWc6y DKHYKqyuMTDo4Nh8yWg24rO4OYADWz/Tv68FeGQT4zcrArZLbrqcb18wZho3ENsvv6s0b8VvISK0Z hcPaVQFQQc5gDpVIjN2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYeUw-00728A-BK; Mon, 28 Mar 2022 01:48:46 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYeUq-00725t-9o; Mon, 28 Mar 2022 01:48:41 +0000 X-UUID: ec0f73f2a2334446a39c73259606d3b3-20220327 X-UUID: ec0f73f2a2334446a39c73259606d3b3-20220327 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 554164551; Sun, 27 Mar 2022 18:48:29 -0700 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 27 Mar 2022 18:46:19 -0700 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 28 Mar 2022 09:46:06 +0800 Received: from mtksdccf07 (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 28 Mar 2022 09:46:06 +0800 Message-ID: Subject: Re: [PATCH v9 21/22] drm/mediatek: change the aux retries times when receiving AUX_DEFER From: Rex-BC Chen To: Guillaume Ranquet , , , , , , , , , , , , , , , , , CC: , , , , , , , Date: Mon, 28 Mar 2022 09:46:06 +0800 In-Reply-To: <20220327223927.20848-22-granquet@baylibre.com> References: <20220327223927.20848-1-granquet@baylibre.com> <20220327223927.20848-22-granquet@baylibre.com> X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220327_184840_354196_68A735B9 X-CRM114-Status: GOOD ( 16.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 2022-03-28 at 00:39 +0200, Guillaume Ranquet wrote: > From: Jitao Shi > > DP 1.4a Section 2.8.7.1.5.6.1: > A DP Source device shall retry at least seven times upon receiving > AUX_DEFER before giving up the AUX transaction. > > Aux should retry to send msg whether how many bytes. > > Signed-off-by: Jitao Shi > Signed-off-by: Guillaume Ranquet > --- > drivers/gpu/drm/mediatek/mtk_dp.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c > b/drivers/gpu/drm/mediatek/mtk_dp.c > index e099491cc6a4..7a197c4a7143 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dp.c > +++ b/drivers/gpu/drm/mediatek/mtk_dp.c > @@ -2016,7 +2016,7 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > bool is_read; > u8 request; > size_t accessed_bytes = 0; > - int retry = 3, ret = 0; > + int retry, ret = 0; > > mtk_dp = container_of(mtk_aux, struct mtk_dp, aux); > > @@ -2050,14 +2050,21 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > } > > if (msg->size == 0) { > - ret = mtk_dp_aux_do_transfer(mtk_dp, is_read, request, > - msg->address + > accessed_bytes, > - msg->buffer + > accessed_bytes, 0); > + retry = 32; > + while (retry--) { > + ret = mtk_dp_aux_do_transfer(mtk_dp, is_read, > request, > + msg->address + > accessed_bytes, > + msg->buffer + > accessed_bytes, 0); > + if (ret == 0) > + break; > + usleep_range(500, 600); > + } > } else { > while (accessed_bytes < msg->size) { > size_t to_access = > min_t(size_t, DP_AUX_MAX_PAYLOAD_BYTES, > msg->size - accessed_bytes); > + retry = 32; > while (retry--) { > ret = mtk_dp_aux_do_transfer(mtk_dp, > is_read, > request, > @@ -2066,7 +2073,7 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > to_access) > ; > if (ret == 0) > break; > - usleep_range(50, 100); > + usleep_range(500, 600); > } > if (!retry || ret) { > drm_info(mtk_dp->drm_dev, Reviewed-by: Rex-BC Chen _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel