linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: krzysztof.h1@wp.pl,
	Linux-fbdev-devel <linux-fbdev-devel@lists.sourceforge.net>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	geert@linux-m68k.org, Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>,
	righi.andrea@gmail.com
Subject: Re: [PATCH] add mutex to fbdev for fb_mmap locking
Date: Tue, 2 Jun 2009 12:11:59 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0906021200420.3351@localhost.localdomain> (raw)
In-Reply-To: <alpine.LFD.2.01.0906021154270.3351@localhost.localdomain>



On Tue, 2 Jun 2009, Linus Torvalds wrote:
> 
> I thought we already always copied things to a buffer (for conversion 
> reasons, ie doing the whole "ktermios<->random-user-termios-of-the-day" 
> thing), but I guess I was wrong.

Ahh. We do it in the other direction (ie set_termios), and for some 
limited form of to-user (get_sgttyb, get_tchars etc) but apparently not 
for TCGETS*.

There's a few other odd corners there too. Look at TCGETA - it doesn't get 
the lock at all. Why are TCGETS* and TCGETA so different?

I wonder if we even really need that lock for TCGETS*. We clearly don't do 
it for "struct termio" (TCGETA).

The same imbalance seems to exist for get_termiox vs set_termiox. The 
"set" part does the nice "copy outside the lock", while the "get" part 
copies to user space inside the lock.

And then there is TIOCGSOFTCAR, which is just insane, and apparently gets 
the lock in order to just test _one_ bit (C_CLOCAL). Never mind that if 
something is changing it, we really don't care _which_ case we return, so 
the lock is likely pointless to begin with (can "termios" actually change 
as a pointer?). But then does the user space access with the lock held.

		Linus

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get

  reply	other threads:[~2009-06-02 19:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200905282134.n4SLYNwv027999@imap1.linux-foundation.org>
     [not found] ` <alpine.LFD.2.01.0905290820510.3435@localhost.localdomain>
     [not found]   ` <20090530121128.5f04179d.krzysztof.h1@poczta.fm>
     [not found]     ` <alpine.LFD.2.01.0905300805350.3435@localhost.localdomain>
2009-05-31 14:24       ` [PATCH] add mutex to fbdev for fb_mmap locking Krzysztof Helt
2009-05-31 17:09         ` Linus Torvalds
2009-06-01 20:24           ` Krzysztof Helt
2009-06-01 20:38             ` Linus Torvalds
2009-06-01 20:45               ` Ingo Molnar
2009-06-02 15:09               ` Krzysztof Helt
2009-06-02 18:06               ` Krzysztof Helt
2009-06-02 18:13                 ` Linus Torvalds
2009-06-02 18:52                   ` Alan Cox
2009-06-02 18:56                     ` Linus Torvalds
2009-06-02 19:11                       ` Linus Torvalds [this message]
2009-06-02 19:36                         ` Alan Cox
2009-06-02 19:51                           ` Linus Torvalds

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=alpine.LFD.2.01.0906021200420.3351@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=geert@linux-m68k.org \
    --cc=krzysztof.h1@wp.pl \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=mingo@elte.hu \
    --cc=righi.andrea@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).