drm/mediatek: dsi: return tx_len for write transfers in mtk_dsi_host_transfer()
Subsystems (3)
PATCH 1/1 drm/mediatek: dsi: return tx_len for write transfers in mtk_dsi_host_transfer()
Per struct mipi_dsi_host_ops .transfer() documentation in include/drm/drm_mipi_dsi.h, on success .transfer() must return the number of bytes transmitted for write packets or the number of bytes received for read packets.
mtk_dsi_host_transfer() currently sets recv_cnt = 0 for non-read messages, returning 0 instead of msg->tx_len. Callers checking for short writes against msg->tx_len observe a spurious 0-byte transfer.
Return msg->tx_len on successful write transfers.
Found and drafted with an AI coding assistant.
--- drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_dsi.c +1 -1
@@ -1156,7 +1156,7 @@ static ssize_t mtk_dsi_host_transfer(struct mipi_dsi_host *host, goto restore_dsi_mode;if (!MTK_DSI_HOST_IS_READ (msg->type)) { - recv_cnt =0 ; + recv_cnt = msg->tx_len; goto restore_dsi_mode; }
Signature · 1 line
2.54.0 (Apple Git-157)
Quoted 7 lines · On Thu, 2026-11-26 at 00:33 +0000, Ilia Snezhkov via B4 Relay wrote:
From: Ilia Snezhkov <[email protected]>
Per struct
mipi_dsi_host_ops.transfer() documentation ininclude/drm/drm_mipi_dsi.h, on success .transfer() must return the number of bytes transmitted for write packets or the number of bytes received for read packets.
Quoted 7 lines
mtk_dsi_host_transfer()currently setsrecv_cnt= 0 for non-read messages, returning 0 instead ofmsg->tx_len. Callers checking for short writes againstmsg->tx_lenobserve a spurious 0-byte transfer.Return
msg->tx_lenon successful write transfers.Found and drafted with an AI coding assistant.
Quoted 20 lines
Fixes 21898816831f ("drm/mediatek: add dsi transfer function")Signed-off-by Ilia Snezhkov <[email protected]>--- drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/mediatek/mtk_dsi.c +1
-1@@ -1156,7 +1156,7 @@ static ssize_t mtk_dsi_host_transfer(struct mipi_dsi_host *host, goto restore_dsi_mode;if (!MTK_DSI_HOST_IS_READ (msg->type)) { - recv_cnt =0 ; + recv_cnt = msg->tx_len; goto restore_dsi_mode; }
Ilia Snezhkov via B4 Relay <[email protected]> 於 2026年11月26日週四 上午12:33寫道:
Quoted 8 lines
From: Ilia Snezhkov <[email protected]>
Per struct
mipi_dsi_host_ops.transfer() documentation ininclude/drm/drm_mipi_dsi.h, on success .transfer() must return the number of bytes transmitted for write packets or the number of bytes received for read packets.
Quoted 7 lines
mtk_dsi_host_transfer()currently setsrecv_cnt= 0 for non-read messages, returning 0 instead ofmsg->tx_len. Callers checking for short writes againstmsg->tx_lenobserve a spurious 0-byte transfer.Return
msg->tx_lenon successful write transfers.Found and drafted with an AI coding assistant.
Applied to mediatek-drm-fixes [1], thanks.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-fixes
Regards,
Chun-Kuang.
Quoted 4 lines
Fixes 21898816831f ("drm/mediatek: add dsi transfer function")Signed-off-by Ilia Snezhkov <[email protected]>---