mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: Fix EEH during kexec
@ 2019-07-16 18:10 KyleMahlkuch
  2019-07-16 18:17 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: KyleMahlkuch @ 2019-07-16 18:10 UTC (permalink / raw)
  Cc: alexander.deucher, christian.koenig, David1.Zhou, amd-gfx,
	linux-kernel, KyleMahlkuch

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.

Since radeon.h is now included in radeon_drv.c radeon_init() needs
a new name. I chose radeon_initl(). This can be changed if there is
another suggestion for a name.

Signed-off-by: Kyle Mahlkuch <Kyle.Mahlkuch at ibm.com>
---
 drivers/gpu/drm/radeon/radeon_drv.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 2e96c88..550f9b0 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -32,6 +32,7 @@
 #include <drm/drmP.h>
 #include <drm/radeon_drm.h>
 #include "radeon_drv.h"
+#include "radeon.h"
 
 #include <drm/drm_pciids.h>
 #include <linux/console.h>
@@ -344,11 +345,21 @@ static int radeon_pci_probe(struct pci_dev *pdev,
 static void
 radeon_pci_shutdown(struct pci_dev *pdev)
 {
+	struct drm_device *ddev = pci_get_drvdata(pdev);
+	struct radeon_device *rdev = ddev->dev_private;
+
 	/* 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.
+	*/
+	if (rdev->family == CHIP_CAICOS)
+		radeon_suspend_kms(ddev, true, true, false);
 }
 
 static int radeon_pmops_suspend(struct device *dev)
@@ -589,7 +600,7 @@ static long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigne
 	.driver.pm = &radeon_pm_ops,
 };
 
-static int __init radeon_init(void)
+static int __init radeon_initl(void)
 {
 	if (vgacon_text_force() && radeon_modeset == -1) {
 		DRM_INFO("VGACON disable radeon kernel modesetting.\n");
@@ -621,7 +632,7 @@ static void __exit radeon_exit(void)
 	radeon_unregister_atpx_handler();
 }
 
-module_init(radeon_init);
+module_init(radeon_initl);
 module_exit(radeon_exit);
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/radeon: Fix EEH during kexec
  2019-07-16 18:10 [PATCH] drm/radeon: Fix EEH during kexec KyleMahlkuch
@ 2019-07-16 18:17 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2019-07-16 18:17 UTC (permalink / raw)
  To: KyleMahlkuch
  Cc: Chunming Zhou, LKML, amd-gfx list, Deucher, Alexander, Christian Koenig

On Tue, Jul 16, 2019 at 2:15 PM KyleMahlkuch
<kmahlkuc@linux.vnet.ibm.com> wrote:
>
> 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.
>
> Since radeon.h is now included in radeon_drv.c radeon_init() needs
> a new name. I chose radeon_initl(). This can be changed if there is
> another suggestion for a name.
>
> Signed-off-by: Kyle Mahlkuch <Kyle.Mahlkuch at ibm.com>
> ---
>  drivers/gpu/drm/radeon/radeon_drv.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
> index 2e96c88..550f9b0 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -32,6 +32,7 @@
>  #include <drm/drmP.h>
>  #include <drm/radeon_drm.h>
>  #include "radeon_drv.h"
> +#include "radeon.h"
>
>  #include <drm/drm_pciids.h>
>  #include <linux/console.h>
> @@ -344,11 +345,21 @@ static int radeon_pci_probe(struct pci_dev *pdev,
>  static void
>  radeon_pci_shutdown(struct pci_dev *pdev)
>  {
> +       struct drm_device *ddev = pci_get_drvdata(pdev);
> +       struct radeon_device *rdev = ddev->dev_private;
> +
>         /* 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.
> +       */
> +       if (rdev->family == CHIP_CAICOS)

You really should be suspending for all asics, not just CAICOS,
otherwise, you may have engines in use.

Alex

> +               radeon_suspend_kms(ddev, true, true, false);
>  }
>
>  static int radeon_pmops_suspend(struct device *dev)
> @@ -589,7 +600,7 @@ static long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigne
>         .driver.pm = &radeon_pm_ops,
>  };
>
> -static int __init radeon_init(void)
> +static int __init radeon_initl(void)
>  {
>         if (vgacon_text_force() && radeon_modeset == -1) {
>                 DRM_INFO("VGACON disable radeon kernel modesetting.\n");
> @@ -621,7 +632,7 @@ static void __exit radeon_exit(void)
>         radeon_unregister_atpx_handler();
>  }
>
> -module_init(radeon_init);
> +module_init(radeon_initl);
>  module_exit(radeon_exit);
>
>  MODULE_AUTHOR(DRIVER_AUTHOR);
> --
> 1.8.3.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-16 18:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-16 18:10 [PATCH] drm/radeon: Fix EEH during kexec KyleMahlkuch
2019-07-16 18:17 ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®