Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/dp: add module parameter for the dpcd access max retries
@ 2018-05-07 10:36 Feng Tang
  2018-05-07 10:40 ` Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Feng Tang @ 2018-05-07 10:36 UTC (permalink / raw)
  To: dri-devel, Gustavo Padovan, Maarten Lankhorst, Sean Paul,
	David Airlie, Jani Nikula, intel-gfx
  Cc: Feng Tang

To fulfil the Dell 4K monitor, the dpcd max retries has been bumped
from 7 to 32, which may hurt the boot/init time for some platforms,
as the 32 retries may take hundreds of ms.

This patch makes no functional change, but make the max retries
adjustable, so that concerned users/platforms can have an option
to short the wait time.

On a Intel Atom Processor A3960 based NUC, the i915_init() time could
be reduced from 450ms to 200ms.

retries = 3:
	[    0.457806] calling  i915_init+0x0/0x51 @ 1
	[    0.662307] initcall i915_init+0x0/0x51 returned 0 after 199694 usecs

retries = 32:
	[    0.465818] calling  i915_init+0x0/0x51 @ 1
	[    0.925831] initcall i915_init+0x0/0x51 returned 0 after 449219 usecs

Signed-off-by: Feng Tang <feng.tang@intel.com>
---
 drivers/gpu/drm/drm_dp_helper.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index ffe14ec..6054067 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -171,6 +171,20 @@ EXPORT_SYMBOL(drm_dp_bw_code_to_link_rate);
 
 #define AUX_RETRY_INTERVAL 500 /* us */
 
+/*
+ * The specification doesn't give any recommendation on how often to
+ * retry native transactions. We used to retry 7 times like for
+ * aux i2c transactions but real world devices this wasn't
+ * sufficient, bump to 32 which makes Dell 4k monitors happier.
+ *
+ * Since the retry may take quite some boot time, we make it a
+ * adjustable parameter for possible shorter retry time.
+ */
+static int dp_dpcd_max_retries __read_mostly = 32;
+module_param_unsafe(dp_dpcd_max_retries, int, 0644);
+MODULE_PARM_DESC(dp_dpcd_max_retries,
+		 "Max retry number for DPCD access (default 32)");
+
 /**
  * DOC: dp helpers
  *
@@ -198,13 +212,7 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request,
 
 	mutex_lock(&aux->hw_mutex);
 
-	/*
-	 * The specification doesn't give any recommendation on how often to
-	 * retry native transactions. We used to retry 7 times like for
-	 * aux i2c transactions but real world devices this wasn't
-	 * sufficient, bump to 32 which makes Dell 4k monitors happier.
-	 */
-	for (retry = 0; retry < 32; retry++) {
+	for (retry = 0; retry < dp_dpcd_max_retries; retry++) {
 		if (ret != 0 && ret != -ETIMEDOUT) {
 			usleep_range(AUX_RETRY_INTERVAL,
 				     AUX_RETRY_INTERVAL + 100);
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-05-10  9:33 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-07 10:36 [PATCH] drm/dp: add module parameter for the dpcd access max retries Feng Tang
2018-05-07 10:40 ` Chris Wilson
2018-05-07 21:26   ` Feng Tang
2018-05-07 13:33     ` Chris Wilson
2018-05-07 15:09       ` Daniel Vetter
2018-05-07 23:19         ` Feng Tang
2018-05-08 19:03         ` Feng Tang
2018-05-08 11:33           ` [Intel-gfx] " Chris Wilson
2018-05-08 12:00             ` Daniel Vetter
2018-05-08 23:08               ` [Intel-gfx] " Feng Tang
2018-05-08 19:30                 ` Jani Nikula
2018-05-09  6:31                   ` Feng Tang
2018-05-09  7:53                     ` Jani Nikula
2018-05-09  7:56                       ` Feng Tang
2018-05-09  9:28                         ` [Intel-gfx] " Jani Nikula
2018-05-10  9:21                           ` Feng Tang
2018-05-07 11:08 ` ✗ Fi.CI.BAT: failure for " Patchwork
2018-05-10  9:33 ` ✗ Fi.CI.BAT: failure for drm/dp: add module parameter for the dpcd access max retries (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox