diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
index dccb158..d30b45d 100644
--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
+++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
@@ -85,6 +85,16 @@
 		goto out;
 	}
 
+	/* Take the locks in a specific order to keep lockdep happy */
+	if (old_rg->id < new_rg->id) {
+		omapfb_get_mem_region(old_rg);
+		omapfb_get_mem_region(new_rg);
+	} else if (new_rg->id < old_rg->id) {
+		omapfb_get_mem_region(new_rg);
+		omapfb_get_mem_region(old_rg);
+	} else
+		omapfb_get_mem_region(old_rg);
+
 	if (pi->enabled && !new_rg->size) {
 		/*
 		 * This plane's memory was freed, can't enable it
@@ -136,6 +146,16 @@
 			goto undo;
 	}
 
+	/* Release the locks in a specific order to keep lockdep happy */
+	if (old_rg->id > new_rg->id) {
+		omapfb_put_mem_region(old_rg);
+		omapfb_put_mem_region(new_rg);
+	} else if (new_rg->id > old_rg->id) {
+		omapfb_put_mem_region(new_rg);
+		omapfb_put_mem_region(old_rg);
+	} else
+		omapfb_put_mem_region(old_rg);
+
 	return 0;
 
  undo:
@@ -146,6 +166,15 @@
 
 	ovl->set_overlay_info(ovl, &old_info);
  put_mem:
+	/* Release the locks in a specific order to keep lockdep happy */
+	if (old_rg->id > new_rg->id) {
+		omapfb_put_mem_region(old_rg);
+		omapfb_put_mem_region(new_rg);
+	} else if (new_rg->id > old_rg->id) {
+		omapfb_put_mem_region(new_rg);
+		omapfb_put_mem_region(old_rg);
+	} else
+		omapfb_put_mem_region(old_rg);
  out:
 	dev_err(fbdev->dev, "setup_plane failed\n");
 
@@ -195,10 +224,11 @@
 	if (display && display->driver->sync)
 		display->driver->sync(display);
 
-	mutex_lock(&fbi->mm_lock);
-
 	rg = ofbi->region;
 
+	down_write_nested(&rg->lock, rg->id);
+	atomic_inc(&rg->lock_count);
+
 	if (rg->size == size && rg->type == mi->type)
 		goto out;
 
@@ -231,7 +261,9 @@
 	}
 
  out:
-	mutex_unlock(&fbi->mm_lock);
+	atomic_dec(&rg->lock_count);
+	up_write(&rg->lock);
+
 	return r;
 }
 
@@ -240,12 +272,14 @@
 	struct omapfb_info *ofbi = FB2OFB(fbi);
 	struct omapfb2_mem_region *rg;
 
-	rg = ofbi->region;
+	rg = omapfb_get_mem_region(ofbi->region);
 	memset(mi, 0, sizeof(*mi));
 
 	mi->size = rg->size;
 	mi->type = rg->type;
 
+	omapfb_put_mem_region(rg);
+
 	return 0;
 }
 
@@ -284,10 +318,14 @@
 	if (mode != OMAPFB_AUTO_UPDATE && mode != OMAPFB_MANUAL_UPDATE)
 		return -EINVAL;
 
+	omapfb_lock(fbdev);
+
 	d = get_display_data(fbdev, display);
 
-	if (d->update_mode == mode)
+	if (d->update_mode == mode) {
+		omapfb_unlock(fbdev);
 		return 0;
+	}
 
 	r = 0;
 
@@ -303,6 +341,8 @@
 			r = -EINVAL;
 	}
 
+	omapfb_unlock(fbdev);
+
 	return r;
 }
 
@@ -317,10 +357,14 @@
 	if (!display)
 		return -EINVAL;
 
+	omapfb_lock(fbdev);
+
 	d = get_display_data(fbdev, display);
 
 	*mode = d->update_mode;
 
+	omapfb_unlock(fbdev);
+
 	return 0;
 }
 
@@ -380,10 +424,13 @@
 		struct omapfb_color_key *ck)
 {
 	struct omapfb_info *ofbi = FB2OFB(fbi);
+	struct omapfb2_device *fbdev = ofbi->fbdev;
 	int r;
 	int i;
 	struct omap_overlay_manager *mgr = NULL;
 
+	omapfb_lock(fbdev);
+
 	for (i = 0; i < ofbi->num_overlays; i++) {
 		if (ofbi->overlays[i]->manager) {
 			mgr = ofbi->overlays[i]->manager;
@@ -398,6 +445,8 @@
 
 	r = _omapfb_set_color_key(mgr, ck);
 err:
+	omapfb_unlock(fbdev);
+
 	return r;
 }
 
@@ -405,10 +454,13 @@
 		struct omapfb_color_key *ck)
 {
 	struct omapfb_info *ofbi = FB2OFB(fbi);
+	struct omapfb2_device *fbdev = ofbi->fbdev;
 	struct omap_overlay_manager *mgr = NULL;
 	int r = 0;
 	int i;
 
+	omapfb_lock(fbdev);
+
 	for (i = 0; i < ofbi->num_overlays; i++) {
 		if (ofbi->overlays[i]->manager) {
 			mgr = ofbi->overlays[i]->manager;
@@ -423,6 +475,8 @@
 
 	*ck = omapfb_color_keys[mgr->id];
 err:
+	omapfb_unlock(fbdev);
+
 	return r;
 }
 
@@ -549,8 +603,6 @@
 
 	int r = 0;
 
-	omapfb_lock(fbdev);
-
 	switch (cmd) {
 	case OMAPFB_SYNC_GFX:
 		DBG("ioctl SYNC_GFX\n");
@@ -856,8 +908,6 @@
 		r = -EINVAL;
 	}
 
-	omapfb_unlock(fbdev);
-
 	if (r < 0)
 		DBG("ioctl failed: %d\n", r);
 
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 948dfb9..ca585ef 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -672,6 +672,8 @@
 
 	DBG("check_fb_var %d\n", ofbi->id);
 
+	WARN_ON(!atomic_read(&ofbi->region->lock_count));
+
 	r = fb_mode_to_dss_mode(var, &mode);
 	if (r) {
 		DBG("cannot convert var to omap dss mode\n");
@@ -853,6 +855,8 @@
 	int rotation = var->rotate;
 	int i;
 
+	WARN_ON(!atomic_read(&ofbi->region->lock_count));
+
 	for (i = 0; i < ofbi->num_overlays; i++) {
 		if (ovl != ofbi->overlays[i])
 			continue;
@@ -944,6 +948,8 @@
 		fill_fb(fbi);
 #endif
 
+	WARN_ON(!atomic_read(&ofbi->region->lock_count));
+
 	for (i = 0; i < ofbi->num_overlays; i++) {
 		ovl = ofbi->overlays[i];
 
@@ -1002,16 +1008,15 @@
 static int omapfb_check_var(struct fb_var_screeninfo *var, struct fb_info *fbi)
 {
 	struct omapfb_info *ofbi = FB2OFB(fbi);
-	struct omapfb2_device *fbdev = ofbi->fbdev;
 	int r;
 
 	DBG("check_var(%d)\n", FB2OFB(fbi)->id);
 
-	omapfb_lock(fbdev);
+	omapfb_get_mem_region(ofbi->region);
 
 	r = check_fb_var(fbi, var);
 
-	omapfb_unlock(fbdev);
+	omapfb_put_mem_region(ofbi->region);
 
 	return r;
 }
@@ -1020,12 +1025,11 @@
 static int omapfb_set_par(struct fb_info *fbi)
 {
 	struct omapfb_info *ofbi = FB2OFB(fbi);
-	struct omapfb2_device *fbdev = ofbi->fbdev;
 	int r;
 
 	DBG("set_par(%d)\n", FB2OFB(fbi)->id);
 
-	omapfb_lock(fbdev);
+	omapfb_get_mem_region(ofbi->region);
 
 	set_fb_fix(fbi);
 
@@ -1036,7 +1040,7 @@
 	r = omapfb_apply_changes(fbi, 0);
 
  out:
-	omapfb_unlock(fbdev);
+	omapfb_put_mem_region(ofbi->region);
 
 	return r;
 }
@@ -1045,7 +1049,6 @@
 		struct fb_info *fbi)
 {
 	struct omapfb_info *ofbi = FB2OFB(fbi);
-	struct omapfb2_device *fbdev = ofbi->fbdev;
 	struct fb_var_screeninfo new_var;
 	int r;
 
@@ -1061,11 +1064,11 @@
 
 	fbi->var = new_var;
 
-	omapfb_lock(fbdev);
+	omapfb_get_mem_region(ofbi->region);
 
 	r = omapfb_apply_changes(fbi, 0);
 
-	omapfb_unlock(fbdev);
+	omapfb_put_mem_region(ofbi->region);
 
 	return r;
 }
@@ -1074,14 +1077,18 @@
 {
 	struct omapfb2_mem_region *rg = vma->vm_private_data;
 
+	omapfb_get_mem_region(rg);
 	atomic_inc(&rg->map_count);
+	omapfb_put_mem_region(rg);
 }
 
 static void mmap_user_close(struct vm_area_struct *vma)
 {
 	struct omapfb2_mem_region *rg = vma->vm_private_data;
 
+	omapfb_get_mem_region(rg);
 	atomic_dec(&rg->map_count);
+	omapfb_put_mem_region(rg);
 }
 
 static struct vm_operations_struct mmap_user_ops = {
@@ -1105,7 +1112,7 @@
 		return -EINVAL;
 	off = vma->vm_pgoff << PAGE_SHIFT;
 
-	rg = ofbi->region;
+	rg = omapfb_get_mem_region(ofbi->region);
 
 	start = omapfb_get_region_paddr(ofbi);
 	len = fix->smem_len;
@@ -1133,9 +1140,13 @@
 	/* vm_ops.open won't be called for mmap itself. */
 	atomic_inc(&rg->map_count);
 
+	omapfb_put_mem_region(rg);
+
 	return 0;
 
  error:
+	omapfb_put_mem_region(ofbi->region);
+
 	return r;
 }
 
@@ -1902,6 +1913,7 @@
 
 		ofbi->region = &fbdev->regions[i];
 		ofbi->region->id = i;
+		init_rwsem(&ofbi->region->lock);
 
 		/* assign these early, so that fb alloc can use them */
 		ofbi->rotation_type = def_vrfb ? OMAP_DSS_ROT_VRFB :
@@ -1933,8 +1945,12 @@
 	/* setup fb_infos */
 	for (i = 0; i < fbdev->num_fbs; i++) {
 		struct fb_info *fbi = fbdev->fbs[i];
+		struct omapfb_info *ofbi = FB2OFB(fbi);
 
+		omapfb_get_mem_region(ofbi->region);
 		r = omapfb_fb_init(fbdev, fbi);
+		omapfb_put_mem_region(ofbi->region);
+
 		if (r) {
 			dev_err(fbdev->dev, "failed to setup fb_info\n");
 			return r;
@@ -1966,8 +1982,12 @@
 
 	for (i = 0; i < fbdev->num_fbs; i++) {
 		struct fb_info *fbi = fbdev->fbs[i];
+		struct omapfb_info *ofbi = FB2OFB(fbi);
 
+		omapfb_get_mem_region(ofbi->region);
 		r = omapfb_apply_changes(fbi, 1);
+		omapfb_put_mem_region(ofbi->region);
+
 		if (r) {
 			dev_err(fbdev->dev, "failed to change mode\n");
 			return r;
diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c
index be5eb07..18fa9e1 100644
--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c
+++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
@@ -49,7 +49,6 @@
 {
 	struct fb_info *fbi = dev_get_drvdata(dev);
 	struct omapfb_info *ofbi = FB2OFB(fbi);
-	struct omapfb2_device *fbdev = ofbi->fbdev;
 	struct omapfb2_mem_region *rg;
 	int rot_type;
 	int r;
@@ -63,13 +62,12 @@
 
 	if (!lock_fb_info(fbi))
 		return -ENODEV;
-	omapfb_lock(fbdev);
 
 	r = 0;
 	if (rot_type == ofbi->rotation_type)
 		goto out;
 
-	rg = ofbi->region;
+	rg = omapfb_get_mem_region(ofbi->region);
 
 	if (rg->size) {
 		r = -EBUSY;
@@ -83,8 +81,8 @@
 	 * need to do any further parameter checking at this point.
 	 */
 put_region:
+	omapfb_put_mem_region(rg);
 out:
-	omapfb_unlock(fbdev);
 	unlock_fb_info(fbi);
 
 	return r ? r : count;
@@ -106,7 +104,6 @@
 {
 	struct fb_info *fbi = dev_get_drvdata(dev);
 	struct omapfb_info *ofbi = FB2OFB(fbi);
-	struct omapfb2_device *fbdev = ofbi->fbdev;
 	bool mirror;
 	int r;
 	struct fb_var_screeninfo new_var;
@@ -117,10 +114,11 @@
 
 	if (!lock_fb_info(fbi))
 		return -ENODEV;
-	omapfb_lock(fbdev);
 
 	ofbi->mirror = mirror;
 
+	omapfb_get_mem_region(ofbi->region);
+
 	memcpy(&new_var, &fbi->var, sizeof(new_var));
 	r = check_fb_var(fbi, &new_var);
 	if (r)
@@ -135,7 +133,8 @@
 
 	r = count;
 out:
-	omapfb_unlock(fbdev);
+	omapfb_put_mem_region(ofbi->region);
+
 	unlock_fb_info(fbi);
 
 	return r;
@@ -274,11 +273,15 @@
 
 		DBG("detaching %d\n", ofbi->overlays[i]->id);
 
+		omapfb_get_mem_region(ofbi->region);
+
 		omapfb_overlay_enable(ovl, 0);
 
 		if (ovl->manager)
 			ovl->manager->apply(ovl->manager);
 
+		omapfb_put_mem_region(ofbi->region);
+
 		for (t = i + 1; t < ofbi->num_overlays; t++) {
 			ofbi->rotation[t-1] = ofbi->rotation[t];
 			ofbi->overlays[t-1] = ofbi->overlays[t];
@@ -311,8 +314,12 @@
 	}
 
 	if (added) {
+		omapfb_get_mem_region(ofbi->region);
+
 		r = omapfb_apply_changes(fbi, 0);
 
+		omapfb_put_mem_region(ofbi->region);
+
 		if (r)
 			goto out;
 	}
@@ -330,13 +337,11 @@
 {
 	struct fb_info *fbi = dev_get_drvdata(dev);
 	struct omapfb_info *ofbi = FB2OFB(fbi);
-	struct omapfb2_device *fbdev = ofbi->fbdev;
 	ssize_t l = 0;
 	int t;
 
 	if (!lock_fb_info(fbi))
 		return -ENODEV;
-	omapfb_lock(fbdev);
 
 	for (t = 0; t < ofbi->num_overlays; t++) {
 		l += snprintf(buf + l, PAGE_SIZE - l, "%s%d",
@@ -345,7 +350,6 @@
 
 	l += snprintf(buf + l, PAGE_SIZE - l, "\n");
 
-	omapfb_unlock(fbdev);
 	unlock_fb_info(fbi);
 
 	return l;
@@ -356,7 +360,6 @@
 {
 	struct fb_info *fbi = dev_get_drvdata(dev);
 	struct omapfb_info *ofbi = FB2OFB(fbi);
-	struct omapfb2_device *fbdev = ofbi->fbdev;
 	int num_ovls = 0, r, i;
 	int len;
 	bool changed = false;
@@ -368,7 +371,6 @@
 
 	if (!lock_fb_info(fbi))
 		return -ENODEV;
-	omapfb_lock(fbdev);
 
 	if (len > 0) {
 		char *p = (char *)buf;
@@ -405,7 +407,12 @@
 		for (i = 0; i < num_ovls; ++i)
 			ofbi->rotation[i] = rotation[i];
 
+		omapfb_get_mem_region(ofbi->region);
+
 		r = omapfb_apply_changes(fbi, 0);
+
+		omapfb_put_mem_region(ofbi->region);
+
 		if (r)
 			goto out;
 
@@ -414,7 +421,6 @@
 
 	r = count;
 out:
-	omapfb_unlock(fbdev);
 	unlock_fb_info(fbi);
 
 	return r;
@@ -425,19 +431,8 @@
 {
 	struct fb_info *fbi = dev_get_drvdata(dev);
 	struct omapfb_info *ofbi = FB2OFB(fbi);
-	struct omapfb2_device *fbdev = ofbi->fbdev;
-	int r;
 
-	if (!lock_fb_info(fbi))
-		return -ENODEV;
-	omapfb_lock(fbdev);
-
-	r = snprintf(buf, PAGE_SIZE, "%lu\n", ofbi->region->size);
-
-	omapfb_unlock(fbdev);
-	unlock_fb_info(fbi);
-
-	return r;
+	return snprintf(buf, PAGE_SIZE, "%lu\n", ofbi->region->size);
 }
 
 static ssize_t store_size(struct device *dev, struct device_attribute *attr,
@@ -460,15 +455,15 @@
 
 	if (!lock_fb_info(fbi))
 		return -ENODEV;
-	omapfb_lock(fbdev);
 
 	if (display && display->driver->sync)
 		display->driver->sync(display);
 
-	mutex_lock(&fbi->mm_lock);
-
 	rg = ofbi->region;
 
+	down_write_nested(&rg->lock, rg->id);
+	atomic_inc(&rg->lock_count);
+
 	if (atomic_read(&rg->map_count)) {
 		r = -EBUSY;
 		goto out;
@@ -501,8 +496,9 @@
 
 	r = count;
 out:
-	mutex_unlock(&fbi->mm_lock);
-	omapfb_unlock(fbdev);
+	atomic_dec(&rg->lock_count);
+	up_write(&rg->lock);
+
 	unlock_fb_info(fbi);
 
 	return r;
@@ -513,19 +509,8 @@
 {
 	struct fb_info *fbi = dev_get_drvdata(dev);
 	struct omapfb_info *ofbi = FB2OFB(fbi);
-	struct omapfb2_device *fbdev = ofbi->fbdev;
-	int r;
 
-	if (!lock_fb_info(fbi))
-		return -ENODEV;
-	omapfb_lock(fbdev);
-
-	r = snprintf(buf, PAGE_SIZE, "%0x\n", ofbi->region->paddr);
-
-	omapfb_unlock(fbdev);
-	unlock_fb_info(fbi);
-
-	return r;
+	return snprintf(buf, PAGE_SIZE, "%0x\n", ofbi->region->paddr);
 }
 
 static ssize_t show_virt(struct device *dev,
@@ -541,20 +526,11 @@
 		struct device_attribute *attr, char *buf)
 {
 	struct fb_info *fbi = dev_get_drvdata(dev);
-	struct omapfb_info *ofbi = FB2OFB(fbi);
-	struct omapfb2_device *fbdev = ofbi->fbdev;
 	enum omapfb_update_mode mode;
 	int r;
 
-	if (!lock_fb_info(fbi))
-		return -ENODEV;
-	omapfb_lock(fbdev);
-
 	r = omapfb_get_update_mode(fbi, &mode);
 
-	omapfb_unlock(fbdev);
-	unlock_fb_info(fbi);
-
 	if (r)
 		return r;
 
@@ -565,8 +541,6 @@
 		const char *buf, size_t count)
 {
 	struct fb_info *fbi = dev_get_drvdata(dev);
-	struct omapfb_info *ofbi = FB2OFB(fbi);
-	struct omapfb2_device *fbdev = ofbi->fbdev;
 	unsigned mode;
 	int r;
 
@@ -574,17 +548,10 @@
 	if (r)
 		return r;
 
-	if (!lock_fb_info(fbi))
-		return -ENODEV;
-	omapfb_lock(fbdev);
-
 	r = omapfb_set_update_mode(fbi, mode);
 	if (r)
 		return r;
 
-	omapfb_unlock(fbdev);
-	unlock_fb_info(fbi);
-
 	return count;
 }
 
diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
index 2b52644..623cd87 100644
--- a/drivers/video/omap2/omapfb/omapfb.h
+++ b/drivers/video/omap2/omapfb/omapfb.h
@@ -62,6 +62,8 @@
 	bool		alloc;		/* allocated by the driver */
 	bool		map;		/* kernel mapped by the driver */
 	atomic_t	map_count;
+	struct rw_semaphore lock;
+	atomic_t	lock_count;
 };
 
 /* appended to fb_info */
@@ -189,4 +191,18 @@
 		return ovl->disable(ovl);
 }
 
+static inline struct omapfb2_mem_region *
+omapfb_get_mem_region(struct omapfb2_mem_region *rg)
+{
+	down_read_nested(&rg->lock, rg->id);
+	atomic_inc(&rg->lock_count);
+	return rg;
+}
+
+static inline void omapfb_put_mem_region(struct omapfb2_mem_region *rg)
+{
+	atomic_dec(&rg->lock_count);
+	up_read(&rg->lock);
+}
+
 #endif
