Skip to contentSkip to conversation

drm/bridge: Clear the DP_AUX_I2C_MOT bit passed in aux read command.

PATCH Applied Hsin-Yi Wang 3 participants 4 messages Feb 17, 2022 – Mar 1, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/bridge: Clear the DP_AUX_I2C_MOT bit passed in aux read command.

If the previous transfer didn't end with a command without DP_AUX_I2C_MOT, the next read trasnfer will miss the first byte. But if the command in previous transfer is requested with length 0, it's a no-op to anx7625 since it can't process this command. anx7625 requires the last command to be read command with length > 0.

It's observed that if we clear the DP_AUX_I2C_MOT in read transfer, we can still get correct data. Clear the read commands with DP_AUX_I2C_MOT bit to fix this issue.

Fixes adca62ec370c ("drm/bridge: anx7625: Support reading edid through aux channel")

---
v1->v2: Offline discussed with Xin Ji, it's better to clear the bit on read commands only.

---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/bridge/analogix/anx7625.c +2 -0
index 633618bafd75d3..2805e9bed2c2f4 100644
@@ -253,6 +253,8 @@ static int anx7625_aux_trans(struct anx7625_data *ctx, u8 op, u32 address,
 	addrm = (address >> 8) & 0xFF;
 	addrh = (address >> 16) & 0xFF;
 
+	if (!is_write)
+		op &= ~DP_AUX_I2C_MOT;
 	cmd = DPCD_CMD(len, op);
 
 	/* Set command and length */
Signature · 1 line
2.35.1.265.g69c8d7142f-goog
Reviewed-by on v2 1/1
#1 lore raw
Quoted 9 lines · Hsin-Yi Wang

If the previous transfer didn't end with a command without DP_AUX_I2C_MOT, the next read trasnfer will miss the first byte. But if the command in previous transfer is requested with length 0, it's a no-op to anx7625 since it can't process this command. anx7625 requires the last command to be read command with length > 0.

It's observed that if we clear the DP_AUX_I2C_MOT in read transfer, we can still get correct data. Clear the read commands with DP_AUX_I2C_MOT bit to fix this issue.

Hi Hsin-Yi, thanks for the patch!

Thanks,
Xin

Quoted 25 lines
Fixes adca62ec370c ("drm/bridge: anx7625: Support reading edid through aux channel")

---
v1->v2: Offline discussed with Xin Ji, it's better to clear the bit on read commands only.

---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/bridge/analogix/anx7625.c +2 -0
index 633618bafd75d3..2805e9bed2c2f4 100644
@@ -253,6 +253,8 @@ static int anx7625_aux_trans(struct anx7625_data *ctx, u8 op, u32 address,
 	addrm = (address >> 8) & 0xFF;
 	addrh = (address >> 16) & 0xFF;
 
+	if (!is_write)
+		op &= ~DP_AUX_I2C_MOT;
 	cmd = DPCD_CMD(len, op);
 
 	/* Set command and length */
Signature · 1 line
2.35.1.265.g69c8d7142f-goog
#2 lore raw
Quoted 12 lines · Xin Ji
Quoted 9 lines · Hsin-Yi Wang

If the previous transfer didn't end with a command without DP_AUX_I2C_MOT, the next read trasnfer will miss the first byte. But if the command in previous transfer is requested with length 0, it's a no-op to anx7625 since it can't process this command. anx7625 requires the last command to be read command with length > 0.

It's observed that if we clear the DP_AUX_I2C_MOT in read transfer, we can still get correct data. Clear the read commands with DP_AUX_I2C_MOT bit to fix this issue.

Quoted 6 lines

Hi Hsin-Yi, thanks for the patch!

Thanks,
Xin

Hi Robert,

Kindly ping on this fix. Thanks.

Quoted 25 lines
Quoted 25 lines
Fixes adca62ec370c ("drm/bridge: anx7625: Support reading edid through aux channel")

---
v1->v2: Offline discussed with Xin Ji, it's better to clear the bit on read commands only.

---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/bridge/analogix/anx7625.c +2 -1
index 633618bafd75d3..2805e9bed2c2f4 100644
@@ -253,6 +253,8 @@ static int anx7625_aux_trans(struct anx7625_data *ctx, u8 op, u32 address,
      addrm = (address >> 8) & 0xFF;
      addrh = (address >> 16) & 0xFF;
 
+     if (!is_write)
+             op &= ~DP_AUX_I2C_MOT;
      cmd = DPCD_CMD(len, op);
 
      /* Set command and length */
--

2.35.1.265.g69c8d7142f-goog