From owner-freebsd-current Wed Nov 22 16:58:36 2000 Delivered-To: freebsd-current@freebsd.org Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by hub.freebsd.org (Postfix) with ESMTP id 6AF6C37B4CF for ; Wed, 22 Nov 2000 16:58:33 -0800 (PST) Received: from curve.dellroad.org (curve.dellroad.org [10.1.1.30]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id QAA69058 for ; Wed, 22 Nov 2000 16:58:32 -0800 (PST) Received: (from archie@localhost) by curve.dellroad.org (8.11.0/8.11.0) id eAN0wWI62818 for freebsd-current@freebsd.org; Wed, 22 Nov 2000 16:58:32 -0800 (PST) (envelope-from archie) From: Archie Cobbs Message-Id: <200011230058.eAN0wWI62818@curve.dellroad.org> Subject: how to mutex'ify a device driver To: freebsd-current@freebsd.org Date: Wed, 22 Nov 2000 16:58:32 -0800 (PST) X-Mailer: ELM [version 2.4ME+ PL82 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG As a relatively simple exercise in -current kernel programming, I'm planning to mutex'ify the ichsmb(4) device driver (this is a relatively simple driver that currently uses splhigh()). I'd appreciate some feedback if what I'm doing is the right thing. The plan is to give each instance of the device a mutex. This mutex will be grabbed by both the top level code (when programming the chip to do something or reading the results) and the interrupt code (when servicing an interrupt). So far so good.. but what I don't understand is what happens if the interrupt thread has to block on the mutex? It seems like all other devices sharing the same interrupt (and therefore thread) could be indefinitely blocked from servicing their IRQ's. Or is it just assumed that the top half will never hold the mutex for a "long" time? Thanks, -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message