[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: bus_dmamem_alloc() and BUS_DMA_WAITOK
From:       John Baldwin <jhb () freebsd ! org>
Date:       2009-02-13 14:57:10
Message-ID: 200902130957.10997.jhb () freebsd ! org
[Download RAW message or body]

On Friday 13 February 2009 9:22:05 am Patrick Lamaizière wrote:
> Hello,
> 
> 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 
forever (or a long time) until a 32k region is freed.

-- 
John Baldwin
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic