From owner-freebsd-questions@FreeBSD.ORG Sat Oct 14 20:32:25 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3852716A407 for ; Sat, 14 Oct 2006 20:32:25 +0000 (UTC) (envelope-from usleepless@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9927243D75 for ; Sat, 14 Oct 2006 20:32:22 +0000 (GMT) (envelope-from usleepless@gmail.com) Received: by nf-out-0910.google.com with SMTP id p77so1382070nfc for ; Sat, 14 Oct 2006 13:32:21 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=m2EoZomwPvwF7VASIUNn9gTaOvJuqjxrZE1s72xUB6UFZc1bveaFTOIOaMxqU0kEMvjKDIL+/Vl6xSTLs996qP+hh5NMuPqc5jHTuAX4PvlBpOSR23RF6anqqTb6Ivx8mvAfYRmDcAcTdy9AO5ZESFmfp3M1lUwtoW6YAT2vfE8= Received: by 10.78.182.20 with SMTP id e20mr5496027huf; Sat, 14 Oct 2006 13:32:21 -0700 (PDT) Received: by 10.78.124.12 with HTTP; Sat, 14 Oct 2006 13:32:21 -0700 (PDT) Message-ID: Date: Sat, 14 Oct 2006 22:32:21 +0200 From: usleepless@gmail.com To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Removing Giant from a driver X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2006 20:32:25 -0000 Hi All, i have been tweaking the pvr250 driver to support pvr150s/500s. now i want to remove Giant from the code. problem is, i am not sure what to do. i have created a mutex which replaces the spltty and splx calls. but this crashes my box :-) the original code looks like this: /* * Allocate a DMA tag for the scatter / gather list. */ error = bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, CXM_SG_BUFFERS * sizeof(struct cxm_sg_entry), 1, BUS_SPACE_MAXSIZE_32BIT, 0, #if __FreeBSD_version >= 501102 busdma_lock_mutex, &Giant, #endif &sc->enc_sg.dmat); what should it look like? and how will i prevent the interrupt routine from interfering with userland operations? can i place a "mtx_lock()" call in the interrupt routine? is there a howto somewhere? regards, usleep