]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/radeon: Fix EEH during kexec
authorKyleMahlkuch <kmahlkuc@linux.vnet.ibm.com>
Wed, 31 Jul 2019 22:10:14 +0000 (17:10 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Oct 2019 16:58:37 +0000 (18:58 +0200)
[ Upstream commit 6f7fe9a93e6c09bf988c5059403f5f88e17e21e6 ]

During kexec some adapters hit an EEH since they are not properly
shut down in the radeon_pci_shutdown() function. Adding
radeon_suspend_kms() fixes this issue.

Signed-off-by: KyleMahlkuch <kmahlkuc@linux.vnet.ibm.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/radeon/radeon_drv.c

index 2e96c886392bd1b7b2aeaafa74ef5b2750a36c20..60ee51edd7823f16b286b8df558da998dc41b998 100644 (file)
@@ -344,11 +344,19 @@ radeon_pci_remove(struct pci_dev *pdev)
 static void
 radeon_pci_shutdown(struct pci_dev *pdev)
 {
+       struct drm_device *ddev = pci_get_drvdata(pdev);
+
        /* if we are running in a VM, make sure the device
         * torn down properly on reboot/shutdown
         */
        if (radeon_device_is_virtual())
                radeon_pci_remove(pdev);
+
+       /* Some adapters need to be suspended before a
+       * shutdown occurs in order to prevent an error
+       * during kexec.
+       */
+       radeon_suspend_kms(ddev, true, true, false);
 }
 
 static int radeon_pmops_suspend(struct device *dev)