Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "drm/i915/dp: change aux_ctl reg read to polling read"

This reverts commit 5a9b0c7418448ed3766f61ba0a71d08f259c3181.

The switch from AUX interrupts to pollign was very hand-wavy.
Yes, there have been some situations in CI on a few platforms
where the AUX hardware seemingly forgets to signal the timeout,
but those have been happening after we switched to polling as
well. So I don't think we have any conclusive evidence that
polling actually helps here.

Someone really should root cause the actual problem, and see
if there is a proper workaround we could implemnt (eg. disabling
clock gating/etc.). In the meantime just go back to using the
interrupt for AUX completion.

If the hardware fails to signal the timeout we will just hit
the wait_event_timeout() software timeout instead. I suppose
we could try to tune the software timeout to more closely
match the expected hardware timeout. Might need to use
wait_event_hrtimeout() or something to avoid jiffies
granularity issues...

The AUX polling is also a hinderance towards using poll_timeout_us()
because we have a very long timeout, but would need a fairly short
polling interval to keep AUX transfer reasonably fast. Someone would
need to come up with good numbers in a somewhat scientific way.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251119185310.10428-3-ville.syrjala@linux.intel.com
Acked-by: Jani Nikula <jani.nikula@intel.com>

+7 -5
+7 -5
drivers/gpu/drm/i915/display/intel_dp_aux.c
··· 6 6 #include <drm/drm_print.h> 7 7 8 8 #include "intel_de.h" 9 + #include "intel_display_jiffies.h" 9 10 #include "intel_display_types.h" 10 11 #include "intel_display_utils.h" 11 12 #include "intel_dp.h" ··· 61 60 i915_reg_t ch_ctl = intel_dp->aux_ch_ctl_reg(intel_dp); 62 61 const unsigned int timeout_ms = 10; 63 62 u32 status; 64 - int ret; 63 + bool done; 65 64 66 - ret = intel_de_wait_ms(display, ch_ctl, 67 - DP_AUX_CH_CTL_SEND_BUSY, 0, 68 - timeout_ms, &status); 65 + #define C (((status = intel_de_read_notrace(display, ch_ctl)) & DP_AUX_CH_CTL_SEND_BUSY) == 0) 66 + done = wait_event_timeout(display->gmbus.wait_queue, C, 67 + msecs_to_jiffies_timeout(timeout_ms)); 69 68 70 - if (ret == -ETIMEDOUT) 69 + if (!done) 71 70 drm_err(display->drm, 72 71 "%s: did not complete or timeout within %ums (status 0x%08x)\n", 73 72 intel_dp->aux.name, timeout_ms, status); 73 + #undef C 74 74 75 75 return status; 76 76 }