[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d5f8ec6f4b35f7db71b0261c9ddbbae9ccce90d4.camel@mediatek.com>
Date: Mon, 28 Mar 2022 09:46:06 +0800
From: Rex-BC Chen <rex-bc.chen@...iatek.com>
To: Guillaume Ranquet <granquet@...libre.com>, <airlied@...ux.ie>,
<angelogioacchino.delregno@...labora.com>,
<chunfeng.yun@...iatek.com>, <chunkuang.hu@...nel.org>,
<ck.hu@...iatek.com>, <daniel@...ll.ch>, <deller@....de>,
<jitao.shi@...iatek.com>, <kishon@...com>, <krzk+dt@...nel.org>,
<maarten.lankhorst@...ux.intel.com>, <matthias.bgg@...il.com>,
<mripard@...nel.org>, <p.zabel@...gutronix.de>,
<robh+dt@...nel.org>, <tzimmermann@...e.de>, <vkoul@...nel.org>
CC: <devicetree@...r.kernel.org>, <dri-devel@...ts.freedesktop.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-fbdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-phy@...ts.infradead.org>, <markyacoub@...gle.com>
Subject: Re: [PATCH v9 21/22] drm/mediatek: change the aux retries times
when receiving AUX_DEFER
On Mon, 2022-03-28 at 00:39 +0200, Guillaume Ranquet wrote:
> From: Jitao Shi <jitao.shi@...iatek.com>
>
> 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 <jitao.shi@...iatek.com>
> Signed-off-by: Guillaume Ranquet <granquet@...libre.com>
> ---
> 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 <rex-bc.chen@...iatek.com>
Powered by blists - more mailing lists