[PATCH] drm/i915/dp: Use poll read for detecting AUX pending transaction
Arun R Murthy
arun.r.murthy at intel.com
Fri Jan 20 10:09:12 UTC 2023
While performing a new AUX transfer, check was done to sense any previous
pending transaction in progress with a delayed read in a loop. Replace
this with a polling read function(hybrid scheme with fast register waits).
Signed-off-by: Arun R Murthy <arun.r.murthy at intel.com>
---
drivers/gpu/drm/i915/display/intel_dp_aux.c | 32 +++++++--------------
1 file changed, 10 insertions(+), 22 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.c b/drivers/gpu/drm/i915/display/intel_dp_aux.c
index 5a176bfb10a2..226c730c3219 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux.c
@@ -35,11 +35,10 @@ static void intel_dp_aux_unpack(u32 src, u8 *dst, int dst_bytes)
}
static u32
-intel_dp_aux_wait_done(struct intel_dp *intel_dp)
+intel_dp_aux_wait_done(struct intel_dp *intel_dp, const unsigned int timeout_ms)
{
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
i915_reg_t ch_ctl = intel_dp->aux_ch_ctl_reg(intel_dp);
- const unsigned int timeout_ms = 10;
u32 status;
int ret;
@@ -199,6 +198,8 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
int try, clock = 0;
u32 status;
bool vdd;
+ const unsigned int write_ack_timeout_ms = 10;
+ const unsigned int transaction_timeout_ms = 3;
ch_ctl = intel_dp->aux_ch_ctl_reg(intel_dp);
for (i = 0; i < ARRAY_SIZE(ch_data); i++)
@@ -230,25 +231,11 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
intel_pps_check_power_unlocked(intel_dp);
/* Try to wait for any previous AUX channel activity */
- for (try = 0; try < 3; try++) {
- status = intel_de_read_notrace(i915, ch_ctl);
- if ((status & DP_AUX_CH_CTL_SEND_BUSY) == 0)
- break;
- msleep(1);
- }
- /* just trace the final value */
- trace_i915_reg_rw(false, ch_ctl, status, sizeof(status), true);
-
- if (try == 3) {
- const u32 status = intel_de_read(i915, ch_ctl);
-
- if (status != intel_dp->aux_busy_last_status) {
- drm_WARN(&i915->drm, 1,
- "%s: not started (status 0x%08x)\n",
- intel_dp->aux.name, status);
- intel_dp->aux_busy_last_status = status;
- }
-
+ status = intel_dp_aux_wait_done(intel_dp, transaction_timeout_ms);
+ if ((status & DP_AUX_CH_CTL_SEND_BUSY) != 0) {
+ drm_WARN(&i915->drm, 1,
+ "%s: not started (status 0x%08x)\n",
+ intel_dp->aux.name, status);
ret = -EBUSY;
goto out;
}
@@ -277,7 +264,8 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
/* Send the command and wait for it to complete */
intel_de_write(i915, ch_ctl, send_ctl);
- status = intel_dp_aux_wait_done(intel_dp);
+ status = intel_dp_aux_wait_done(intel_dp,
+ write_ack_timeout_ms);
/* Clear done status and any errors */
intel_de_write(i915, ch_ctl,
--
2.25.1
More information about the Intel-gfx-trybot
mailing list