From 82deab5babd939b743662742fde05b01f30ba2d2 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deucher@amd.com>
Date: Thu, 20 Aug 2015 16:27:42 -0400
Subject: [PATCH] drm/amdgpu: fix a potential hotplug race at startup
We apparantly get a hotplug irq before we've initialised
modesetting.
This is a port of:
drm/radeon: fix hotplug race at startup
to amdgpu.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 5 +++++
1 file changed, 5 insertions(+)
@@ -59,6 +59,11 @@ static void amdgpu_hotplug_work_func(struct work_struct *work)
struct drm_mode_config *mode_config = &dev->mode_config;
struct drm_connector *connector;
+ /* we can race here at startup, some boards seem to trigger
+ * hotplug irqs when they shouldn't. */
+ if (!adev->mode_info.mode_config_initialized)
+ return;
+
mutex_lock(&mode_config->mutex);
if (mode_config->num_connector) {
list_for_each_entry(connector, &mode_config->connector_list, head)
--
1.8.3.1