omapfb: Reorder Register_framebuffer call

Started by Aguirre Rodriguez, Sergio Alberto on Aug 20, 2009 · 5 messages from 5 authors · Last reply Sep 5, 2009

Subsystems (2)

Maintainers (2)

STALE6295d

open the first message on its own page

Message details and related content
From: Sergio Aguirre <redacted>

This fixes the issue in which mm_lock mutex was attempted to be
used without initializing previously.

Signed-off-by: Sergio Aguirre <redacted>
---
 drivers/video/omap/omapfb_main.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index 125e605..60f9482 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -1503,12 +1503,21 @@ static int fbinfo_init(struct omapfb_device *fbdev, struct fb_info *info)
 	var->rotate	  = def_rotate;
 	var->bits_per_pixel = fbdev->panel->bpp;
 
+	r = register_framebuffer(info);
+	if (r != 0) {
+		dev_err(fbdev->dev,
+			"registering framebuffer failed\n");
+		return r;
+	}
+
 	set_fb_var(info, var);
 	set_fb_fix(info);
 
 	r = fb_alloc_cmap(&info->cmap, 16, 0);
-	if (r != 0)
+	if (r != 0) {
 		dev_err(fbdev->dev, "unable to allocate color map memory\n");
+		unregister_framebuffer(info);
+	}
 
 	return r;
 }
@@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct platform_device *pdev,
 	init_state++;
 
 	vram = 0;
-	for (i = 0; i < fbdev->mem_desc.region_cnt; i++) {
-		r = register_framebuffer(fbdev->fb_info[i]);
-		if (r != 0) {
-			dev_err(fbdev->dev,
-				"registering framebuffer %d failed\n", i);
-			goto cleanup;
-		}
+	for (i = 0; i < fbdev->mem_desc.region_cnt; i++)
 		vram += fbdev->mem_desc.region[i].size;
-	}
 
 	fbdev->state = OMAPFB_ACTIVE;
 
-- 
1.6.3.2
Message details and related content
From: Sergio Aguirre <redacted>

This fixes the issue in which mm_lock mutex was attempted to be
used without initializing previously.

Signed-off-by: Sergio Aguirre <redacted>
Tested-by: Anand Gadiyar <redacted>

This patch on top of current linux-omap kernel allows me to
boot with the default SDP defconfig on a 3430 SDP.

- Anand

quoted hunk
---
 drivers/video/omap/omapfb_main.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index 125e605..60f9482 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -1503,12 +1503,21 @@ static int fbinfo_init(struct omapfb_device *fbdev, struct fb_info *info)
 	var->rotate	  = def_rotate;
 	var->bits_per_pixel = fbdev->panel->bpp;
 
+	r = register_framebuffer(info);
+	if (r != 0) {
+		dev_err(fbdev->dev,
+			"registering framebuffer failed\n");
+		return r;
+	}
+
 	set_fb_var(info, var);
 	set_fb_fix(info);
 
 	r = fb_alloc_cmap(&info->cmap, 16, 0);
-	if (r != 0)
+	if (r != 0) {
 		dev_err(fbdev->dev, "unable to allocate color map memory\n");
+		unregister_framebuffer(info);
+	}
 
 	return r;
 }
@@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct platform_device *pdev,
 	init_state++;
 
 	vram = 0;
-	for (i = 0; i < fbdev->mem_desc.region_cnt; i++) {
-		r = register_framebuffer(fbdev->fb_info[i]);
-		if (r != 0) {
-			dev_err(fbdev->dev,
-				"registering framebuffer %d failed\n", i);

12 more quoted lines

Message details and related content
-----Original Message-----
From: <redacted> [mailto:linux-omap-
owner@vger.kernel.org] On Behalf Of Gadiyar, Anand
Sent: Friday, September 04, 2009 12:15 PM
To: Aguirre Rodriguez, Sergio Alberto; linux-fbdev-
devel@lists.sourceforge.net
Cc: Imre Deak; <redacted>
Subject: RE: [RFC][PATCH] omapfb: Reorder Register_framebuffer call
quoted
From: Sergio Aguirre <redacted>

This fixes the issue in which mm_lock mutex was attempted to be
used without initializing previously.

Signed-off-by: Sergio Aguirre <redacted>
Tested-by: Anand Gadiyar <redacted>

This patch on top of current linux-omap kernel allows me to
boot with the default SDP defconfig on a 3430 SDP.
[Hiremath, Vaibhav] I have tried it on OMAP3EVM and it allowed me to boot, which was crashing before.

Thanks,
Vaibhav
- Anand

quoted
---
 drivers/video/omap/omapfb_main.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/video/omap/omapfb_main.c
b/drivers/video/omap/omapfb_main.c
quoted
index 125e605..60f9482 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -1503,12 +1503,21 @@ static int fbinfo_init(struct
omapfb_device *fbdev, struct fb_info *info)
quoted
 	var->rotate	  = def_rotate;
 	var->bits_per_pixel = fbdev->panel->bpp;

+	r = register_framebuffer(info);
+	if (r != 0) {
+		dev_err(fbdev->dev,
+			"registering framebuffer failed\n");
+		return r;
+	}
+
 	set_fb_var(info, var);
 	set_fb_fix(info);

 	r = fb_alloc_cmap(&info->cmap, 16, 0);
-	if (r != 0)
+	if (r != 0) {
 		dev_err(fbdev->dev, "unable to allocate color map
memory\n");
quoted
+		unregister_framebuffer(info);
+	}

 	return r;
 }
@@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct
platform_device *pdev,
quoted
 	init_state++;

23 more quoted lines

Message details and related content
On Fri, 2009-09-04 at 12:14 +0530, Gadiyar, Anand wrote:
quoted
From: Sergio Aguirre <redacted>

This fixes the issue in which mm_lock mutex was attempted to be
used without initializing previously.

Signed-off-by: Sergio Aguirre <redacted>
Tested-by: Anand Gadiyar <redacted>

This patch on top of current linux-omap kernel allows me to
boot with the default SDP defconfig on a 3430 SDP.
Tested-by: Peter Barada <redacted>

This patch on top of current linux-omap kernel allows me to boot with
the LCD enabled on LogicPD's OMAP boards.
quoted
---
 drivers/video/omap/omapfb_main.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index 125e605..60f9482 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -1503,12 +1503,21 @@ static int fbinfo_init(struct omapfb_device *fbdev, struct fb_info *info)
 	var->rotate	  = def_rotate;
 	var->bits_per_pixel = fbdev->panel->bpp;
 
+	r = register_framebuffer(info);
+	if (r != 0) {
+		dev_err(fbdev->dev,
+			"registering framebuffer failed\n");
+		return r;
+	}
+
 	set_fb_var(info, var);
 	set_fb_fix(info);
 
 	r = fb_alloc_cmap(&info->cmap, 16, 0);
-	if (r != 0)
+	if (r != 0) {
 		dev_err(fbdev->dev, "unable to allocate color map memory\n");
+		unregister_framebuffer(info);
+	}
 
 	return r;
 }
@@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct platform_device *pdev,
 	init_state++;
 
 	vram = 0;
-	for (i = 0; i < fbdev->mem_desc.region_cnt; i++) {
-		r = register_framebuffer(fbdev->fb_info[i]);
-		if (r != 0) {
-			dev_err(fbdev->dev,
-				"registering framebuffer %d failed\n", i);

15 more quoted lines

-- 
Peter Barada [off-list ref]
Logic Product Development, Inc.
Message details and related content
On Sep 4, 2009, at 9:34 AM, Peter Barada wrote:
On Fri, 2009-09-04 at 12:14 +0530, Gadiyar, Anand wrote:
quoted
quoted
From: Sergio Aguirre <redacted>

This fixes the issue in which mm_lock mutex was attempted to be
used without initializing previously.

Signed-off-by: Sergio Aguirre <redacted>
Tested-by: Anand Gadiyar <redacted>

This patch on top of current linux-omap kernel allows me to
boot with the default SDP defconfig on a 3430 SDP.
Tested-by: Peter Barada <redacted>

This patch on top of current linux-omap kernel allows me to boot with
the LCD enabled on LogicPD's OMAP boards.
Tested-by: Eric Witcher <redacted>
Ditto for omap3_beagle_defconfig on Beagle Rev. C2
quoted
quoted
---
drivers/video/omap/omapfb_main.c |   20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index 125e605..60f9482 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -1503,12 +1503,21 @@ static int fbinfo_init(struct omapfb_device *fbdev, struct fb_info *info)
	var->rotate	  = def_rotate;
	var->bits_per_pixel = fbdev->panel->bpp;

+	r = register_framebuffer(info);
+	if (r != 0) {
+		dev_err(fbdev->dev,
+			"registering framebuffer failed\n");
+		return r;
+	}
+
	set_fb_var(info, var);
	set_fb_fix(info);

	r = fb_alloc_cmap(&info->cmap, 16, 0);
-	if (r != 0)
+	if (r != 0) {
		dev_err(fbdev->dev, "unable to allocate color map memory\n");
+		unregister_framebuffer(info);
+	}

	return r;
}
@@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct platform_device *pdev,
	init_state++;

	vram = 0;
-	for (i = 0; i < fbdev->mem_desc.region_cnt; i++) {
-		r = register_framebuffer(fbdev->fb_info[i]);
-		if (r != 0) {
-			dev_err(fbdev->dev,
-				"registering framebuffer %d failed\n", i);

22 more quoted lines

Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help