From owner-freebsd-questions@FreeBSD.ORG Sat Oct 14 12:12:45 2006 Return-Path: X-Original-To: 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 496B216A403 for ; Sat, 14 Oct 2006 12:12:45 +0000 (UTC) (envelope-from usleepless@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by mx1.FreeBSD.org (Postfix) with ESMTP id 93A4243D6B for ; Sat, 14 Oct 2006 12:12:44 +0000 (GMT) (envelope-from usleepless@gmail.com) Received: by nf-out-0910.google.com with SMTP id p77so1281916nfc for ; Sat, 14 Oct 2006 05:12:43 -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=Y5g9B6LBZ0PiPXzAcZifFKVNBckM2cn+q8cOkCafwWeta43Kmp/CMlQD6VbUNiUx79GVYggnelRiU75D6Si8ZIqxbDMaCzMdQ2ysZIj+U323Vzu9xoRE/844I+SBmUAX0rBKxpXmIE+XltBBAI8+6+JLccWBVH/wK0IHbyp97CI= Received: by 10.78.200.20 with SMTP id x20mr5131923huf; Sat, 14 Oct 2006 05:12:43 -0700 (PDT) Received: by 10.78.124.12 with HTTP; Sat, 14 Oct 2006 05:12:43 -0700 (PDT) Message-ID: Date: Sat, 14 Oct 2006 14:12:43 +0200 From: usleepless@gmail.com To: questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: 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 12:12:45 -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