From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 2 21:14:40 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A2FB1065675 for ; Wed, 2 Nov 2011 21:14:40 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1A1068FC19 for ; Wed, 2 Nov 2011 21:14:39 +0000 (UTC) Received: by qadz32 with SMTP id z32so810484qad.13 for ; Wed, 02 Nov 2011 14:14:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=0KthHb5ldAjhNBis1LyXJNsZaoyC8XpHJVbeosXHnss=; b=ATU4HreiAO9R1NBklP/5kAT9ly5NW58xFthK55/FQvkQE6oFspSNzUwvNKWzpxT78a W4AtlR7MXX/HhwPUUmHSf2c7rv76CQKb0RBgpYxUNcLdATEYuWg010n+aT5z8WESWZnH oGXqtfAGz4QYtoaHrn8RV0diydyt+ZGGg9ti8= MIME-Version: 1.0 Received: by 10.229.47.137 with SMTP id n9mr314056qcf.137.1320268478214; Wed, 02 Nov 2011 14:14:38 -0700 (PDT) Received: by 10.229.231.203 with HTTP; Wed, 2 Nov 2011 14:14:38 -0700 (PDT) In-Reply-To: References: Date: Wed, 2 Nov 2011 14:14:38 -0700 Message-ID: From: Navdeep Parhar To: Garrett Cooper Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Hackers Subject: Re: incorrect parent refcounting in subr_firmware.c? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2011 21:14:40 -0000 On Wed, Nov 2, 2011 at 1:44 PM, Garrett Cooper wrote: > On Wed, Nov 2, 2011 at 12:56 PM, Navdeep Parhar wrote= : >> I built a KLD with multiple firmware images, as shown here: >> >> KMOD=3Dfoo >> FIRMWS=3D foo.bin:foo:1.0.0.0 >> FIRMWS+=3Dbar.bin:bar:1.0.0.0 >> FIRMWS+=3D ... >> .include >> >> "foo" is the parent firmware and a firmware_get(foo) can autoload the >> KLD. =A0"bar" and the rest are available only if the KLD is loaded (by >> whatever means). =A0This is reasonable and works as expected. =A0But if = I >> just get and then put "foo" back, the KLD is not unloaded automatically. >> >> The problem is that a reference is placed on the parent firmware when >> the other firmwares are registered (during module load). =A0I think this >> reference should be placed during firmware_get on the child. >> >> What do people think about the attached patch? =A0It fixes things for me= . > > =A0 =A0It might be a generic problem; here's a similar (not exactly the > same) issue: http://lists.freebsd.org/pipermail/freebsd-hackers/2010-Augu= st/032714.html That seems to be an entirely different issue. My problem is with the way a "parent" firmware is reference counted.