drm/radeon: add a module parameter to disable aspm
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 16 Jul 2013 19:58:50 +0000 (15:58 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 17 Jul 2013 18:52:46 +0000 (14:52 -0400)
Can cause hangs when enabled in certain motherboards.
Set radeon.aspm=0 to disable aspm.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/radeon/rv6xx_dpm.c
drivers/gpu/drm/radeon/rv770_dpm.c
drivers/gpu/drm/radeon/si.c

index 526e428cb4d063fd44ce97e025eb70ffb88e7dad..038dcac7670cf540950d4ce64a26830da6325e0d 100644 (file)
@@ -5515,6 +5515,9 @@ void evergreen_program_aspm(struct radeon_device *rdev)
         */
        bool fusion_platform = false;
 
+       if (radeon_aspm == 0)
+               return;
+
        if (!(rdev->flags & RADEON_IS_PCIE))
                return;
 
index 001081757895dd9df9f693ca2f3878409cef45f0..2f08219c39b617d67ab07f83e7aaff7072bd51b7 100644 (file)
@@ -97,6 +97,7 @@ extern int radeon_msi;
 extern int radeon_lockup_timeout;
 extern int radeon_fastfb;
 extern int radeon_dpm;
+extern int radeon_aspm;
 
 /*
  * Copy from radeon_drv.h so we don't have to include both and have conflicting
index e5419b3501708ead90d8f9a82e984e37adc60e6d..29876b1be8ecae78b15bc8690804307c15885f12 100644 (file)
@@ -167,6 +167,7 @@ int radeon_msi = -1;
 int radeon_lockup_timeout = 10000;
 int radeon_fastfb = 0;
 int radeon_dpm = -1;
+int radeon_aspm = -1;
 
 MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers");
 module_param_named(no_wb, radeon_no_wb, int, 0444);
@@ -225,6 +226,9 @@ module_param_named(fastfb, radeon_fastfb, int, 0444);
 MODULE_PARM_DESC(dpm, "DPM support (1 = enable, 0 = disable, -1 = auto)");
 module_param_named(dpm, radeon_dpm, int, 0444);
 
+MODULE_PARM_DESC(aspm, "ASPM support (1 = enable, 0 = disable, -1 = auto)");
+module_param_named(aspm, radeon_aspm, int, 0444);
+
 static struct pci_device_id pciidlist[] = {
        radeon_PCI_IDS
 };
index 8303de267ee5deb6c08ba03e7dfb36a1e82c84aa..65e33f38734130043dbdc061c57c70d9006b2e6e 100644 (file)
@@ -1763,12 +1763,14 @@ void rv6xx_setup_asic(struct radeon_device *rdev)
 {
        r600_enable_acpi_pm(rdev);
 
-       if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_ASPM_L0s)
-               rv6xx_enable_l0s(rdev);
-       if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_ASPM_L1)
-               rv6xx_enable_l1(rdev);
-       if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1)
-               rv6xx_enable_pll_sleep_in_l1(rdev);
+       if (radeon_aspm != 0) {
+               if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_ASPM_L0s)
+                       rv6xx_enable_l0s(rdev);
+               if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_ASPM_L1)
+                       rv6xx_enable_l1(rdev);
+               if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1)
+                       rv6xx_enable_pll_sleep_in_l1(rdev);
+       }
 }
 
 void rv6xx_dpm_display_configuration_changed(struct radeon_device *rdev)
index d914e04ea39a19e3f2013dafdac2fddd3ec18837..2d347925f77d6d116c95c01cc3045c148ac446b1 100644 (file)
@@ -2099,12 +2099,14 @@ void rv770_dpm_setup_asic(struct radeon_device *rdev)
 
        rv770_enable_acpi_pm(rdev);
 
-       if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_ASPM_L0s)
-               rv770_enable_l0s(rdev);
-       if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_ASPM_L1)
-               rv770_enable_l1(rdev);
-       if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1)
-               rv770_enable_pll_sleep_in_l1(rdev);
+       if (radeon_aspm != 0) {
+               if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_ASPM_L0s)
+                       rv770_enable_l0s(rdev);
+               if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_ASPM_L1)
+                       rv770_enable_l1(rdev);
+               if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1)
+                       rv770_enable_pll_sleep_in_l1(rdev);
+       }
 }
 
 void rv770_dpm_display_configuration_changed(struct radeon_device *rdev)
index d3f05076f3852243c94a54abf0d6c5ec4a879c35..d325280e2f9ffcc94b2260e802f6533c242f6546 100644 (file)
@@ -7053,6 +7053,9 @@ static void si_program_aspm(struct radeon_device *rdev)
        bool disable_l0s = false, disable_l1 = false, disable_plloff_in_l1 = false;
        bool disable_clkreq = false;
 
+       if (radeon_aspm == 0)
+               return;
+
        if (!(rdev->flags & RADEON_IS_PCIE))
                return;