From owner-freebsd-current Wed Jan 3 20:29:56 2001 From owner-freebsd-current@FreeBSD.ORG Wed Jan 3 20:29:54 2001 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from aslan.scsiguy.com (aslan.scsiguy.com [63.229.232.106]) by hub.freebsd.org (Postfix) with ESMTP id 5DF7237B400; Wed, 3 Jan 2001 20:29:53 -0800 (PST) Received: from scsiguy.com (localhost [127.0.0.1]) by aslan.scsiguy.com (8.11.0/8.9.3) with ESMTP id f044Tqs12960; Wed, 3 Jan 2001 21:29:52 -0700 (MST) (envelope-from gibbs@scsiguy.com) Message-Id: <200101040429.f044Tqs12960@aslan.scsiguy.com> X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 Cc: John Baldwin , Jonathan Chen , imp@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: Cardbus woes In-Reply-To: Your message of "Wed, 03 Jan 2001 21:13:26 MST." <200101040413.f044DQs12669@aslan.scsiguy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 03 Jan 2001 21:29:52 -0700 From: "Justin T. Gibbs" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >It seems to me that having a single thread per-softc gives you this >protection without requiring any locks. Other than having to aquire >Giant at thread starup (as most code below us is not thread safe yet), >I don't see any other locking requirements. I take that back. In pccbb_detach, you need a mechanism to ensure that you are no-longer executing in your interrupt handler prior to destroying the softc. What you really want on detach (not only for pccbb, but in general), is a way to kill your ithread via bus_teardown_intr. Since we only provide a single ithread per shareable interrupt source, this wouldn't quite work, but you get the general idea. Can anyone think of another general "synchronization method" for a case where the second event may never happen again? Even if you check in the detach routine to see if an interrupt is pending in hardware for your device, this won't tell you if your interrupt thread has already been dispatched but the interrupt source has gone away (card was removed, so interrupt line is dead). Hmmm. -- Justin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message