drm/i915/dp_mst: Fix disabling MST on a port
authorImre Deak <imre.deak@intel.com>
Fri, 5 Jun 2020 09:48:01 +0000 (12:48 +0300)
committerImre Deak <imre.deak@intel.com>
Thu, 11 Jun 2020 11:02:39 +0000 (14:02 +0300)
commit8d712a7e01c8a94fb95c23722e383fe758ad586b
tree9da2f398344d3271bc87dfc37af64a8756cb5df8
parentf99fb309568dd561ad9c42b94a762247ac80325f
drm/i915/dp_mst: Fix disabling MST on a port

Currently MST on a port can get enabled/disabled from the hotplug work
and get disabled from the short pulse work in a racy way. Fix this by
relying on the MST state checking in the hotplug work and just schedule
a hotplug work from the short pulse handler if some problem happened
during the MST interrupt handling.

This removes the explicit MST disabling in case of an AUX failure, but
if AUX fails, then probably the detection will also fail during the
scheduled hotplug work and it's not guaranteed that we'll see
intermittent errors anyway.

While at it also simplify the error checking of the MST interrupt
handler.

v2:
- Convert intel_dp_check_mst_status() to return bool. (Ville)
- Change the intel_dp->is_mst check to an assert, since after this patch
  the condition can't change after we checked it previously.
- Document the return value from intel_dp_check_mst_status().
v3:
- Remove the intel_dp->is_mst check from intel_dp_check_mst_status().
  There is no point in checking the same condition twice, even though
  there is a chance that the hotplug work running concurrently changes
  it.

Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200605094801.17709-1-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_dp.c