All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mx3fb: some debug and initialisation fixes.
@ 2009-12-18 16:04 Alberto Panizzo
  2009-12-20 16:45 ` Guennadi Liakhovetski
  0 siblings, 1 reply; 8+ messages in thread
From: Alberto Panizzo @ 2009-12-18 16:04 UTC (permalink / raw)
  To: linux-arm-kernel

Fix the kernel oops when dev_dbg is called with mx3_fbi->txd == NULL

Fix the late initialisation of mx3fb->backlight_level.
If not, in the chain of function started by init_fb_chan(), in __blank() call 
sdc_set_brightness(mx3fb, mx3fb->backlight_level) that will shut down
the CONTRAST PWM output. 


Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
---
 drivers/video/mx3fb.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index 054ef29..772ba3f 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -324,8 +324,11 @@ static void sdc_enable_channel(struct mx3fb_info *mx3_fbi)
 	unsigned long flags;
 	dma_cookie_t cookie;
 
-	dev_dbg(mx3fb->dev, "mx3fbi %p, desc %p, sg %p\n", mx3_fbi,
-		to_tx_desc(mx3_fbi->txd), to_tx_desc(mx3_fbi->txd)->sg);
+	if (mx3_fbi->txd)
+		dev_dbg(mx3fb->dev, "mx3fbi %p, desc %p, sg %p\n", mx3_fbi,
+			to_tx_desc(mx3_fbi->txd), to_tx_desc(mx3_fbi->txd)->sg);
+	else
+		dev_dbg(mx3fb->dev, "mx3fbi %p, txd = NULL\n", mx3_fbi);
 
 	/* This enables the channel */
 	if (mx3_fbi->cookie < 0) {
@@ -646,6 +649,7 @@ static int sdc_set_global_alpha(struct mx3fb_data *mx3fb, bool enable, uint8_t a
 
 static void sdc_set_brightness(struct mx3fb_data *mx3fb, uint8_t value)
 {
+	dev_dbg(mx3fb->dev, "%s: value = %d\n", __func__, value);
 	/* This might be board-specific */
 	mx3fb_write_reg(mx3fb, 0x03000000UL | value << 16, SDC_PWM_CTRL);
 	return;
@@ -1486,12 +1490,12 @@ static int mx3fb_probe(struct platform_device *pdev)
 		goto ersdc0;
 	}
 
+	mx3fb->backlight_level = 255;
+
 	ret = init_fb_chan(mx3fb, to_idmac_chan(chan));
 	if (ret < 0)
 		goto eisdc0;
 
-	mx3fb->backlight_level = 255;
-
 	return 0;
 
 eisdc0:
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] mx3fb: some debug and initialisation fixes.
  2009-12-18 16:04 Alberto Panizzo
@ 2009-12-20 16:45 ` Guennadi Liakhovetski
  2010-01-20 11:12   ` Alberto Panizzo
  0 siblings, 1 reply; 8+ messages in thread
From: Guennadi Liakhovetski @ 2009-12-20 16:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 18 Dec 2009, Alberto Panizzo wrote:

> Fix the kernel oops when dev_dbg is called with mx3_fbi->txd == NULL
> 
> Fix the late initialisation of mx3fb->backlight_level.
> If not, in the chain of function started by init_fb_chan(), in __blank() call 
> sdc_set_brightness(mx3fb, mx3fb->backlight_level) that will shut down
> the CONTRAST PWM output. 
> 
> 
> Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>

Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Thanks
Guennadi

> ---
>  drivers/video/mx3fb.c |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
> index 054ef29..772ba3f 100644
> --- a/drivers/video/mx3fb.c
> +++ b/drivers/video/mx3fb.c
> @@ -324,8 +324,11 @@ static void sdc_enable_channel(struct mx3fb_info *mx3_fbi)
>  	unsigned long flags;
>  	dma_cookie_t cookie;
>  
> -	dev_dbg(mx3fb->dev, "mx3fbi %p, desc %p, sg %p\n", mx3_fbi,
> -		to_tx_desc(mx3_fbi->txd), to_tx_desc(mx3_fbi->txd)->sg);
> +	if (mx3_fbi->txd)
> +		dev_dbg(mx3fb->dev, "mx3fbi %p, desc %p, sg %p\n", mx3_fbi,
> +			to_tx_desc(mx3_fbi->txd), to_tx_desc(mx3_fbi->txd)->sg);
> +	else
> +		dev_dbg(mx3fb->dev, "mx3fbi %p, txd = NULL\n", mx3_fbi);
>  
>  	/* This enables the channel */
>  	if (mx3_fbi->cookie < 0) {
> @@ -646,6 +649,7 @@ static int sdc_set_global_alpha(struct mx3fb_data *mx3fb, bool enable, uint8_t a
>  
>  static void sdc_set_brightness(struct mx3fb_data *mx3fb, uint8_t value)
>  {
> +	dev_dbg(mx3fb->dev, "%s: value = %d\n", __func__, value);
>  	/* This might be board-specific */
>  	mx3fb_write_reg(mx3fb, 0x03000000UL | value << 16, SDC_PWM_CTRL);
>  	return;
> @@ -1486,12 +1490,12 @@ static int mx3fb_probe(struct platform_device *pdev)
>  		goto ersdc0;
>  	}
>  
> +	mx3fb->backlight_level = 255;
> +
>  	ret = init_fb_chan(mx3fb, to_idmac_chan(chan));
>  	if (ret < 0)
>  		goto eisdc0;
>  
> -	mx3fb->backlight_level = 255;
> -
>  	return 0;
>  
>  eisdc0:
> -- 
> 1.6.3.3
> 
> 
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] mx3fb: some debug and initialisation fixes.
  2009-12-20 16:45 ` Guennadi Liakhovetski
@ 2010-01-20 11:12   ` Alberto Panizzo
  2010-01-20 11:54     ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Alberto Panizzo @ 2010-01-20 11:12 UTC (permalink / raw)
  To: linux-arm-kernel

On dom, 2009-12-20 at 17:45 +0100, Guennadi Liakhovetski wrote:
> On Fri, 18 Dec 2009, Alberto Panizzo wrote:
> 
> > Fix the kernel oops when dev_dbg is called with mx3_fbi->txd == NULL
> > 
> > Fix the late initialisation of mx3fb->backlight_level.
> > If not, in the chain of function started by init_fb_chan(), in
> __blank() call 
> > sdc_set_brightness(mx3fb, mx3fb->backlight_level) that will shut
> down
> > the CONTRAST PWM output. 
> > 
> > 
> > Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
> 
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> 
> Thanks
> Guennadi 

Thanks Guennadi for Acking.
Forgive me, but I not understand well the correct path for pulling this 
patch to linus tree.
I thought that Sascha was the right maintainer so I cc-ed him. But
I am wrong right?

Please can you point me to the right mailing list or maintainer?

Thanks
Alberto!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] mx3fb: some debug and initialisation fixes.
  2010-01-20 11:12   ` Alberto Panizzo
@ 2010-01-20 11:54     ` Mark Brown
  2010-01-20 14:43       ` Alberto Panizzo
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2010-01-20 11:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 20, 2010 at 12:12:53PM +0100, Alberto Panizzo wrote:

> Thanks Guennadi for Acking.
> Forgive me, but I not understand well the correct path for pulling this 
> patch to linus tree.
> I thought that Sascha was the right maintainer so I cc-ed him. But
> I am wrong right?

> Please can you point me to the right mailing list or maintainer?

scripts/get_maintainer.pl should be able to tell you - the general
framebuffer subsystem path is via akpm at the moment.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] mx3fb: some debug and initialisation fixes.
  2010-01-20 11:54     ` Mark Brown
@ 2010-01-20 14:43       ` Alberto Panizzo
  0 siblings, 0 replies; 8+ messages in thread
From: Alberto Panizzo @ 2010-01-20 14:43 UTC (permalink / raw)
  To: linux-arm-kernel

On mer, 2010-01-20 at 11:54 +0000, Mark Brown wrote:
> On Wed, Jan 20, 2010 at 12:12:53PM +0100, Alberto Panizzo wrote:
> 
> > Thanks Guennadi for Acking.
> > Forgive me, but I not understand well the correct path for pulling this 
> > patch to linus tree.
> > I thought that Sascha was the right maintainer so I cc-ed him. But
> > I am wrong right?
> 
> > Please can you point me to the right mailing list or maintainer?
> 
> scripts/get_maintainer.pl should be able to tell you - the general
> framebuffer subsystem path is via akpm at the moment.

Thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] mx3fb: some debug and initialisation fixes.
@ 2010-01-20 14:57 Alberto Panizzo
  2010-01-26 21:46 ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Alberto Panizzo @ 2010-01-20 14:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Sascha linux-arm, Guennadi Liakhovetski, Dan Williams,
	Krzysztof Helt, linux-kernel

Hi all!
I've already sent this patch to the linux-arm-kernel mailing list
but I've not cc'ed you.

http://thread.gmane.org/gmane.linux.ports.arm.kernel/71120

This patch apply to linus .33-rc4 tree, tell me if I have to rebase
it over other repository.

Thanks

patch below..
---------------------------------------------------------------------

Fix the kernel oops when dev_dbg is called with mx3_fbi->txd == NULL

Fix the late initialisation of mx3fb->backlight_level.
If not, in the chain of function started by init_fb_chan(), in __blank() call 
sdc_set_brightness(mx3fb, mx3fb->backlight_level) that will shut down
the CONTRAST PWM output. 

Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski <at> gmx.de>
---
 drivers/video/mx3fb.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index 054ef29..772ba3f 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -324,8 +324,11 @@ static void sdc_enable_channel(struct mx3fb_info *mx3_fbi)
        unsigned long flags;
        dma_cookie_t cookie;
 
-       dev_dbg(mx3fb->dev, "mx3fbi %p, desc %p, sg %p\n", mx3_fbi,
-               to_tx_desc(mx3_fbi->txd), to_tx_desc(mx3_fbi->txd)->sg);
+       if (mx3_fbi->txd)
+               dev_dbg(mx3fb->dev, "mx3fbi %p, desc %p, sg %p\n", mx3_fbi,
+                       to_tx_desc(mx3_fbi->txd), to_tx_desc(mx3_fbi->txd)->sg);
+       else
+               dev_dbg(mx3fb->dev, "mx3fbi %p, txd = NULL\n", mx3_fbi);
 
        /* This enables the channel */
        if (mx3_fbi->cookie < 0) {
@@ -646,6 +649,7 @@ static int sdc_set_global_alpha(struct mx3fb_data *mx3fb, bool enable, uint8_t a
 
 static void sdc_set_brightness(struct mx3fb_data *mx3fb, uint8_t value)
 {
+       dev_dbg(mx3fb->dev, "%s: value = %d\n", __func__, value);
        /* This might be board-specific */
        mx3fb_write_reg(mx3fb, 0x03000000UL | value << 16, SDC_PWM_CTRL);
        return;
@@ -1486,12 +1490,12 @@ static int mx3fb_probe(struct platform_device *pdev)
                goto ersdc0;
        }
 
+       mx3fb->backlight_level = 255;
+
        ret = init_fb_chan(mx3fb, to_idmac_chan(chan));
        if (ret < 0)
                goto eisdc0;
 
-       mx3fb->backlight_level = 255;
-
        return 0;
 
 eisdc0:
-- 
1.6.3.3



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] mx3fb: some debug and initialisation fixes.
  2010-01-20 14:57 [PATCH] mx3fb: some debug and initialisation fixes Alberto Panizzo
@ 2010-01-26 21:46 ` Andrew Morton
  2010-01-27  9:45   ` Alberto Panizzo
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2010-01-26 21:46 UTC (permalink / raw)
  To: Alberto Panizzo
  Cc: Sascha linux-arm, Guennadi Liakhovetski, Dan Williams,
	Krzysztof Helt, linux-kernel

On Wed, 20 Jan 2010 15:57:14 +0100
Alberto Panizzo <maramaopercheseimorto@gmail.com> wrote:

> Fix the kernel oops when dev_dbg is called with mx3_fbi->txd == NULL
> 
> Fix the late initialisation of mx3fb->backlight_level.
> If not, in the chain of function started by init_fb_chan(), in __blank() call 
> sdc_set_brightness(mx3fb, mx3fb->backlight_level) that will shut down
> the CONTRAST PWM output. 

I guess these aren't the biggest bugs we ever had but I tagged the
patch for backporting into 2.6.32.x anyway - the fixes are prety
obvious.

Your email client replaces tabs with spaces.  I fixed that up, but
please do prevent it from happening next time. 
Documentation/email-clients.txt has some Evolution tips.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mx3fb: some debug and initialisation fixes.
  2010-01-26 21:46 ` Andrew Morton
@ 2010-01-27  9:45   ` Alberto Panizzo
  0 siblings, 0 replies; 8+ messages in thread
From: Alberto Panizzo @ 2010-01-27  9:45 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Sascha linux-arm, Guennadi Liakhovetski, Dan Williams,
	Krzysztof Helt, linux-kernel

On mar, 2010-01-26 at 13:46 -0800, Andrew Morton wrote:
> On Wed, 20 Jan 2010 15:57:14 +0100
> Alberto Panizzo <maramaopercheseimorto@gmail.com> wrote:
> 
> > Fix the kernel oops when dev_dbg is called with mx3_fbi->txd == NULL
> > 
> > Fix the late initialisation of mx3fb->backlight_level.
> > If not, in the chain of function started by init_fb_chan(), in __blank() call 
> > sdc_set_brightness(mx3fb, mx3fb->backlight_level) that will shut down
> > the CONTRAST PWM output. 
> 
> I guess these aren't the biggest bugs we ever had but I tagged the
> patch for backporting into 2.6.32.x anyway - the fixes are prety
> obvious.

Yes, apart of the debug part, the late initialisation of 
mx3fb->backlight_level prevent screen switch-on on boot in my development
board. So for me (and for all hardware that make use of the CONTRAST PWM to
control the brightness) is important.

> 
> Your email client replaces tabs with spaces.  I fixed that up, but
> please do prevent it from happening next time. 
> Documentation/email-clients.txt has some Evolution tips.
> 

The Evolution client lose tabs in copy/past between mails....
I'll take more care on this in future.

Thanks!

Alberto!



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-01-27  9:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20 14:57 [PATCH] mx3fb: some debug and initialisation fixes Alberto Panizzo
2010-01-26 21:46 ` Andrew Morton
2010-01-27  9:45   ` Alberto Panizzo
  -- strict thread matches above, loose matches on Subject: below --
2009-12-18 16:04 Alberto Panizzo
2009-12-20 16:45 ` Guennadi Liakhovetski
2010-01-20 11:12   ` Alberto Panizzo
2010-01-20 11:54     ` Mark Brown
2010-01-20 14:43       ` Alberto Panizzo

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.