diff mbox

gma500: Fix lid related crash

Message ID 20120704161421.4289.22621.stgit@bluebook (mailing list archive)
State New, archived
Headers show

Commit Message

Alan Cox July 4, 2012, 4:15 p.m. UTC
From: Alan Cox <alan@linux.intel.com>

We set up the lid timer before we set up the backlight. On some devices
that causes a crash as we do a backlight change before or during the setup.

As this fixes a crash on boot on some setups it ought to go in ASAP.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Tested-by: Mattia Dongili <malattia@linux.it>
---

 drivers/gpu/drm/gma500/psb_device.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Comments

Patrik Jakobsson July 16, 2012, 12:09 p.m. UTC | #1
On Wed, Jul 4, 2012 at 6:15 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> From: Alan Cox <alan@linux.intel.com>
>
> We set up the lid timer before we set up the backlight. On some devices
> that causes a crash as we do a backlight change before or during the setup.
>
> As this fixes a crash on boot on some setups it ought to go in ASAP.
>
> Signed-off-by: Alan Cox <alan@linux.intel.com>
> Tested-by: Mattia Dongili <malattia@linux.it>
> ---

Dave, just a reminder. This really needs to go into 3.5

Thanks
Patrik
diff mbox

Patch

diff --git a/drivers/gpu/drm/gma500/psb_device.c b/drivers/gpu/drm/gma500/psb_device.c
index eff039b..5971bc8 100644
--- a/drivers/gpu/drm/gma500/psb_device.c
+++ b/drivers/gpu/drm/gma500/psb_device.c
@@ -144,6 +144,10 @@  static int psb_backlight_init(struct drm_device *dev)
 	psb_backlight_device->props.max_brightness = 100;
 	backlight_update_status(psb_backlight_device);
 	dev_priv->backlight_device = psb_backlight_device;
+
+	/* This must occur after the backlight is properly initialised */
+	psb_lid_timer_init(dev_priv);
+
 	return 0;
 }
 
@@ -354,13 +358,6 @@  static int psb_chip_setup(struct drm_device *dev)
 	return 0;
 }
 
-/* Not exactly an erratum more an irritation */
-static void psb_chip_errata(struct drm_device *dev)
-{
-	struct drm_psb_private *dev_priv = dev->dev_private;
-	psb_lid_timer_init(dev_priv);
-}
-
 static void psb_chip_teardown(struct drm_device *dev)
 {
 	struct drm_psb_private *dev_priv = dev->dev_private;
@@ -379,7 +376,6 @@  const struct psb_ops psb_chip_ops = {
 	.sgx_offset = PSB_SGX_OFFSET,
 	.chip_setup = psb_chip_setup,
 	.chip_teardown = psb_chip_teardown,
-	.errata = psb_chip_errata,
 
 	.crtc_helper = &psb_intel_helper_funcs,
 	.crtc_funcs = &psb_intel_crtc_funcs,