diff options
author | Dave Airlie <airlied@redhat.com> | 2014-08-04 20:40:20 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-08-05 20:11:53 -0400 |
commit | 5b215bcff50d549d73e43c09bcccf8eebcc95bac (patch) | |
tree | 7f81ae58779e5d402ed6539dbc5eb4d25dba2af9 | |
parent | f7257a224ebbc897b21d0020cb2fedc43536068f (diff) |
drm/i915: lock around link status and link training.
We need to take the connection mutex around the link status
check for non-MST case, but also around the MST link training
on short HPDs.
I suspect we actually should have a dpcd lock in the future as
well, that just lock the local copies of dpcd and flags stored
from that.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index ea6ff71b2910..eb52ecfe14cf 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -3535,11 +3535,13 @@ go_again: | |||
3535 | void | 3535 | void |
3536 | intel_dp_check_link_status(struct intel_dp *intel_dp) | 3536 | intel_dp_check_link_status(struct intel_dp *intel_dp) |
3537 | { | 3537 | { |
3538 | struct drm_device *dev = intel_dp_to_dev(intel_dp); | ||
3538 | struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base; | 3539 | struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base; |
3539 | u8 sink_irq_vector; | 3540 | u8 sink_irq_vector; |
3540 | u8 link_status[DP_LINK_STATUS_SIZE]; | 3541 | u8 link_status[DP_LINK_STATUS_SIZE]; |
3541 | 3542 | ||
3542 | /* FIXME: This access isn't protected by any locks. */ | 3543 | WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex)); |
3544 | |||
3543 | if (!intel_encoder->connectors_active) | 3545 | if (!intel_encoder->connectors_active) |
3544 | return; | 3546 | return; |
3545 | 3547 | ||
@@ -4058,7 +4060,9 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd) | |||
4058 | * we'll check the link status via the normal hot plug path later - | 4060 | * we'll check the link status via the normal hot plug path later - |
4059 | * but for short hpds we should check it now | 4061 | * but for short hpds we should check it now |
4060 | */ | 4062 | */ |
4063 | drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); | ||
4061 | intel_dp_check_link_status(intel_dp); | 4064 | intel_dp_check_link_status(intel_dp); |
4065 | drm_modeset_unlock(&dev->mode_config.connection_mutex); | ||
4062 | } | 4066 | } |
4063 | } | 4067 | } |
4064 | return false; | 4068 | return false; |