From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 15 09:05:01 2006 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 40F6816A412 for ; Sun, 15 Oct 2006 09:05:01 +0000 (UTC) (envelope-from usleepless@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.185]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E9A443D58 for ; Sun, 15 Oct 2006 09:05:00 +0000 (GMT) (envelope-from usleepless@gmail.com) Received: by nf-out-0910.google.com with SMTP id p77so1485151nfc for ; Sun, 15 Oct 2006 02:04:59 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=cfRvc4l8HV8fJhK2IfABVy0DvXrTU5ZOLbxBJmVJCavSSpHz7lI3wlK1Ey3Wp1EpdW6C5xlGAaxWTXkxmypx6kU+1D/aWzGp42IRaiLxBmiCuiy/vAT4rycyHp7+1lbbo9l8mJ6Pyw4uVCgiDCJM7Nt3revJ6TjJ/rU30vAaUlU= Received: by 10.78.134.12 with SMTP id h12mr6182020hud; Sun, 15 Oct 2006 02:04:59 -0700 (PDT) Received: by 10.78.124.12 with HTTP; Sun, 15 Oct 2006 02:04:58 -0700 (PDT) Message-ID: Date: Sun, 15 Oct 2006 11:04:58 +0200 From: usleepless@gmail.com To: freebsd-hackers@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Subject: Fwd: Removing Giant from a 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: Sun, 15 Oct 2006 09:05:01 -0000 ---------- Forwarded message ---------- From: usleepless@gmail.com Date: Oct 14, 2006 10:32 PM Subject: Removing Giant from a driver To: freebsd-questions@freebsd.org 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