Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754196AbYCaWli (ORCPT ); Mon, 31 Mar 2008 18:41:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752521AbYCaWl3 (ORCPT ); Mon, 31 Mar 2008 18:41:29 -0400 Received: from charybdis-ext.suse.de ([195.135.221.2]:36403 "EHLO emea5-mh.id5.novell.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752138AbYCaWl2 (ORCPT ); Mon, 31 Mar 2008 18:41:28 -0400 Subject: Re: [PATCH] evdev: Release eventual input device grabs when getting disconnected From: Kay Sievers To: Jiri Kosina Cc: Greg KH , Dmitry Torokhov , Linus Torvalds , Bj?rn Steinbrink , Arjan van de Ven , Linux Kernel Mailing List , Johannes Berg In-Reply-To: References: <20080330184259.GB21375@atjola.homenet> <200803310215.39414.dtor@insightbb.com> <20080331172813.GA11583@kroah.com> <20080331135653.ZZRA012@mailhub.coreip.homeip.net> <20080331204221.GA19953@kroah.com> Content-Type: text/plain Date: Tue, 01 Apr 2008 00:46:07 +0200 Message-Id: <1207003567.20492.52.camel@lov.site> Mime-Version: 1.0 X-Mailer: Evolution 2.22.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1446 Lines: 33 On Mon, 2008-03-31 at 23:27 +0200, Jiri Kosina wrote: > On Mon, 31 Mar 2008, Greg KH wrote: > > > > Greg, please look at the change again. Before kobject_put(kobj->parent) > > > was done in kobject_cleanup() and so the parent would only be freed when > > > all its children are gone. Now parent is deleted early, even if its > > > children are still referenced by other users. This is lifetime rule > > > change and should really be announced as such. > > Ugh, this was done because of scsi, they required that if you really > > were deleting the parent, you wanted it gone. > > What is the exact meaning of "gone" here please? Gone means, that if you remove a device from sysfs, you drop the implicit reference to the parent device, as this is no longer needed. You are expected to keep a ref to the parent object (same way as to any other used object) if you need to access the data. Removed objects are isolated now, which means that you just pin their data and not their parents. This is the expected behavior and makes it possible to resolve refcount loops (parent ref's child) which could not be released with the implicit parent ref that was only released on object cleanup. Thanks, Kay -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/