linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Bruno Prémont" <bonbons@linux-vserver.org>
To: Jaya Kumar <jayakumar.lkml@gmail.com>
Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jiri Kosina <jkosina@suse.cz>
Subject: Re: Deadlock between fbcon and fb_defio?
Date: Mon, 10 May 2010 06:00:47 +0000	[thread overview]
Message-ID: <20100510080047.5adade6f@pluto.restena.lu> (raw)
In-Reply-To: <AANLkTik0EkPYKdnhrpF7yK6eXIrHMsNYrzSC6tyeBR0P@mail.gmail.com>

Hi Jaya,

On Mon, 10 May 2010 08:00:51 Jaya Kumar wrote:
> On Mon, May 10, 2010 at 12:49 AM, Bruno Prémont
> <bonbons@linux-vserver.org> wrote:
> >
> > Fix crash if we are the first framebuffer loaded as in that case
> > fbcon wants to flush framebuffer at the end of fb registration,
> > before we have setup fb_defio.
> 
> Bruno,
> 
> Please help me understand, how does this scenario occur? I'm
> interpreting what you've written above to mean that fbcon is accessing
> the framebuffer before you've called defio_init()? Is that correct?

That was the original state as I called defio_init after
register_framebuffer() and defio_cleanup() before
unregister_framebuffer(), the opposite to the typical sequence you
detail below. Fixed by the patch.

My deadlock issue, after applying the patch, is during set_par() when I
replace the framebuffer and wish defio to start using the new page(s)
instead of the old one(s).

I want to make sure that I won't be accessing the old framebuffer after
freeing it and also that defio monitors the new framebuffer.

For that reason I defio_cleanup(), replace framebuffer, defio_init().
All of this happens while do_fb_ioctl() holds lock on fb_info and
console_sem.

Thanks,
Bruno

> The typical defio use sequence is: defio_init(),
> register_framebuffer() and the typical remove sequence is in the
> reverse order unregister_framebuffer(), defio_cleanup(). So, I don't
> see how fbcon is accessing the framebuffer either before
> register_framebuffer() completes (at which point defio init is already
> done) or after unregister_framebuffer() completes.
> 
> Thanks,
> jaya

  reply	other threads:[~2010-05-10  6:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-09 16:49 Deadlock between fbcon and fb_defio? Bruno Prémont
2010-05-10  0:00 ` Jaya Kumar
2010-05-10  6:00   ` Bruno Prémont [this message]
2010-05-26 19:58     ` vfree() and mmap()ed framebuffer with defio (Was: Deadlock Bruno Prémont
2010-05-30 11:09       ` [Patch] HID: Fix PicoLCD to allow it to run fbcon and handle unplug Bruno Prémont
2010-06-23 10:32         ` [Patch] HID: Fix PicoLCD to allow it to run fbcon and handle Bruno Prémont
2010-06-24  8:54           ` Jiri Kosina
2010-06-28 20:26             ` [Patch 0/4] " Bruno Prémont
2010-06-28 20:29               ` [PATCH 1/4] HID: picolcd: fix deferred_io init/cleanup to Bruno Prémont
2010-06-30  1:52                 ` Jaya Kumar
2010-06-30  5:56                   ` Bruno Prémont
2010-06-30 20:36                     ` [PATCH 1/4 - adjusted changelog] HID: picolcd: fix deferred_io Bruno Prémont
2010-07-11 20:58                       ` Jiri Kosina
2010-07-12  6:17                         ` Bruno Prémont
2010-07-12 16:05                           ` Jiri Kosina
2010-07-12 16:09                             ` Jiri Kosina
2010-06-28 20:30               ` [PATCH 2/4] HID: picolcd: Add minimal palette required by fbcon on Bruno Prémont
2010-06-28 20:31               ` [PATCH 3/4] HID: picolcd: do not reallocate memory on depth change Bruno Prémont
2010-06-28 20:33               ` [PATCH 4/4] HID: picolcd: implement refcounting of framebuffer Bruno Prémont
2010-06-28 21:26                 ` Bernie Thompson
2010-06-29 20:42                 ` Bruno Prémont
2010-06-30 15:41                 ` Bernie Thompson
2010-06-30  9:28               ` [Patch 0/4] HID: Fix PicoLCD to allow it to run fbcon and handle Jiri Kosina

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=20100510080047.5adade6f@pluto.restena.lu \
    --to=bonbons@linux-vserver.org \
    --cc=jayakumar.lkml@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).