From: Andrew Morton <akpm@linux-foundation.org>
To: Thiago Galesi <thiagogalesi@gmail.com>
Cc: linux-fbdev-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fb: Remove use of lock_kernel / unlock_kernel in fbmem
Date: Tue, 15 Apr 2008 22:17:07 -0700 [thread overview]
Message-ID: <20080415221707.82da3d42.akpm@linux-foundation.org> (raw)
In-Reply-To: <200804131150.07601.thiagogalesi@gmail.com>
On Sun, 13 Apr 2008 11:50:07 -0300 Thiago Galesi <thiagogalesi@gmail.com> wrote:
> This patch removes lock_kernel(), unlock_kernel() usage in fbmem.c and replaces it with a mutex
It isn't that simple, alas.
vfs_ioctl() runs lock_kernel() prior to calling fb_ioctl(), so the
lock_kernel()s in fb_compat_ioctl() are actually providing exclusion against
fb_ioctl(). Your patch would break that.
A suitable fix might be to do
__fb_ioctl(...)
{
<copy fb_ioctl() into here>
}
fb_ioctl(...)
{
mutex_lock(&info->hwlock);
__fb_ioctl(...);
mutex_unlock(&info->hwlock);
}
and then change fb_compat_ioctl() to call __fb_ioctl(). All the other
callers of fb_ioctl() would need to be reviewed - see if they need to take
the mutex then call __fb_ioctl(), or they might be OK as they are, calling
fb_ioctl().
Then we can switch fb_fops over to
.ioctl = NULL,
.unlocked_ioctl = fb_ioctl,
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
next prev parent reply other threads:[~2008-04-16 5:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-13 14:50 [PATCH] fb: Remove use of lock_kernel / unlock_kernel in fbmem Thiago Galesi
2008-04-16 5:17 ` Andrew Morton [this message]
2008-04-16 23:00 ` Thiago Galesi
2008-04-18 17:41 ` Andres Salomon
2008-04-19 0:54 ` Thiago Galesi
2008-04-19 1:45 ` Andres Salomon
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=20080415221707.82da3d42.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=thiagogalesi@gmail.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 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).