Re: [PATCH] evdev: Release eventual input device grabs when getting disconnected

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: Bj?rn Steinbrink <B.Steinbrink@...>, Arjan van de Ven <arjan@...>, Linux Kernel Mailing List <linux-kernel@...>, Johannes Berg <johannes@...>, Jiri Kosina <jkosina@...>, Greg KH <greg@...>
Date: Monday, March 31, 2008 - 2:15 am

Hi Linus,

On Sunday 30 March 2008, Linus Torvalds wrote:

The following commit changed lifetime runes on kobjects breaking input:

commit 0f4dafc0563c6c49e17fe14b3f5f356e4c4b8806
Author: Kay Sievers <kay.sievers@vrfy.org>
Date:   Wed Dec 19 01:40:42 2007 +0100

    Kobject: auto-cleanup on final unref

    We save the current state in the object itself, so we can do proper
    cleanup when the last reference is dropped.

    If the initial reference is dropped, the object will be removed from
    sysfs if needed, if an "add" event was sent, "remove" will be send, and
    the allocated resources are released.

    This allows us to clean up some driver core usage as well as allowing us
    to do other such changes to the rest of the kernel.

    Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Before we dropped reference to kobject's parent only when child kobject
was released (in kobject_cleanup). The changeset above moves the release
to kobject_del() which is way too early in my opinion. The kobject is only
marked for deletion at that time, not really deleted.

I will look how to properly fix evdev and the rest of input interfaces
tomorrow.

-- 
Dmitry
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] evdev: Release eventual input device grabs when ..., Dmitry Torokhov, (Mon Mar 31, 2:15 am)
Re: [PATCH] evdev: Release eventual input device grabs when ..., Benjamin Herrenschmidt, (Mon Mar 31, 7:12 pm)
Re: [PATCH] evdev: Release eventual input device grabs when ..., Benjamin Herrenschmidt, (Mon Mar 31, 9:01 pm)