From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 13 15:39:58 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDAB510657CE for ; Fri, 13 Feb 2009 15:39:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8EB078FC14 for ; Fri, 13 Feb 2009 15:39:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 3732746B2D; Fri, 13 Feb 2009 10:39:58 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1DFd49N044500; Fri, 13 Feb 2009 10:39:52 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Fri, 13 Feb 2009 09:57:10 -0500 User-Agent: KMail/1.9.7 References: <20090213152205.0eccafb0@baby-jane.lamaiziere.net> In-Reply-To: <20090213152205.0eccafb0@baby-jane.lamaiziere.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200902130957.10997.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 13 Feb 2009 10:39:52 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8987/Fri Feb 13 05:32:33 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Patrick =?iso-8859-1?q?Lamaizi=E8re?= Subject: Re: bus_dmamem_alloc() and BUS_DMA_WAITOK 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: Fri, 13 Feb 2009 15:40:00 -0000 On Friday 13 February 2009 9:22:05 am Patrick Lamaizi=E8re wrote: > Hello, >=20 > I would like to know if it is safe to use the BUS_DMA_WAITOK flag with > bus_dmamem_alloc(), in the context of the device_attach routine? Many > drivers use BUS_DMA_NOWAIT. Yes, it is ok to use in an attach routine. > I need a 32Ko buffer and on low memory my driver cannot attach > (bus_dmamem_alloc returns ENOMEM). Will BUS_DMA_WAITOK help in this > case? I'm not sure if it will really help, though. You might end up blocking=20 forever (or a long time) until a 32k region is freed. =2D-=20 John Baldwin