Re: [PATCH] drm/mediatek: dp: Wait for the complete AUX reply before reading it
From: Fei Shao
Date: Thu Nov 12 2026 - 03:59:04 EST
On Thu, Nov 12, 2026 at 2:17 PM Yidi Lin <yidilin@xxxxxxxxxx> wrote:
>
> mtk_dp_aux_wait_for_completion() returns for a read as soon as the RX
> FIFO write pointer is non-zero, i.e. when the first byte of the reply
> has arrived. The rest of the reply is still on the AUX line, so
> mtk_dp_aux_read_rx_fifo() sleeps 500-1000 us before reading each byte
> of an I2C-over-AUX reply and 100-200 us before each byte of a native
> reply. The FIFO is drained this way even for DEFER replies, which carry
> no data.
>
> A 16-byte EDID read therefore takes about 16 ms, although the reply is
> complete within about 300 us of the request.
>
> Wait for the AUX receive-complete (or 400 us timeout) interrupt status
> instead, which the write path already relies on, and drain the RX FIFO
> without delays. Poll every 20 us instead of every 100-500 us.
>
> Reading the 256-byte EDID through the DP AUX DDC adapter drops from 266
> to 6.5 ms on an MT8189 Chromebook, and from 547 to 23 ms on an MT8196
> Chromebook whose panel defers every 16-byte read once. A 16-byte DPCD
> read drops from about 4.7 to 0.5 ms.
>
> Signed-off-by: Yidi Lin <yidilin@xxxxxxxxxx>
Reviewed-by: Fei Shao <fshao@xxxxxxxxxxxx>
> ---
> drivers/gpu/drm/mediatek/mtk_dp.c | 64 ++++++++++++-------------------
> 1 file changed, 25 insertions(+), 39 deletions(-)
>