linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Andrew Morton <akpm@linux-foundation.org>,
	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	linux-input@vger.kernel.org
Subject: Re: linux-next: Tree for July 30
Date: Thu, 31 Jul 2008 16:05:45 -0400	[thread overview]
Message-ID: <20080731155701.ZZRA012@mailhub.coreip.homeip.net> (raw)
In-Reply-To: <alpine.LFD.1.10.0807311235350.3277@nehalem.linux-foundation.org>

On Thu, Jul 31, 2008 at 12:44:04PM -0700, Linus Torvalds wrote:
> 
> 
> On Thu, 31 Jul 2008, Dmitry Torokhov wrote:
> > 
> > Does it have to be papered over in the kernel though?
> 
> Yes. It's how we have worked. Asking people to upgrade big core programs 
> is not reasonable.
>
> Think of it this way: we absolutely _want_ people to run the latest 
> kernel. We want it for their own sake (security etc fixes), but we want it 
> even more for *our* own sake (testing, fixes etc).
> 
> And if we want to encourage people to upgrade their kernel very 
> aggressively (and we absolutely do!), then that means that we have to also 
> make sure it doesn't require them upgrading anything else.

Sometimes we do need to upgrade userspace though. Can we make
Documentation/Changes more prominent? Maybe have it published on
kernel.org?

> 
> > We can only guarantee one thing - ABI. And that is kept intact. But I
> > literally have no idea if a kernel breaks a random program out there
> > that happens to have a bug.
> 
> There are gray areas, yes. For example, timing changes do mean that a new 
> kenrel can easily break a program that used to work. We cannot handle 
> _everyting_. 
> 
> But when the ABI in question is some very specific one, that some 
> important program uses (even if the "uses" is "misuses") then it really 
> isn't a gray area any more.
> 
> And quite frankly, the ABI was apparently pretty bad to begin with, if 
> user space got an array back but didn't get to specify the size. So you 
> may want to say that user space was broken, but on the other hand, it's 
> equally arguable that the ABI was crap.

It did specify the size. Something 448 more bytes than it allocated:

    unsigned long evbits[NBITS(KEY_MAX)];

    /* Check for ABS_X, ABS_Y, ABS_PRESSURE and BTN_TOOL_FINGER */

    SYSCALL(ret = ioctl(fd, EVIOCGBIT(0, KEY_MAX), evbits));

So we allocate 64 bytes on stack and then as kernel to fill it with
511 bytes worth of data.

> 
> (Which is something you can pretty much take for granted with ioctl's, of 
> course. DO NOT CHANGE IOCTL'S. EVER!)
> 
> > We have 3 options now:
> > 
> > 1. Never change KEY_MAX and dont add any new key definitions.
> > 2. Introduce a new ioctl and have all wel-behaving programs rewritten
> >    to support it.
> > 3. Fix userspace driver (patch is available).
> 
> You ignore the obvious choice, which is how we _usually_ do it:
> 
>  - help fix up the userspace driver regardless

In progress.
> 
>  - a year down the line, maybe breakage will be a non-issue.
>

Around when 2.6.28 is released, right? ;)
 
>  - but at least _think_ about the fact that yes, most ioctl interfaces are 
>    pure and utter sh*t, and the problem was probably not so much the user 
>    space driver as the crap interface to begin with!
> 
> and discuss whether KEY_MAX really needs to be changed that much. I 
> suspect that the change was done without even realizing just how painful 
> it was, and that if you look at the original reason for it with the 
> hindsight of knowing that it was painful, maybe it wasn't that critical to 
> do it after all?
>

We do need more keycodes. People are coming wioth more and more. The
patch following the one in question adds about 10 new kodes for remote
controls/phones. And we will get more.

-- 
Dmitry

  reply	other threads:[~2008-07-31 20:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080730170635.f737ffe9.sfr@canb.auug.org.au>
2008-07-31  6:10 ` linux-next: Tree for July 30 Andrew Morton
2008-07-31 14:07   ` Dmitry Torokhov
2008-07-31 15:36     ` Bartlomiej Zolnierkiewicz
2008-07-31 15:56       ` Dmitry Torokhov
2008-07-31 17:44         ` Andrew Morton
2008-07-31 18:17           ` Dmitry Torokhov
2008-07-31 18:26             ` Andrew Morton
2008-07-31 18:34               ` Dmitry Torokhov
2008-07-31 18:55                 ` Andrew Morton
2008-07-31 19:03                   ` Dmitry Torokhov
2008-07-31 19:20                   ` Hugh Dickins
2008-07-31 18:48             ` Rafael J. Wysocki
2008-07-31 18:54               ` Dmitry Torokhov
2008-07-31 19:10                 ` Linus Torvalds
2008-07-31 19:24                   ` Dmitry Torokhov
2008-07-31 19:42                     ` Dmitry Torokhov
2008-07-31 20:10                       ` Andrew Morton
2008-08-07 18:11                         ` Dmitry Torokhov
2008-08-07 18:50                           ` Andrew Morton
2008-08-07 19:06                             ` Dmitry Torokhov
2008-08-07 18:55                           ` Rafael J. Wysocki
2008-08-01 19:12                       ` Linus Torvalds
2008-08-01 19:23                         ` Dmitry Torokhov
2008-08-01 19:26                           ` Linus Torvalds
2008-07-31 19:44                     ` Linus Torvalds
2008-07-31 20:05                       ` Dmitry Torokhov [this message]
2008-07-31 20:16                         ` Linus Torvalds
2008-07-31 20:28                           ` Linus Torvalds
2008-07-31 20:39                             ` Dmitry Torokhov
2008-07-31 20:28                           ` Dmitry Torokhov
2008-07-31 19:13                 ` Andrew Morton
2008-07-31 19:57                 ` Rafael J. Wysocki
2008-08-04  5:47   ` Stephen Rothwell

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=20080731155701.ZZRA012@mailhub.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bzolnier@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@linux-foundation.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).