This is a note to let you know that I've just added the patch titled

    drm/i915: ensure single initialization and cleanup of backlight device

to the 3.4-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-i915-ensure-single-initialization-and-cleanup-of-backlight-device.patch
and it can be found in the queue-3.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 19c42ce9869ff30f43a08fb774d08f35b92b5ff6 Mon Sep 17 00:00:00 2001
From: Jani Nikula <[email protected]>
Date: Fri, 12 Apr 2013 15:18:38 +0300
Subject: drm/i915: ensure single initialization and cleanup of backlight device

From: Jani Nikula <[email protected]>

commit dc652f90e088798bfa31f496ba994ddadd5d5680 upstream.

Backlight cleanup in the eDP connector destroy callback caused the
backlight device to be removed on some systems that first initialized LVDS
and then attempted to initialize eDP. Prevent multiple backlight
initializations, and ensure backlight cleanup is only done once by moving
it to modeset cleanup.

A small wrinkle is the introduced asymmetry in backlight
setup/cleanup. This could be solved by adding refcounting, but it seems
overkill considering that there should only ever be one backlight device.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=55701
Signed-off-by: Jani Nikula <[email protected]>
Tested-by: Peter Verthez <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
[bwh: Backported to 3.2:
 - Adjust context
 - s/dev_priv->backlight\.device/dev_priv->backlight/]
Signed-off-by: Ben Hutchings <[email protected]>
Cc: Weng Meiling <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/gpu/drm/i915/intel_display.c |    3 +++
 drivers/gpu/drm/i915/intel_dp.c      |    5 -----
 drivers/gpu/drm/i915/intel_lvds.c    |    2 --
 drivers/gpu/drm/i915/intel_panel.c   |    7 ++++++-
 4 files changed, 9 insertions(+), 8 deletions(-)

--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9471,6 +9471,9 @@ void intel_modeset_cleanup(struct drm_de
        del_timer_sync(&dev_priv->idle_timer);
        cancel_work_sync(&dev_priv->idle_work);
 
+       /* destroy backlight, if any, before the connectors */
+       intel_panel_destroy_backlight(dev);
+
        drm_mode_config_cleanup(dev);
 }
 
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2289,11 +2289,6 @@ done:
 static void
 intel_dp_destroy(struct drm_connector *connector)
 {
-       struct drm_device *dev = connector->dev;
-
-       if (intel_dpd_is_edp(dev))
-               intel_panel_destroy_backlight(dev);
-
        drm_sysfs_connector_remove(connector);
        drm_connector_cleanup(connector);
        kfree(connector);
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -553,8 +553,6 @@ static void intel_lvds_destroy(struct dr
        struct drm_device *dev = connector->dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
 
-       intel_panel_destroy_backlight(dev);
-
        if (dev_priv->lid_notifier.notifier_call)
                acpi_lid_notifier_unregister(&dev_priv->lid_notifier);
        drm_sysfs_connector_remove(connector);
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -359,6 +359,9 @@ int intel_panel_setup_backlight(struct d
 
        intel_panel_init_backlight(dev);
 
+       if (WARN_ON(dev_priv->backlight))
+               return -ENODEV;
+
        if (dev_priv->int_lvds_connector)
                connector = dev_priv->int_lvds_connector;
        else if (dev_priv->int_edp_connector)
@@ -386,8 +389,10 @@ int intel_panel_setup_backlight(struct d
 void intel_panel_destroy_backlight(struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
-       if (dev_priv->backlight)
+       if (dev_priv->backlight) {
                backlight_device_unregister(dev_priv->backlight);
+               dev_priv->backlight = NULL;
+       }
 }
 #else
 int intel_panel_setup_backlight(struct drm_device *dev)


Patches currently in stable-queue which might be from [email protected] are

queue-3.4/drm-i915-add-quirk-to-invert-brightness-on-emachines-g725.patch
queue-3.4/drm-i915-add-quirk_invert_brightness-for-ncr-machines.patch
queue-3.4/drm-i915-try-not-to-lose-backlight-cblv-precision.patch
queue-3.4/drm-i915-add-quirk-to-invert-brightness-on-emachines-e725.patch
queue-3.4/drm-i915-add-missing-n-to-uts_release-in-the-error_state.patch
queue-3.4/drm-i915-ensure-single-initialization-and-cleanup-of-backlight-device.patch
queue-3.4/drm-i915-sdvo-clean-up-connectors-on-intel_sdvo_init-failures.patch
queue-3.4/drm-i915-panel-invert-brightness-via-parameter.patch
queue-3.4/drm-i915-panel-invert-brightness-acer-aspire-5734z.patch
queue-3.4/drm-i915-panel-invert-brightness-via-quirk.patch
queue-3.4/drm-i915-add-quirk-to-invert-brightness-on-packard-bell-ncl20.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to