Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Feb 2009 09:57:10 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        Patrick =?iso-8859-1?q?Lamaizi=E8re?= <patfbsd@davenulle.org>
Subject:   Re: bus_dmamem_alloc() and BUS_DMA_WAITOK
Message-ID:  <200902130957.10997.jhb@freebsd.org>
In-Reply-To: <20090213152205.0eccafb0@baby-jane.lamaiziere.net>
References:  <20090213152205.0eccafb0@baby-jane.lamaiziere.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902130957.10997.jhb>