From: Alex Deucher Date: Fri, 15 May 2015 15:52:18 +0000 (-0400) Subject: drm/amdgpu: take the mode_config mutex when handling hpds X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9e14c65c5715b16bcbf5d5c64de2bb8a973a0afa;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git drm/amdgpu: take the mode_config mutex when handling hpds Since we may modify display state. Reviewed-by: Christian König Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c index 2187960baf7c..b4d36f0f2153 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c @@ -59,10 +59,12 @@ static void amdgpu_hotplug_work_func(struct work_struct *work) struct drm_mode_config *mode_config = &dev->mode_config; struct drm_connector *connector; + mutex_lock(&mode_config->mutex); if (mode_config->num_connector) { list_for_each_entry(connector, &mode_config->connector_list, head) amdgpu_connector_hotplug(connector); } + mutex_unlock(&mode_config->mutex); /* Just fire off a uevent and let userspace tell us what to do */ drm_helper_hpd_irq_event(dev); }