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

drm/i915/hdmi: use generic poll_timeout_us() instead of __wait_for()

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
__wait_for(), which used to be 1, 2, 4, and 8 ms in this particular
case.

Use an arbitrary constant 4 ms sleep instead. The timeout remains,
varying between 20 ms and 3000 ms.

Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/fc3a67f9de0049f415a276bba1c11a4df97e01d6.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+5 -5
+5 -5
drivers/gpu/drm/i915/display/intel_hdmi.c
··· 29 29 #include <linux/delay.h> 30 30 #include <linux/hdmi.h> 31 31 #include <linux/i2c.h> 32 + #include <linux/iopoll.h> 32 33 #include <linux/slab.h> 33 34 #include <linux/string_helpers.h> 34 35 ··· 1691 1690 if (timeout < 0) 1692 1691 return timeout; 1693 1692 1694 - ret = __wait_for(ret = hdcp2_detect_msg_availability(dig_port, 1695 - msg_id, &msg_ready, 1696 - &msg_sz), 1697 - !ret && msg_ready && msg_sz, timeout * 1000, 1698 - 1000, 5 * 1000); 1693 + ret = poll_timeout_us(ret = hdcp2_detect_msg_availability(dig_port, msg_id, 1694 + &msg_ready, &msg_sz), 1695 + !ret && msg_ready && msg_sz, 1696 + 4000, timeout * 1000, false); 1699 1697 if (ret) 1700 1698 drm_dbg_kms(display->drm, 1701 1699 "msg_id: %d, ret: %d, timeout: %d\n",