* [PATCH] drm/amdgpu: add some error hanbdling to amdgpu_init
@ 2016-10-28 15:39 Christian König
[not found] ` <1477669187-6294-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Christian König @ 2016-10-28 15:39 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
From: Christian König <christian.koenig@amd.com>
Just to be clean should we ever run into -ENOMEM during module init.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 7224d17..eb418a0 100755
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -746,9 +746,20 @@ static struct pci_driver amdgpu_kms_pci_driver = {
static int __init amdgpu_init(void)
{
- amdgpu_sync_init();
- amdgpu_fence_slab_init();
- amd_sched_fence_slab_init();
+ int r;
+
+ r = amdgpu_sync_init();
+ if (r)
+ goto error_sync;
+
+ r = amdgpu_fence_slab_init();
+ if (r)
+ goto error_fence;
+
+ r = amd_sched_fence_slab_init();
+ if (r)
+ goto error_sched;
+
if (vgacon_text_force()) {
DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n");
return -EINVAL;
@@ -760,6 +771,15 @@ static int __init amdgpu_init(void)
amdgpu_register_atpx_handler();
/* let modprobe override vga console setting */
return drm_pci_init(driver, pdriver);
+
+error_sched:
+ amdgpu_fence_slab_fini();
+
+error_fence:
+ amdgpu_sync_fini();
+
+error_sync:
+ return r;
}
static void __exit amdgpu_exit(void)
--
2.5.0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH] drm/amdgpu: add some error hanbdling to amdgpu_init
[not found] ` <1477669187-6294-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2016-10-28 16:37 ` Deucher, Alexander
0 siblings, 0 replies; 2+ messages in thread
From: Deucher, Alexander @ 2016-10-28 16:37 UTC (permalink / raw)
To: 'Christian König', amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Christian König
> Sent: Friday, October 28, 2016 11:40 AM
> To: amd-gfx@lists.freedesktop.org
> Subject: [PATCH] drm/amdgpu: add some error hanbdling to amdgpu_init
>
> From: Christian König <christian.koenig@amd.com>
>
> Just to be clean should we ever run into -ENOMEM during module init.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 26
> +++++++++++++++++++++++---
> 1 file changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 7224d17..eb418a0 100755
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -746,9 +746,20 @@ static struct pci_driver amdgpu_kms_pci_driver = {
>
> static int __init amdgpu_init(void)
> {
> - amdgpu_sync_init();
> - amdgpu_fence_slab_init();
> - amd_sched_fence_slab_init();
> + int r;
> +
> + r = amdgpu_sync_init();
> + if (r)
> + goto error_sync;
> +
> + r = amdgpu_fence_slab_init();
> + if (r)
> + goto error_fence;
> +
> + r = amd_sched_fence_slab_init();
> + if (r)
> + goto error_sched;
> +
> if (vgacon_text_force()) {
> DRM_ERROR("VGACON disables amdgpu kernel
> modesetting.\n");
> return -EINVAL;
> @@ -760,6 +771,15 @@ static int __init amdgpu_init(void)
> amdgpu_register_atpx_handler();
> /* let modprobe override vga console setting */
> return drm_pci_init(driver, pdriver);
> +
> +error_sched:
> + amdgpu_fence_slab_fini();
> +
> +error_fence:
> + amdgpu_sync_fini();
> +
> +error_sync:
> + return r;
> }
>
> static void __exit amdgpu_exit(void)
> --
> 2.5.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
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:[~2016-10-28 16:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-28 15:39 [PATCH] drm/amdgpu: add some error hanbdling to amdgpu_init Christian König
[not found] ` <1477669187-6294-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-10-28 16:37 ` Deucher, Alexander
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.