Skip to contentSkip to conversation

amdgpu: Only destroy fbdev framebuffer if it was initialized

PATCH In review Michel Dänzer 3 participants 4 messages Sep 11, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 amdgpu: Only destroy fbdev framebuffer if it was initialized

From: Michel Dänzer <[email protected]>

Fixes crash when trying to unload the amdgpu module before the fbdev framebuffer was initialized, which can happen since the DRM fbdev helper code supports deferred setup.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +2 -2
index 9afa9c097e1f..4136996d77ef 100644
@@ -303,10 +303,10 @@ static int amdgpu_fbdev_destroy(struct drm_device *dev, struct amdgpu_fbdev *rfb
 	if (rfb->obj) {
 		amdgpufb_destroy_pinned_object(rfb->obj);
 		rfb->obj = NULL;
+		drm_framebuffer_unregister_private(&rfb->base);
+		drm_framebuffer_cleanup(&rfb->base);
 	}
 	drm_fb_helper_fini(&rfbdev->helper);
-	drm_framebuffer_unregister_private(&rfb->base);
-	drm_framebuffer_cleanup(&rfb->base);
 
 	return 0;
 }
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20170911081017.2691-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

#2 lore raw

PATCH 2/2 radeon: Only destroy fbdev framebuffer if it was initialized

From: Michel Dänzer <[email protected]>

Fixes crash when trying to unload the amdgpu module before the fbdev framebuffer was initialized, which can happen since the DRM fbdev helper code supports deferred setup.

---
 drivers/gpu/drm/radeon/radeon_fb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_fb.c +2 -2
index fd25361ac681..2fcf805d3a16 100644
@@ -322,10 +322,10 @@ static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfb
 	if (rfb->obj) {
 		radeonfb_destroy_pinned_object(rfb->obj);
 		rfb->obj = NULL;
+		drm_framebuffer_unregister_private(&rfb->base);
+		drm_framebuffer_cleanup(&rfb->base);
 	}
 	drm_fb_helper_fini(&rfbdev->helper);
-	drm_framebuffer_unregister_private(&rfb->base);
-	drm_framebuffer_cleanup(&rfb->base);
 
 	return 0;
 }
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw
In reply to a message not in the archive

Am 11.09.2017 um 10:10 schrieb Michel Dänzer:

Quoted 7 lines

From: Michel Dänzer <[email protected]>

Fixes crash when trying to unload the amdgpu module before the fbdev framebuffer was initialized, which can happen since the DRM fbdev helper code supports deferred setup.

Quoted 11 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
index 9afa9c097e1f..4136996d77ef 100644
@@ -303,10 +303,10 @@ static int amdgpu_fbdev_destroy(struct drm_device *dev, struct amdgpu_fbdev *rfb
  	if (rfb->obj) {
  		amdgpufb_destroy_pinned_object(rfb->obj);

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int amdgpu_fbdev_destroy(struct drm_device *dev, struct amdgpu_fbdev *rfb · line 312

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +2 -2
  		rfb->obj = NULL;
+		drm_framebuffer_unregister_private(&rfb->base);
+		drm_framebuffer_cleanup(&rfb->base);
  	}
  	drm_fb_helper_fini(&rfbdev->helper);
-	drm_framebuffer_unregister_private(&rfb->base);
-	drm_framebuffer_cleanup(&rfb->base);
 
  	return 0;
  }

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): fa98330f-bd1b-1328-0f3a-62220ed2b9ed-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

Reviewed-by
#5 lore raw
Quoted 4 lines · Christian König

Am 11.09.2017 um 10:10 schrieb Michel Dänzer:

Quoted 3 lines

From: Michel Dänzer <[email protected]>

Quoted 8 lines
Quoted 5 lines

Fixes crash when trying to unload the amdgpu module before the fbdev framebuffer was initialized, which can happen since the DRM fbdev helper code supports deferred setup.

Series is:

Quoted 22 lines
Quoted 22 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +2 -2
index 9afa9c097e1f..4136996d77ef 100644
@@ -303,10 +303,10 @@ static int amdgpu_fbdev_destroy(struct drm_device
 *dev, struct amdgpu_fbdev *rfb
        if (rfb->obj) {
                amdgpufb_destroy_pinned_object(rfb->obj);
                rfb->obj = NULL;
+               drm_framebuffer_unregister_private(&rfb->base);
+               drm_framebuffer_cleanup(&rfb->base);
        }
        drm_fb_helper_fini(&rfbdev->helper);
-       drm_framebuffer_unregister_private(&rfb->base);
-       drm_framebuffer_cleanup(&rfb->base);
        return 0;
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int amdgpu_fbdev_destroy(struct drm_device · line 312

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
  }

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx