From owner-freebsd-current@FreeBSD.ORG Thu Aug 9 16:05:52 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D77611065672 for ; Thu, 9 Aug 2012 16:05:52 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-gg0-f182.google.com (mail-gg0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 894858FC16 for ; Thu, 9 Aug 2012 16:05:52 +0000 (UTC) Received: by ggnk4 with SMTP id k4so744180ggn.13 for ; Thu, 09 Aug 2012 09:05:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=Dp0C+QrDeuCNXHQ9RK9mtt21pDKtmMza4rom/Y7XyRQ=; b=LiCL4ymeOBtS+UIAp5Bv2kQiAMX1aHJbI3TKjVrEwFgSjm7uMFBMJOT0ntJcBWKFBd jjSddDcUlNkYlndUU7cVRFjgc/tweouX7GXFV3x0GxFoXoIfw9Qwf9cdnslRMZxLDcAs Vv9+x0Sp9KSmpEkO6ePzqyfGiXQ1ee2D3wv4f6q4ZcW1OHdFCQFkUiCTLAHFBiwh0V9Q 1PrGq6wmBoHqchJE03eGBJIOhpOxyABJlOpnijpw+6KplNTYEgXVrLTh6byY2u4a3kf+ mjv8XEtmCcL2bXg1N6HAqZZaCUGUaixyhrTuqSi2puloHnfYiGtgpTZ0igyUQpP11Wtf 53XQ== Received: by 10.60.10.6 with SMTP id e6mr36396795oeb.45.1344528351446; Thu, 09 Aug 2012 09:05:51 -0700 (PDT) Received: from [10.30.101.53] ([209.117.142.2]) by mx.google.com with ESMTPS id g8sm1143019obz.16.2012.08.09.09.05.49 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Aug 2012 09:05:50 -0700 (PDT) Sender: Warner Losh Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <201208081941.17860.hselasky@c2i.net> Date: Thu, 9 Aug 2012 10:05:47 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20120801160323.GN2676@deviant.kiev.zoral.com.ua> <201208081827.53824.hselasky@c2i.net> <201208081941.17860.hselasky@c2i.net> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQlsFRh+pJsZRb8/ROMshVkW+Fm88JmVR+/+sympYW1ENHCx/QzI1fUlgFPbpWnhMOv4Ep02 Cc: Konstantin Belousov , Ed Schouten , freebsd-current@freebsd.org Subject: Re: ttydev_cdevsw has no d_purge X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2012 16:05:52 -0000 On Aug 8, 2012, at 11:41 AM, Hans Petter Selasky wrote: > On Wednesday 08 August 2012 19:24:18 Ed Schouten wrote: >>> Ed: I would really like to see a custom argument for the tsw_free(), >>> because it only needs to know the unit number, and the xsc for UCOM = is >>> freed when this is called and cannot be referred. Is it possible to = have >>> a separate "void *" for the tsw_free() function? Is this something = which >>> you can implement? >>=20 >> We could extend the TTY code to allow the softc to be changed, e.g. >> tty_set_softc(). This function could be called right before calling >> tty_rel_gone(). Still, I would prefer it if these kind of things = would >=20 > Are you sure that the new softc won't be used in any callbacks when=20 > tty_rel_gone() is called, except for tsw_free() ? >=20 >> not be part of the API. Is there really no way the deallocation of = the >> softc can be delayed until tsw_free() is called? >=20 > Yes, but that is inconvenient. We use the automatically allocated = softc given=20 > to the driver by newbus. When detach() returns, the softc is freed. = Then we=20 > need to block in detach, and that is causing the problem! I thought the detach protocol was such that you shouldn't return from = detach until all dangling references were gone. you could use tsw_free = to wake up the detach sleeper, no? Warner