UPSTREAM: drm/i915: Fix modesetting in case of unexpected AUX timeouts

In case AUX failures happen unexpectedly during a modeset, the driver
should still complete the modeset. In particular the driver should
perform the link training sequence steps even in case of an AUX failure,
as this sequence also includes port initialization steps. Not doing that
can leave the port/pipe in a broken state and lead for instance to a
flip done timeout.

Fix this by continuing with link training (in a no-LTTPR mode) if the
DPRX DPCD readout failed for some reason at the beginning of link
training. After a successful connector detection we already have the
DPCD read out and cached, so the failed repeated read for it should not
cause a problem. Note that a partial AUX read could in theory partly
overwrite the cached DPCD (and return error) but this overwrite should
not happen if the returned values are corrupted (due to a timeout or
some other IO error).

Kudos to Ville to root cause the problem.

Fixes: 7dffbdedb96a ("drm/i915: Disable LTTPR support when the DPCD rev < 1.4")
References: https://gitlab.freedesktop.org/drm/intel/-/issues/3308
Cc: stable@vger.kernel.org # 5.11
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210412232413.2755054-1-imre.deak@intel.com
(cherry picked from commit e42e7e585984b85b0fb9dd1fefc85ee4800ca629)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
[adjusted Fixes: tag]
(cherry picked from commit d2b9935d65dab6e92beb33c150c1a6ded14ab670)

BUG=b:179469139
TEST=Functional display using LTTPR capable re-drivers and re-timers

Signed-off-by: Linux Patches Robot <linux-patches-robot@chromeos-missing-patches.google.com.iam.gserviceaccount.com>
Change-Id: Ie303d3c205139888940e1f979d46b58ce071ecc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2846579
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Guenter Roeck <groeck@chromium.org>
Tested-by: Guenter Roeck <groeck@chromium.org>
(cherry picked from commit fa665d58947a47ea1b8d771c8fc7dfafb7a941ab)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2896806
Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
Tested-by: Kevin Chang <kevin.chang@lcfc.corp-partner.google.com>
Commit-Queue: Zhuohao Lee <zhuohao@chromium.org>
1 file changed