aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-10-04 10:33:04 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-10-04 11:11:54 -0400
commit7b4f3990a22fbe800945f12001bc30db374d0af5 (patch)
tree2e894f736ba0c4c05b481e7db8d8a122c70a9850 /drivers/gpu/drm/i915
parent2c6be944111a873ce96865f1a6033056bdf0d0e2 (diff)
drm/i915: Avoid circular locking from intel_fbdev_fini()
lockdep spots that the fb_info->lock takes the dev->struct_mutex during init (due to the device probing) and so we can not hold dev->struct_mutex when unregistering the framebuffer. Simply reverse the order of initialisation during cleanup and so do the intel_fbdev_fini() before the intel_modeset_cleanup. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c1
-rw-r--r--drivers/gpu/drm/i915/intel_display.c2
-rw-r--r--drivers/gpu/drm/i915/intel_fb.c8
3 files changed, 4 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index df86d04f7968..726c3736082f 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -2106,6 +2106,7 @@ int i915_driver_unload(struct drm_device *dev)
2106 acpi_video_unregister(); 2106 acpi_video_unregister();
2107 2107
2108 if (drm_core_check_feature(dev, DRIVER_MODESET)) { 2108 if (drm_core_check_feature(dev, DRIVER_MODESET)) {
2109 intel_fbdev_fini(dev);
2109 intel_modeset_cleanup(dev); 2110 intel_modeset_cleanup(dev);
2110 2111
2111 /* 2112 /*
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f55b560c468f..69c54c5a4254 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6130,8 +6130,6 @@ void intel_modeset_cleanup(struct drm_device *dev)
6130 drm_kms_helper_poll_fini(dev); 6130 drm_kms_helper_poll_fini(dev);
6131 mutex_lock(&dev->struct_mutex); 6131 mutex_lock(&dev->struct_mutex);
6132 6132
6133 intel_fbdev_fini(dev);
6134
6135 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 6133 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
6136 /* Skip inactive CRTCs */ 6134 /* Skip inactive CRTCs */
6137 if (!crtc->fb) 6135 if (!crtc->fb)
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 7af4accafb7f..7dc50acd65d7 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -206,8 +206,8 @@ static struct drm_fb_helper_funcs intel_fb_helper_funcs = {
206 .fb_probe = intel_fb_find_or_create_single, 206 .fb_probe = intel_fb_find_or_create_single,
207}; 207};
208 208
209static int intel_fbdev_destroy(struct drm_device *dev, 209static void intel_fbdev_destroy(struct drm_device *dev,
210 struct intel_fbdev *ifbdev) 210 struct intel_fbdev *ifbdev)
211{ 211{
212 struct fb_info *info; 212 struct fb_info *info;
213 struct intel_framebuffer *ifb = &ifbdev->ifb; 213 struct intel_framebuffer *ifb = &ifbdev->ifb;
@@ -225,9 +225,7 @@ static int intel_fbdev_destroy(struct drm_device *dev,
225 225
226 drm_framebuffer_cleanup(&ifb->base); 226 drm_framebuffer_cleanup(&ifb->base);
227 if (ifb->obj) 227 if (ifb->obj)
228 drm_gem_object_unreference(ifb->obj); 228 drm_gem_object_unreference_unlocked(ifb->obj);
229
230 return 0;
231} 229}
232 230
233int intel_fbdev_init(struct drm_device *dev) 231int intel_fbdev_init(struct drm_device *dev)