All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Helt <krzysztof.h1@poczta.fm>
To: Jaya Kumar <jayakumar.lkml@gmail.com>
Cc: ymiao3@marvell.com, linux-fbdev-devel@lists.sourceforge.net,
	linux-arm-kernel@lists.arm.linux.org.uk
Subject: Re: [RFC 2.6.26-rc3 7/7] metronomefb: changes to use separate framebuffer
Date: Sat, 7 Jun 2008 10:59:23 +0200	[thread overview]
Message-ID: <20080607105923.281dd6de.krzysztof.h1@poczta.fm> (raw)
In-Reply-To: <1212814166-10313-8-git-send-email-jayakumar.lkml@gmail.com>

On Sat,  7 Jun 2008 00:49:26 -0400
Jaya Kumar <jayakumar.lkml@gmail.com> wrote:

> These changes are used in order to support the use of a separate
> framebuffer provided by the platform device driver. Other changes
> are cleanup to error handling and order of release.
> 
> Signed-off-by: Jaya Kumar <jayakumar.lkml@gmail.com>
> ---
>  drivers/video/metronomefb.c |  209 +++++++++++++++++++++++++------------------
>  include/video/metronomefb.h |   22 ++---
>  2 files changed, 130 insertions(+), 101 deletions(-)
> 
> diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c
> index 8ccd113..b32f4d2 100644
> --- a/drivers/video/metronomefb.c
> +++ b/drivers/video/metronomefb.c

> @@ -710,14 +746,12 @@ err_cmap:
>  err_fb_rel:
>  	framebuffer_release(info);
>  err_free_irq:
> -	board->free_irq(info);
> -err_dma_free:
> -	dma_free_writecombine(&dev->dev, par->metromemsize, par->metromem,
> -				par->metromem_dma);
> +	board->cleanup(par);
>  err_csum_table:
>  	vfree(par->csum_table);
>  err_vfree:
> -	vfree(videomemory);
> +	if (videomemory)
> +		vfree(videomemory);
>  	module_put(board->owner);
>  	return retval;
>  }

One suspicious thing is that framebuffer_release(info)
is called the first in the metronomefb_probe() (in case of failure)
and as the last in the metronomefb_remove() (see below).
It seems to be an error in the _probe function, the fb_info is allocated before
the first vmalloc() so order of error labels is wrong.

Regards,
Krzysztof

> @@ -728,15 +762,15 @@ static int __devexit metronomefb_remove(struct platform_device *dev)
>  
>  	if (info) {
>  		struct metronomefb_par *par = info->par;
> +
> +		unregister_framebuffer(info);
>  		fb_deferred_io_cleanup(info);
> -		dma_free_writecombine(&dev->dev, par->metromemsize,
> -					par->metromem, par->metromem_dma);
>  		fb_dealloc_cmap(&info->cmap);
>  		vfree(par->csum_table);
> -		unregister_framebuffer(info);
>  		vfree((void __force *)info->screen_base);
> -		par->board->free_irq(info);
> +		par->board->cleanup(par);
>  		module_put(par->board->owner);
> +		dev_dbg(&dev->dev, "calling release\n");
>  		framebuffer_release(info);
>  	}
>  	return 0;
> @@ -761,6 +795,9 @@ static void __exit metronomefb_exit(void)
>  	platform_driver_unregister(&metronomefb_driver);
>  }
>  

----------------------------------------------------------------------
Tanie rozmowy!
Sprawdz >>>  http://link.interia.pl/f1e22 


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

      reply	other threads:[~2008-06-07  8:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-07  4:49 [RFC 2.6.26-rc3 0/7] am200epd, pxafb, metronomefb changes v3 Jaya Kumar
2008-06-07  4:49 ` [RFC 2.6.26-rc3 1/7] pxafb: module unloading support Jaya Kumar
2008-06-07  8:35   ` Krzysztof Helt
2008-06-10  6:25   ` Eric Miao
2008-06-10  6:43   ` Lothar Waßmann
2008-06-10  7:44     ` Eric Miao
2008-06-12  4:36       ` Jaya Kumar
2008-06-12  5:25         ` Krzysztof Helt
2008-06-12 10:20           ` Eric Miao
2008-06-12 14:17             ` Jaya Kumar
2008-06-07  4:49 ` [RFC 2.6.26-rc3 2/7] pxafb: add shared framebuffer interface Jaya Kumar
2008-06-07  8:38   ` Krzysztof Helt
2008-06-07  4:49 ` [RFC 2.6.26-rc3 3/7] gumstix: conversion to MFP support and add bluetooth support Jaya Kumar
2008-06-07  4:49 ` [RFC 2.6.26-rc3 4/7] am200epd: move am200epd to mach-pxa Jaya Kumar
2008-06-07  8:40   ` Krzysztof Helt
2008-06-07  4:49 ` [RFC 2.6.26-rc3 5/7] am200epd: convert to shared fb and use gpio api Jaya Kumar
2008-06-07  8:43   ` Krzysztof Helt
2008-06-07  4:49 ` [RFC 2.6.26-rc3 6/7] metronomefb: convert printk to dev_dbg/err messages Jaya Kumar
2008-06-07  8:46   ` Krzysztof Helt
2008-06-07  4:49 ` [RFC 2.6.26-rc3 7/7] metronomefb: changes to use separate framebuffer Jaya Kumar
2008-06-07  8:59   ` Krzysztof Helt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080607105923.281dd6de.krzysztof.h1@poczta.fm \
    --to=krzysztof.h1@poczta.fm \
    --cc=jayakumar.lkml@gmail.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=ymiao3@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.