Skip to contentSkip to conversation

i915 suspend crash: BUG: unable to handle kernel NULL pointer deferrence

DISCUSSION Justin P. Mattock 2 participants 7 messages Aug 12, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Im getting a freeze with the current Mainline using an inspiron 1200. I have posted images of no_console_suspend=1

http://www.flickr.com/photos/44066293@N08/6034687244/
http://www.flickr.com/photos/44066293@N08/6034131811/

Note: these are images of suspending the machine on two occasions (removing the battery gave me more message on the screen).

I can try for a bisect, but might not be able to do so due to time constraints and things. (if there is any patches to try and test let me know!)

Justin P. Mattock

#1 lore raw
Quoted 3 lines · Justin P. Mattock

I can try for a bisect, but might not be able to do so due to time constraints and things.
(if there is any patches to try and test let me know!)

Can you provide the output of 'lspci -n -v', and can you tell us which version of the kernel this corresponds to?

Signature · 1 line
[email protected]
#2 lore raw
Quoted 9 lines · Keith Packard
Quoted 3 lines · Justin P. Mattock

I can try for a bisect, but might not be able to do so due to time constraints and things.
(if there is any patches to try and test let me know!)

Can you provide the output of 'lspci -n -v', and can you tell us which version of the kernel this corresponds to?

yeah appologize for not posting any info on the machine(bit tired). Anyways here is part of lspci(I can fpast the whole thing if need be), and dmesg of the machine running the latest Mainline.

http://fpaste.org/aSQP/

one thing I am seeing is:

[ 96.384971] [drm:i915_get_vblank_timestamp] *ERROR* Invalid crtc 0
[ 96.408364] [drm:i915_get_vblank_timestamp] *ERROR* Invalid crtc 0
[ 96.425860] [drm:i915_get_vblank_timestamp] *ERROR* Invalid crtc 0
[ 96.443365] [drm:i915_get_vblank_timestamp] *ERROR* Invalid crtc 0
[ 96.474238] [drm:i915_get_vblank_timestamp] *ERROR* Invalid crtc 0
[ 96.491728] [drm:i915_get_vblank_timestamp] *ERROR* Invalid crtc 0
[ 96.521229] [drm:i915_get_vblank_timestamp] *ERROR* Invalid crtc 0

in of which I have not seen in the past.

as for good kernel 2.6.39-rc5 survives suspend.

Justin P. Mattock

#3 lore raw
Quoted 1 line · Justin P. Mattock
[ 96.384971] [drm:i915_get_vblank_timestamp] *ERROR* Invalid crtc 0

You're not using KMS are you...

UMS mode disables a ton of features in the driver; you've hit a couple that weren't getting skipped in all cases.

Here's some patches that make sure two of the disabled features are correctly bypassed. If these work for you, I'll create a couple of patches, one per bug. Afterwards, you should really consider switching to KMS...

(meanwhile, thanks for finding bugs in ancient code!)

drivers/gpu/drm/i915/i915_irq.c +4 -2
index 02f96fd..9cbb0cd 100644
@@ -2058,8 +2058,10 @@ void intel_irq_init(struct drm_device *dev)
 		dev->driver->get_vblank_counter = gm45_get_vblank_counter;
 	}
 
-
-	dev->driver->get_vblank_timestamp = i915_get_vblank_timestamp;
+	if (drm_core_check_feature(dev, DRIVER_MODESET))
+		dev->driver->get_vblank_timestamp = i915_get_vblank_timestamp;
+	else
+		dev->driver->get_vblank_timestamp = NULL;
 	dev->driver->get_scanout_position = i915_get_crtc_scanoutpos;
 
 	if (IS_IVYBRIDGE(dev)) {
drivers/gpu/drm/i915/i915_suspend.c +2 -1
index 87677d6..f107423 100644
@@ -871,7 +871,8 @@ int i915_restore_state(struct drm_device *dev)
 	}
 	mutex_unlock(&dev->struct_mutex);
 
-	intel_init_clock_gating(dev);
+	if (drm_core_check_feature(dev, DRIVER_MODESET))
+		intel_init_clock_gating(dev);
 
 	if (IS_IRONLAKE_M(dev)) {
 		ironlake_enable_drps(dev);
Signature · 1 line
[email protected]
#4 lore raw
Quoted 40 lines · Keith Packard
Quoted 1 line · Justin P. Mattock
[ 96.384971] [drm:i915_get_vblank_timestamp] *ERROR* Invalid crtc 0

You're not using KMS are you...

UMS mode disables a ton of features in the driver; you've hit a couple that weren't getting skipped in all cases.

Here's some patches that make sure two of the disabled features are correctly bypassed. If these work for you, I'll create a couple of patches, one per bug. Afterwards, you should really consider switching to KMS...

(meanwhile, thanks for finding bugs in ancient code!)

drivers/gpu/drm/i915/i915_irq.c +4 -2
index 02f96fd..9cbb0cd 100644
@@ -2058,8 +2058,10 @@ void intel_irq_init(struct drm_device *dev)
  		dev->driver->get_vblank_counter = gm45_get_vblank_counter;
  	}
 
-
-	dev->driver->get_vblank_timestamp = i915_get_vblank_timestamp;
+	if (drm_core_check_feature(dev, DRIVER_MODESET))
+		dev->driver->get_vblank_timestamp = i915_get_vblank_timestamp;
+	else
+		dev->driver->get_vblank_timestamp = NULL;
  	dev->driver->get_scanout_position = i915_get_crtc_scanoutpos;
 
  	if (IS_IVYBRIDGE(dev)) {
drivers/gpu/drm/i915/i915_suspend.c +0 -0
index 87677d6..f107423 100644

drivers/gpu/drm/i915/i915_suspend.c int i915_restore_state(struct drm_device *dev) · line 878

Quoted 9 lines
drivers/gpu/drm/i915/i915_suspend.c +2 -1
@@ -871,7 +871,8 @@ int i915_restore_state(struct drm_device *dev)
  	}
  	mutex_unlock(&dev->struct_mutex);
 
-	intel_init_clock_gating(dev);
+	if (drm_core_check_feature(dev, DRIVER_MODESET))
+		intel_init_clock_gating(dev);
 
  	if (IS_IRONLAKE_M(dev)) {
  		ironlake_enable_drps(dev);

I have: Enable modesetting on intel by default (DRM_I915_KMS) not set in my .config. I will enable that and see if this fixes this issue, if
not then I will test those patches out.

#5 lore raw
Quoted 3 lines · Justin P. Mattock

I have: Enable modesetting on intel by default (DRM_I915_KMS) not set in my .config. I will enable that and see if this fixes this issue, if
not then I will test those patches out.

Could you test the patches without switching to KMS first? Otherwise, the underlying bugs aren't going to get fixed for anyone else...

Signature · 1 line
[email protected]
#6 lore raw
Quoted 9 lines · Keith Packard
Quoted 3 lines · Justin P. Mattock

I have: Enable modesetting on intel by default (DRM_I915_KMS) not set in my .config. I will enable that and see if this fixes this issue, if
not then I will test those patches out.

Could you test the patches without switching to KMS first? Otherwise, the underlying bugs aren't going to get fixed for anyone else...

Thanks a who lot for that.. machine wakes up perfectly with that patch..

dmesg of a patch applied with a good wakeup:

http://fpaste.org/7GA7/

only really thing now I am seeing is:
[drm:i915_report_and_clear_eir] *ERROR* EIR stuck: 0x00000010, masking

[ 146.362007] render error detected, EIR: 0x00000010
[ 146.362007] page table error

but might just be cosmetic.

Justin P. Mattock