All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-fbdev@vger.kernel.org
Subject: Re: locking inconsistency, when calling fb_ops::fb_release()
Date: Mon, 13 Sep 2010 15:30:43 +0000	[thread overview]
Message-ID: <20100913153043.GC24329@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.64.1009130854280.24398@axis700.grange>

On Mon, Sep 13, 2010 at 09:17:04AM +0200, Guennadi Liakhovetski wrote:
> Hi
> 
> I do not know, whether this can be a problem for any existing driver, but 
> such an inconsistency seems like a bad idea to me anyway. The struct 
> fb_ops::fb_release() method can be called in following ways:
> 
> fbmem.c::fb_release() under the info->lock mutex (file.close("/dev/fbX") 
> 							operation)
> fbcon.c::con2fb_release_oldinfo() under console semaphore
> fbcon.c::fbcon_exit() from
> 	fbcon_deinit() from
> 		vt.c::vc_deallocate() under console semaphore (has 
> 			WARN_CONSOLE_UNLOCKED())
> 		bind_con_driver() under console semaphore
> 	fb_console_exit() under console semaphore
> 
> I.e., it can be either called within an acquire_console_sem() / 
> release_console_sem() block, or within a mutex_lock(&info->lock) / 
> mutex_unlock(&info->lock) block, which looks inconsistent to me.
> 
> The problem, this is causing me is, that I'd like to call the framebuffer 
> notifier chain from my driver's fb_release() method.

Why would you need/want to do this?  If you don't do that, all should be
fine, right?

thanks,

greg k-h

  reply	other threads:[~2010-09-13 15:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-13  7:17 locking inconsistency, when calling fb_ops::fb_release() Guennadi Liakhovetski
2010-09-13 15:30 ` Greg KH [this message]
2010-09-13 16:06 ` Guennadi Liakhovetski
2010-09-13 17:13 ` Greg KH
2010-09-14 13:08 ` Guennadi Liakhovetski

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=20100913153043.GC24329@suse.de \
    --to=gregkh@suse.de \
    --cc=linux-fbdev@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 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.