From d421be7b38a5ce78f5dde7c2c73904f9a2c775a6 Mon Sep 17 00:00:00 2001 From: Ben Widawsky Date: Wed, 28 May 2014 19:27:30 -0700 Subject: [PATCH] drm/i915: Synchronize failed eDP cleanup There is a race in the code where if we fail eDP init, and the workqueue runs before the cancel_sync, we double decrement the power well. This causes a WARN. Alternatively, we could check the return value of the cancel work, but this patch is cleaner and more readable. This looks to be caused by the original merge of the pm support. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79104 Cc: Paulo Zanoni Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/intel_dp.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 7d31769..16900ea 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4344,12 +4344,8 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port, if (!intel_edp_init_connector(intel_dp, intel_connector, &power_seq)) { drm_dp_aux_unregister_i2c_bus(&intel_dp->aux); - if (is_edp(intel_dp)) { - cancel_delayed_work_sync(&intel_dp->panel_vdd_work); - mutex_lock(&dev->mode_config.mutex); - edp_panel_vdd_off_sync(intel_dp); - mutex_unlock(&dev->mode_config.mutex); - } + if (is_edp(intel_dp)) + flush_delayed_work(&intel_dp->panel_vdd_work); drm_sysfs_connector_remove(connector); drm_connector_cleanup(connector); return false; -- 1.9.3