public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anssi Hannula <anssi@mandriva.org>
To: Andrew Morton <akpm@osdl.org>
Cc: dtor_core@ameritech.net, linux-joystick@atrey.karlin.mff.cuni.cz,
	linux-kernel@vger.kernel.org
Subject: Re: [patch 03/11] input: new force feedback interface
Date: Thu, 25 May 2006 19:35:12 +0300	[thread overview]
Message-ID: <4475DCC0.6000507@mandriva.org> (raw)
In-Reply-To: <20060525075257.3f2963a9.akpm@osdl.org>

Andrew Morton wrote:
> Anssi Hannula <anssi@mandriva.org> wrote:
> 
>>>Generally we use file descriptors (and driver-specific state at
>>
>> > file.f_private) to manage things like that.  But I'd imagine that we
>> > couldn't retain the existing semantics with any such scheme.
>> > 
>> > A pragmatic approach would be to put a big fat comment in there explaining
>> > how it all works and leave it at that.
>>
>> As I don't see this could break any existing applications, I would very
>> much like to change the behaviour so that the effects are file
>> descriptor specific.
> 
> 
> ooh, that's always risky - we just don't know what people are doing out
> there.  They do the damnedest things.
> 
> Is it possible to implement the new behaviour while retaining the old
> behaviour as well?  And to detect when an app is using the old behaviour
> and to drop a printk("stop doing this")?  So we can kill the old behaviour
> in a year or so?

I *really* don't think any app is trying to do one of the following:
- open another fd to the same device and delete effect created in the
first fd
- open and close another fd to the same device to delete all effects

The latter one doesn't make any sense (the process could just open and
close the first fd), but the former one is possible, though very unlikely.

I count only 6 programs using linux ff, of which 3 are test programs.
None of those messes up with fd's so that they would depend on the old
behaviour. I would change the behaviour, while we still can.

What we could do is allow deleting effects, whether they're owned by the
fd or not. If they aren't, printk() would be issued.

> 
>>What should I use to differentiate the descriptors?
>> Can I just compare the "struct file*"? (it seems to work well, I just
>> modified the code so)
> 
> Depends what you're trying to do.  Different threads in the same process
> can share the same file*'s.

I try to have a coherent behaviour:
- fd1 opened
- fd1: effects 0, 1 are created
- fd2 opened
- fd2: effects 2, 3 are created
- fd2 closed
=> effects 2, 3 get deleted
- fd1 uses effects
- fd1 closed
=> effects 0, 1 get deleted


I will once again give an example how things would go with the old
behaviour:
- fd1 opened
- fd1: effects 0, 1 are created
- fd2 opened
- fd2: effects 2, 3 are created
- fd2 closed
=> effects 0, 1, 2, 3 get deleted
- fd1 uses effects
=> failure
- fd1 closed


(fd1 and fd2 are of the same process and the same device)

-- 
Anssi Hannula


  reply	other threads:[~2006-05-25 16:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-15 21:12 [patch 00/11] input: force feedback updates Anssi Hannula
2006-05-15 21:12 ` [patch 01/11] input: move fixp-arith.h to drivers/input Anssi Hannula
2006-05-15 21:12 ` [patch 02/11] input: fix accuracy of fixp-arith.h Anssi Hannula
2006-05-15 21:12 ` [patch 03/11] input: new force feedback interface Anssi Hannula
2006-05-18  5:20   ` Andrew Morton
2006-05-22 16:10     ` Anssi Hannula
2006-05-24 10:45       ` Anssi Hannula
2006-05-25  0:49         ` Andrew Morton
2006-05-26 16:32           ` Anssi Hannula
2006-05-25  9:00     ` Anssi Hannula
2006-05-25 14:00       ` Andrew Morton
2006-05-25 14:45         ` Anssi Hannula
2006-05-25 14:52           ` Andrew Morton
2006-05-25 16:35             ` Anssi Hannula [this message]
2006-05-15 21:12 ` [patch 04/11] input: adapt hid force feedback drivers for the new interface Anssi Hannula
2006-05-15 21:12 ` [patch 05/11] input: adapt uinput for the new force feedback interface Anssi Hannula
2006-05-15 21:12 ` [patch 06/11] input: adapt iforce driver " Anssi Hannula
2006-05-15 21:12 ` [patch 07/11] input: force feedback driver for PID devices Anssi Hannula
2006-05-15 21:12 ` [patch 08/11] input: force feedback driver for Zeroplus devices Anssi Hannula
2006-05-15 21:12 ` [patch 09/11] input: update documentation of force feedback Anssi Hannula
2006-05-15 21:12 ` [patch 10/11] input: drop the remains of the old ff interface Anssi Hannula
2006-05-15 21:12 ` [patch 11/11] input: drop the old PID driver Anssi Hannula
2006-05-17 13:30 ` [patch 00/11] input: force feedback updates Dmitry Torokhov

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=4475DCC0.6000507@mandriva.org \
    --to=anssi@mandriva.org \
    --cc=akpm@osdl.org \
    --cc=dtor_core@ameritech.net \
    --cc=linux-joystick@atrey.karlin.mff.cuni.cz \
    --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