diff mbox

[2/3] drm/radeon: Implement radeon_pci_shutdown

Message ID 20130908121058.GC360@x4 (mailing list archive)
State New, archived
Headers show

Commit Message

Markus Trippelsdorf Sept. 8, 2013, 12:10 p.m. UTC
Currently radeon devices are not properbly shutdown during kexec. This
cases a varity of issues, e.g. dpm initialization failures.
Fix this by implementing a radeon_pci_shutdown function, that unloads
the driver cleanly.

Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
---
 drivers/gpu/drm/radeon/radeon_drv.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Konrad Rzeszutek Wilk Sept. 9, 2013, 1:32 p.m. UTC | #1
On Sun, Sep 08, 2013 at 02:10:58PM +0200, Markus Trippelsdorf wrote:
> Currently radeon devices are not properbly shutdown during kexec. This

properly

> cases a varity of issues, e.g. dpm initialization failures.
> Fix this by implementing a radeon_pci_shutdown function, that unloads
> the driver cleanly.
> 
> Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
> ---
>  drivers/gpu/drm/radeon/radeon_drv.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
> index cb4445f..d71edee 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -380,6 +380,15 @@ static const struct file_operations radeon_driver_kms_fops = {
>  #endif
>  };
>  
> +
> +static void
> +radeon_pci_shutdown(struct pci_dev *pdev)
> +{
> +	struct drm_device *dev = pci_get_drvdata(pdev);
> +
> +	radeon_driver_unload_kms(dev);
> +}
> +
>  static struct drm_driver kms_driver = {
>  	.driver_features =
>  	    DRIVER_USE_AGP |
> @@ -453,6 +462,7 @@ static struct pci_driver radeon_kms_pci_driver = {
>  	.remove = radeon_pci_remove,
>  	.suspend = radeon_pci_suspend,
>  	.resume = radeon_pci_resume,
> +	.shutdown = radeon_pci_shutdown,
>  };
>  
>  static int __init radeon_init(void)
> -- 
> Markus
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index cb4445f..d71edee 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -380,6 +380,15 @@  static const struct file_operations radeon_driver_kms_fops = {
 #endif
 };
 
+
+static void
+radeon_pci_shutdown(struct pci_dev *pdev)
+{
+	struct drm_device *dev = pci_get_drvdata(pdev);
+
+	radeon_driver_unload_kms(dev);
+}
+
 static struct drm_driver kms_driver = {
 	.driver_features =
 	    DRIVER_USE_AGP |
@@ -453,6 +462,7 @@  static struct pci_driver radeon_kms_pci_driver = {
 	.remove = radeon_pci_remove,
 	.suspend = radeon_pci_suspend,
 	.resume = radeon_pci_resume,
+	.shutdown = radeon_pci_shutdown,
 };
 
 static int __init radeon_init(void)