Skip to content

Commit 9243d70

Browse files
panghu-xinleiChun-Kuang Hu
authored andcommitted
drm/mediatek: dp: Change the aux retries times when receiving AUX_DEFER
DP 1.4a Section 2.8.7.1.5.6.1: A DP Source device shall retry at least seven times upon receiving AUX_DEFER before giving up the AUX transaction. The drm_dp_i2c_do_msg() function in the drm_dp_helper.c file will judge the status of the msg->reply parameter passed to aux_transfer for different processing. Fixes: f70ac09 ("drm/mediatek: Add MT8195 Embedded DisplayPort driver") Signed-off-by: Xinlei Lee <[email protected]> Link: https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent d6dc3cd commit 9243d70

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/gpu/drm/mediatek/mtk_dp.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -806,10 +806,9 @@ static int mtk_dp_aux_wait_for_completion(struct mtk_dp *mtk_dp, bool is_read)
806806
}
807807

808808
static int mtk_dp_aux_do_transfer(struct mtk_dp *mtk_dp, bool is_read, u8 cmd,
809-
u32 addr, u8 *buf, size_t length)
809+
u32 addr, u8 *buf, size_t length, u8 *reply_cmd)
810810
{
811811
int ret;
812-
u32 reply_cmd;
813812

814813
if (is_read && (length > DP_AUX_MAX_PAYLOAD_BYTES ||
815814
(cmd == DP_AUX_NATIVE_READ && !length)))
@@ -841,10 +840,10 @@ static int mtk_dp_aux_do_transfer(struct mtk_dp *mtk_dp, bool is_read, u8 cmd,
841840
/* Wait for feedback from sink device. */
842841
ret = mtk_dp_aux_wait_for_completion(mtk_dp, is_read);
843842

844-
reply_cmd = mtk_dp_read(mtk_dp, MTK_DP_AUX_P0_3624) &
845-
AUX_RX_REPLY_COMMAND_AUX_TX_P0_MASK;
843+
*reply_cmd = mtk_dp_read(mtk_dp, MTK_DP_AUX_P0_3624) &
844+
AUX_RX_REPLY_COMMAND_AUX_TX_P0_MASK;
846845

847-
if (ret || reply_cmd) {
846+
if (ret) {
848847
u32 phy_status = mtk_dp_read(mtk_dp, MTK_DP_AUX_P0_3628) &
849848
AUX_RX_PHY_STATE_AUX_TX_P0_MASK;
850849
if (phy_status != AUX_RX_PHY_STATE_AUX_TX_P0_RX_IDLE) {
@@ -2071,7 +2070,7 @@ static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux,
20712070
ret = mtk_dp_aux_do_transfer(mtk_dp, is_read, request,
20722071
msg->address + accessed_bytes,
20732072
msg->buffer + accessed_bytes,
2074-
to_access);
2073+
to_access, &msg->reply);
20752074

20762075
if (ret) {
20772076
drm_info(mtk_dp->drm_dev,
@@ -2081,7 +2080,6 @@ static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux,
20812080
accessed_bytes += to_access;
20822081
} while (accessed_bytes < msg->size);
20832082

2084-
msg->reply = DP_AUX_NATIVE_REPLY_ACK | DP_AUX_I2C_REPLY_ACK;
20852083
return msg->size;
20862084
err:
20872085
msg->reply = DP_AUX_NATIVE_REPLY_NACK | DP_AUX_I2C_REPLY_NACK;

0 commit comments

Comments
 (0)