Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262584AbTFGGvo (ORCPT ); Sat, 7 Jun 2003 02:51:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262593AbTFGGvn (ORCPT ); Sat, 7 Jun 2003 02:51:43 -0400 Received: from pizda.ninka.net ([216.101.162.242]:16259 "EHLO pizda.ninka.net") by vger.kernel.org with ESMTP id S262584AbTFGGvm (ORCPT ); Sat, 7 Jun 2003 02:51:42 -0400 Date: Sat, 07 Jun 2003 00:02:33 -0700 (PDT) Message-Id: <20030607.000233.115915549.davem@redhat.com> To: wa@almesberger.net Cc: chas@cmf.nrl.navy.mil, linux-kernel@vger.kernel.org Subject: Re: [PATCH][ATM] use rtnl_{lock,unlock} during device operations (take 2) From: "David S. Miller" In-Reply-To: <20030606221100.L3232@almesberger.net> References: <20030606211005.H3232@almesberger.net> <200306070057.h570vtsG003449@ginger.cmf.nrl.navy.mil> <20030606221100.L3232@almesberger.net> X-FalunGong: Information control. X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1205 Lines: 30 From: Werner Almesberger Date: Fri, 6 Jun 2003 22:11:00 -0300 When a driver's "close" function returns, the driver must have released all externally visible resources (e.g. VPI/VCI) that belong to the VCC, and ideally all invisible resources (e.g. buffers). There must be no more calls to "push". In return, the stack must not make any other calls for that VCC after invoking "close". This is exactly how netdevice's WON'T be acting anymore. All netdevice objects are allocated dynamically, and unregister just means "disconnect" not "free". It marks the device as dead, and NULLs out all the callbacks in the netdevice struct. Any further attempt to use the device (via some PROCFS file I/O or whatever) will just error out. So we return long before all references go away, and the final netdevice reference put does the de-allocation of the netdevice struct. Totally asynchronous, and it just works. - 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/