From owner-cvs-src@FreeBSD.ORG Wed Feb 21 20:27:39 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A6BA716A488; Wed, 21 Feb 2007 20:27:39 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id 56CA513C4BA; Wed, 21 Feb 2007 20:27:39 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.14.0/8.14.0) with ESMTP id l1LKRcWk001972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Feb 2007 15:27:38 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id l1LKRTjF020486; Wed, 21 Feb 2007 15:27:29 -0500 (EST) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17884.43824.818734.325125@grasshopper.cs.duke.edu> Date: Wed, 21 Feb 2007 15:27:28 -0500 (EST) To: Luigi Rizzo In-Reply-To: <20070221102702.B91427@xorpc.icir.org> References: <200702151721.l1FHLWno019525@repoman.freebsd.org> <20070221121302.A20229@grasshopper.cs.duke.edu> <20070221092332.A90766@xorpc.icir.org> <17884.34420.308021.423716@grasshopper.cs.duke.edu> <20070221101005.A91427@xorpc.icir.org> <17884.36324.991314.70617@grasshopper.cs.duke.edu> <20070221102702.B91427@xorpc.icir.org> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Cc: cvs-src@FreeBSD.org, Luigi Rizzo , src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/arm/xscale/ixp425 ixp425_npe.c src/sys/dev/ipw if_ipw.c if_ipwvar.h src/sys/dev/isp isp_freebsd.h src/sys/dev/iwi if_iwi.c if_iwivar.h src/sys/dev/mxge if_mxge.c src/sys/kern subr_firmware.c src/sys/sys firmware.h src/sys/tools fw_stub.awk X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Feb 2007 20:27:39 -0000 Luigi Rizzo writes: > On Wed, Feb 21, 2007 at 01:22:28PM -0500, Andrew Gallatin wrote: > > > > Luigi Rizzo writes: > ,,, > > > i am not sure i follow you here... > > > Of course when you drop the lock you risk that the underlying > > > data structure is manipulated (or in the worst case freed), > > > but usually you can avoid this with something like > > > > > > > > > sc->flags |= LEAVE_ME_ALONE > > > UNLOCK > > > > Sorry, I hadn't noticed that iwi set a flag like that. I was > > not everywhere. i am sure that there are parts that are not protected. That's the kind of thing I'm afraid of. > > I just think it would be safer, and less hacky to be allowed to hold > > a driver mutex while potentially sleeping in the firmware code (and in > > i am no expert here, but in some sense, the mutex argument to msleep > is there exactly for that reason. Maybe the problem is that sometimes > you need more than one mutex ? The problem is that msleep() drops the mutex when you sleep, so the lock is dropped while you sleep, and you are back to flag hacks. > In any case i think we should relabel the thread or potentially > interested people will miss the content being misled by the subject! I'm satisfied to let it drop, now that I've vented a little :) Back on, more or less, track: Can you commit my hack to the kernel linker which lets firmware(9) work from attach() without deadlock? Thanks, Drew