drm/bridge: analogix_dp: properly handle zero sized AUX transactions
commit e82290a2e0e8ec5e836ecad1ca025021b3855c2d upstream. Address only transactions without any data are valid and should not be flagged as short transactions. Simply return the message size when no transaction errors occured. CC: stable@vger.kernel.org Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Robert Foss <rfoss@kernel.org> Signed-off-by: Robert Foss <rfoss@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240318203925.2837689-1-l.stach@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
78f1990b6b
commit
6f8765a706
|
@ -1027,7 +1027,6 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp,
|
|||
u32 status_reg;
|
||||
u8 *buffer = msg->buffer;
|
||||
unsigned int i;
|
||||
int num_transferred = 0;
|
||||
int ret;
|
||||
|
||||
/* Buffer size of AUX CH is 16 bytes */
|
||||
|
@ -1079,7 +1078,6 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp,
|
|||
reg = buffer[i];
|
||||
writel(reg, dp->reg_base + ANALOGIX_DP_BUF_DATA_0 +
|
||||
4 * i);
|
||||
num_transferred++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1127,7 +1125,6 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp,
|
|||
reg = readl(dp->reg_base + ANALOGIX_DP_BUF_DATA_0 +
|
||||
4 * i);
|
||||
buffer[i] = (unsigned char)reg;
|
||||
num_transferred++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1144,7 +1141,7 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp,
|
|||
(msg->request & ~DP_AUX_I2C_MOT) == DP_AUX_NATIVE_READ)
|
||||
msg->reply = DP_AUX_NATIVE_REPLY_ACK;
|
||||
|
||||
return num_transferred > 0 ? num_transferred : -EBUSY;
|
||||
return msg->size;
|
||||
|
||||
aux_error:
|
||||
/* if aux err happen, reset aux */
|
||||
|
|
Loading…
Reference in New Issue