提交 a5b3da54 编写于 作者: K Keith Packard

drm/i915: Clarify error returns from display port aux channel I/O

Use distinct error return values for each kind of aux channel I/O failure.
Signed-off-by: NKeith Packard <keithp@keithp.com>
上级 b11248df
...@@ -209,15 +209,19 @@ intel_dp_aux_ch(struct intel_output *intel_output, ...@@ -209,15 +209,19 @@ intel_dp_aux_ch(struct intel_output *intel_output,
if ((status & DP_AUX_CH_CTL_DONE) == 0) { if ((status & DP_AUX_CH_CTL_DONE) == 0) {
printk(KERN_ERR "dp_aux_ch not done status 0x%08x\n", status); printk(KERN_ERR "dp_aux_ch not done status 0x%08x\n", status);
return -1; return -EBUSY;
} }
/* Check for timeout or receive error. /* Check for timeout or receive error.
* Timeouts occur when the sink is not connected * Timeouts occur when the sink is not connected
*/ */
if (status & (DP_AUX_CH_CTL_TIME_OUT_ERROR | DP_AUX_CH_CTL_RECEIVE_ERROR)) { if (status & DP_AUX_CH_CTL_RECEIVE_ERROR) {
printk(KERN_ERR "dp_aux_ch error status 0x%08x\n", status); printk(KERN_ERR "dp_aux_ch receive error status 0x%08x\n", status);
return -1; return -EIO;
}
if (status & DP_AUX_CH_CTL_TIME_OUT_ERROR) {
printk(KERN_ERR "dp_aux_ch timeout status 0x%08x\n", status);
return -ETIMEDOUT;
} }
/* Unload any bytes sent back from the other side */ /* Unload any bytes sent back from the other side */
...@@ -263,7 +267,7 @@ intel_dp_aux_native_write(struct intel_output *intel_output, ...@@ -263,7 +267,7 @@ intel_dp_aux_native_write(struct intel_output *intel_output,
else if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_DEFER) else if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_DEFER)
udelay(100); udelay(100);
else else
return -1; return -EIO;
} }
return send_bytes; return send_bytes;
} }
...@@ -299,7 +303,9 @@ intel_dp_aux_native_read(struct intel_output *intel_output, ...@@ -299,7 +303,9 @@ intel_dp_aux_native_read(struct intel_output *intel_output,
for (;;) { for (;;) {
ret = intel_dp_aux_ch(intel_output, msg, msg_bytes, ret = intel_dp_aux_ch(intel_output, msg, msg_bytes,
reply, reply_bytes); reply, reply_bytes);
if (ret <= 0) if (ret == 0)
return -EPROTO;
if (ret < 0)
return ret; return ret;
ack = reply[0]; ack = reply[0];
if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_ACK) { if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_ACK) {
...@@ -309,7 +315,7 @@ intel_dp_aux_native_read(struct intel_output *intel_output, ...@@ -309,7 +315,7 @@ intel_dp_aux_native_read(struct intel_output *intel_output,
else if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_DEFER) else if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_DEFER)
udelay(100); udelay(100);
else else
return -1; return -EIO;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册