From: Ilia Snezhkov via B4 Relay <devnull+iasnezhkov.gmail.com@kernel.org>
To: chunkuang.hu@kernel.org, p.zabel@pengutronix.de
Cc: airlied@gmail.com, simona@ffwll.ch, matthias.bgg@gmail.com,
angelogioacchino.delregno@collabora.com,
dri-devel@lists.freedesktop.org,
linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] drm/mediatek: dsi: return tx_len for write transfers in mtk_dsi_host_transfer()
Date: Thu, 26 Nov 2026 00:33:11 +0000 [thread overview]
Message-ID: <20261126003311.49008-1-iasnezhkov@gmail.com> (raw)
From: Ilia Snezhkov <iasnezhkov@gmail.com>
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.
Fixes: 21898816831f ("drm/mediatek: add dsi transfer function")
Signed-off-by: Ilia Snezhkov <iasnezhkov@gmail.com>
---
drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index f82506e..e2179b4 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -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;
}
--
2.54.0 (Apple Git-157)
reply other threads:[~2026-11-26 0:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261126003311.49008-1-iasnezhkov@gmail.com \
--to=devnull+iasnezhkov.gmail.com@kernel.org \
--cc=airlied@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chunkuang.hu@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=iasnezhkov@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=simona@ffwll.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox