Friday, October 30, 2015

Ubuntu 12.04 random crash and Intel i915 DRM video driver + Sandy Bridge

12/15/2012:
http://ubuntuforums.org/showthread.php?t=2094859

Investigation:

12/28/2011: Intel disable RC6 for Linux 3.2
http://www.phoronix.com/scan.php?page=news_item&px=MTAzNDg

Ubuntu official messages on the issue.
02/18/2012: Official notice of testing new kernel fix for RC6 related hang.
https://lists.ubuntu.com/archives/ubuntu-devel/2012-February/034782.html

04/11/2012: Official announcement of disabling RC6 and updated testing results of testing
https://wiki.ubuntu.com/Kernel/PowerManagementRC6

10/02/2015: Official announcement of reenabling RC6
https://wiki.ubuntu.com/Kernel/PowerManagement/PowerSavingTweaks
NOTE: If you are running 12.04 LTS ("Precise"), this is already enabled by default.

The Intel i915 RC6 feature allows the Graphics Processing Unit (GPU) to enter a lower power state during GPU idle. The i915 RC6 feature applies to Intel Sandybridge and later processors. RC6 was switched between enabled and disabled earlier in the Ubuntu 12.04 Precise LTS development cycle, but eventually all problems were fixed and it is now enabled by default.

Source code (Kernel 3.14):

/drivers/gpu/drm/i915/intel_pm.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
static void intel_print_rc6_info(struct drm_device *dev, u32 mode)
{
        if (IS_GEN6(dev))
                DRM_DEBUG_DRIVER("Sandybridge: deep RC6 disabled\n");

        if (IS_HASWELL(dev))
                DRM_DEBUG_DRIVER("Haswell: only RC6 available\n");

        DRM_INFO("Enabling RC6 states: RC6 %s, RC6p %s, RC6pp %s\n",
                        (mode & GEN6_RC_CTL_RC6_ENABLE) ? "on" : "off",
                        (mode & GEN6_RC_CTL_RC6p_ENABLE) ? "on" : "off",
                        (mode & GEN6_RC_CTL_RC6pp_ENABLE) ? "on" : "off");
}

int intel_enable_rc6(const struct drm_device *dev)
{
        /* No RC6 before Ironlake */
        if (INTEL_INFO(dev)->gen < 5)
                return 0;

        /* Respect the kernel parameter if it is set */
        if (i915_enable_rc6 >= 0)
                return i915_enable_rc6;

        /* Disable RC6 on Ironlake */
        if (INTEL_INFO(dev)->gen == 5)
                return 0;

        if (IS_HASWELL(dev))
                return INTEL_RC6_ENABLE;

        /* snb/ivb have more than one rc6 state. */
        if (INTEL_INFO(dev)->gen == 6)
                return INTEL_RC6_ENABLE;

        return (INTEL_RC6_ENABLE | INTEL_RC6p_ENABLE);
}


Since kernel version 3.6, Intel disabled their i915 driver pushing “deep sleep” on all Sandy Bridge devices.  However, the corresponding source code files are varying in different versions.

The video device on ATOM E6xx is GMA 600, a PowerVR SGX 535 based device.  Consequently, Ubuntu 12.04 running on E6xx is immune to the issue by nature.

No comments:

Post a Comment