From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 1 22:16:07 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F3FC816A41F for ; Tue, 1 Nov 2005 22:16:06 +0000 (GMT) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id ED43D43D45 for ; Tue, 1 Nov 2005 22:16:00 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [10.251.23.117]) ([10.251.23.117]) by a50.ironport.com with ESMTP; 01 Nov 2005 14:16:01 -0800 X-IronPort-Anti-Spam-Filtered: true Message-ID: <4367E920.1020001@elischer.org> Date: Tue, 01 Nov 2005 14:16:00 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.11) Gecko/20050727 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dinesh Nair References: <4360B8EE.4070605@alphaque.com> <4360DD7B.20900@samsco.org> <4361044B.50807@alphaque.com> <20051027.205250.55834228.imp@bsdimp.com> <4361E3E0.4090409@alphaque.com> <43676121.4030801@alphaque.com> <436791ED.8010808@samsco.org> <4367AA8D.3060506@alphaque.com> <4367BBDB.7020005@elischer.org> <4367C07C.1040900@alphaque.com> <4367C726.8070405@samsco.org> <4367CCBA.9040506@alphaque.com> In-Reply-To: <4367CCBA.9040506@alphaque.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Scott Long Subject: Re: locking in a device driver 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: Tue, 01 Nov 2005 22:16:07 -0000 Dinesh Nair wrote: > > On 11/02/05 03:51 Scott Long said the following: > >> INTR_TYPE_TTY and spltty > > [..snipped..] > >> You'll also want to use an spl in the top half of the pseudo driver to >> cover where the pointers are read and changed. > > > thanx a bunch. i'll rewrite the portions affected based on yours and > julian's suggestions and report back on how it went. this has been a > very educating experience for me. except for selecting a TYPE, the bottom half shouldn't need any locking. It's already at splimp() (or spltty()) only code that can be run on behalf of the user, or from some other initiator (such as the clock) needs the spl.. also, why do you need a pseudo device AND a device? The device driver can do all the things you have suggested on its own.