Re:[PATCH v11 07/21] drm/bridge: synopsys: dw-dp: Fix support for short I2C reads

"Andy Yan" <[email protected]>
Newsgroups org.infradead.lists.linux-arm-kernel,org.freedesktop.lists.dri-devel,org.infradead.lists.linux-rockchip,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Hello Sebastian,

At 2026-08-07 01:02:13, "Sebastian Reichel" <[email protected]> wrote:
>The transfer functions returns the amount of bytes read for
>DP_AUX_I2C_READ. By returning -EBUSY for short reads, the caller has
>less information available what is going wrong and possibly simply
>resends the read request. On sinks not supporting long reads, this will
>simply run into the same issue again.
>
>Instead it makes more sense to return the data from the short read with
>the length information, which allows drm_dp_i2c_do_msg() to read data in
>smaller chunks and succeed in the end.
>
>Due to lack of a sink, which only supports short reads, this change is
>effectively untested.
>
>Fixes: 86eecc3a9c2e ("drm/bridge: synopsys: Add DW DPTX Controller support library")
>Reported-by: Sashiko <[email protected]>
>Signed-off-by: Sebastian Reichel <[email protected]>

   Reviewed-by: Andy Yan <[email protected]>

>---
> drivers/gpu/drm/bridge/synopsys/dw-dp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
>index 2573ea2bb574..8ceb139f1a72 100644
>--- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c
>+++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
>@@ -1513,7 +1513,7 @@ static ssize_t dw_dp_aux_transfer(struct drm_dp_aux *aux,
> 		if (msg->request & DP_AUX_I2C_READ) {
> 			size_t count = FIELD_GET(AUX_BYTES_READ, value) - 1;
> 
>-			if (count != msg->size)
>+			if (!count || count > msg->size)
> 				return -EBUSY;
> 
> 			ret = dw_dp_aux_read_data(dp, msg->buffer, count);
>
>-- 
>2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.