From: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
To: "Anssi Hannula" <anssi.hannula@gmail.com>
Cc: linux-joystick@atrey.karlin.mff.cuni.cz,
linux-kernel@vger.kernel.org, "Andrew Morton" <akpm@osdl.org>
Subject: Re: [patch 03/12] input: new force feedback interface
Date: Tue, 6 Jun 2006 08:45:14 -0400 [thread overview]
Message-ID: <d120d5000606060545n5852360ex8993d8c6f6c922e4@mail.gmail.com> (raw)
In-Reply-To: <448565BA.2070805@gmail.com>
On 6/6/06, Anssi Hannula <anssi.hannula@gmail.com> wrote:
> Dmitry Torokhov wrote:
> > On Monday 05 June 2006 17:11, Anssi Hannula wrote:
> >
> >>Dmitry Torokhov wrote:
> >>
> >>>On 5/30/06, Anssi Hannula <anssi.hannula@gmail.com> wrote:
> >>>>--- linux-2.6.17-rc4-git12.orig/drivers/input/input.c 2006-05-27
> >>>>02:28:57.000000000 +0300
> >>>>+++ linux-2.6.17-rc4-git12/drivers/input/input.c 2006-05-27
> >>>>02:38:35.000000000 +0300
> >>>>@@ -733,6 +733,17 @@ static void input_dev_release(struct cla
> >>>> {
> >>>> struct input_dev *dev = to_input_dev(class_dev);
> >>>>
> >>>>+ if (dev->ff) {
> >>>>+ struct ff_device *ff = dev->ff;
> >>>>+ clear_bit(EV_FF, dev->evbit);
> >>>>+ mutex_lock(&dev->ff_lock);
> >>>>+ del_timer_sync(&ff->timer);
> >>>
> >>>
> >>>This is too late. We need to stop timer when device gets unregistered.
> >>
> >>And what if driver has called input_allocate_device(),
> >>input_ff_allocate(), input_ff_register(), but then decides to abort and
> >>calls input_dev_release()? input_unregister_device() would not get
> >>called at all.
> >>
> >
> >
> > Right, but if device was never registered there is no device node so noone
> > could start the timer and deleting it is a noop. Hmm, I think even better
> > place would be to stop ff timer when device is closed (i.e. when last user
> > closes file handle).
> >
>
> Hmm... actually, they are stopped in flush(), and IIRC that is always
> called before deleting input_dev.
>
flush is called when you close one file handle. If there are more than
one process opened event device you only want to stop timer when they
all closed ther handles, not when the first one did.
> >
> >>>Clearing FF bits is pointless here as device is about to disappear;
> >>>locking is also not needed because we are guaranteed to be the last
> >>>user of the device structure.
> >>
> >>True, if that guarantee really exists.
> >>
> > Yes, this is guaranteed.
> >
>
> So, now you guarantee it, but it isn't really so? ;)
>
Hmm, I thought I could guarantee it, but not yet ;)
> When we remove locking, timer_del, clear_bit, all that is left is
> kfree() and I guess that has to still be run in the input_dev_release().
>
Yes.
--
Dmitry
next prev parent reply other threads:[~2006-06-06 12:45 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-30 10:57 [patch 00/12] input: force feedback updates, third time Anssi Hannula
2006-05-30 10:57 ` [patch 01/12] input: move fixp-arith.h to drivers/input Anssi Hannula
2006-05-30 10:57 ` [patch 02/12] input: fix accuracy of fixp-arith.h Anssi Hannula
2006-05-30 10:57 ` [patch 03/12] input: new force feedback interface Anssi Hannula
2006-05-31 5:21 ` Randy.Dunlap
2006-05-31 10:13 ` Anssi Hannula
2006-06-01 19:02 ` input: return -ENOSYS for registering functions when ff is disabled Anssi Hannula
2006-06-01 19:07 ` input: fix comments and blank lines in new ff code Anssi Hannula
2006-06-01 19:52 ` Randy.Dunlap
2006-06-01 20:03 ` Anssi Hannula
2006-06-01 20:09 ` Randy.Dunlap
2006-06-01 20:47 ` Anssi Hannula
2006-06-01 21:33 ` Randy.Dunlap
2006-06-01 22:16 ` Anssi Hannula
2006-06-01 22:31 ` Randy.Dunlap
2006-06-02 17:44 ` [patch] input: fix function name in a comment Anssi Hannula
2006-06-05 18:52 ` [patch 03/12] input: new force feedback interface Dmitry Torokhov
2006-06-05 21:11 ` Anssi Hannula
2006-06-06 2:02 ` Dmitry Torokhov
2006-06-06 11:23 ` Anssi Hannula
2006-06-06 12:45 ` Dmitry Torokhov [this message]
2006-06-06 13:11 ` Anssi Hannula
2006-06-19 20:09 ` Anssi Hannula
2006-05-30 10:57 ` [patch 04/12] input: adapt hid force feedback drivers for the new interface Anssi Hannula
2006-05-30 10:57 ` [patch 05/12] input: adapt uinput for the new force feedback interface Anssi Hannula
2006-05-30 10:57 ` [patch 06/12] input: adapt iforce driver " Anssi Hannula
2006-05-30 10:57 ` [patch 07/12] input: force feedback driver for PID devices Anssi Hannula
2006-05-30 10:57 ` [patch 08/12] input: force feedback driver for Zeroplus devices Anssi Hannula
2006-05-30 10:57 ` [patch 09/12] input: update documentation of force feedback Anssi Hannula
2006-05-30 10:57 ` [patch 10/12] input: drop the remains of the old ff interface Anssi Hannula
2006-05-30 10:57 ` [patch 11/12] input: drop the old PID driver Anssi Hannula
2006-05-30 10:57 ` [patch 12/12] input: use -ENOSPC instead of -ENOMEM in iforce when device full Anssi Hannula
2006-05-31 5:02 ` Randy.Dunlap
2006-05-31 10:04 ` Anssi Hannula
2006-05-31 15:15 ` Randy.Dunlap
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=d120d5000606060545n5852360ex8993d8c6f6c922e4@mail.gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=akpm@osdl.org \
--cc=anssi.hannula@gmail.com \
--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
all inboxes | Powered by JetHome®