From brandt@fokus.fraunhofer.de  Thu Jun 26 01:30:07 2003
Return-Path: <brandt@fokus.fraunhofer.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1C22937B404
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 26 Jun 2003 01:30:07 -0700 (PDT)
Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 88FD74403D
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 26 Jun 2003 01:30:05 -0700 (PDT)
	(envelope-from brandt@fokus.fraunhofer.de)
Received: from beagle.fokus.fraunhofer.de (beagle [193.175.132.100])
	by mailhub.fokus.fraunhofer.de (8.11.6p2/8.11.6) with ESMTP id h5Q8U4Q24678
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 26 Jun 2003 10:30:04 +0200 (MEST)
Received: from beagle.fokus.fraunhofer.de (localhost [127.0.0.1])
	by beagle.fokus.fraunhofer.de (8.12.9/8.12.9) with ESMTP id h5Q8U4bR074556
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 26 Jun 2003 10:30:04 +0200 (CEST)
	(envelope-from hbb@beagle.fokus.fraunhofer.de)
Received: (from hbb@localhost)
	by beagle.fokus.fraunhofer.de (8.12.9/8.12.9/Submit) id h5Q8U397074555;
	Thu, 26 Jun 2003 10:30:03 +0200 (CEST)
	(envelope-from hbb)
Message-Id: <200306260830.h5Q8U397074555@beagle.fokus.fraunhofer.de>
Date: Thu, 26 Jun 2003 10:30:03 +0200 (CEST)
From: Hartmut Brandt <harti@freebsd.org>
Reply-To: Hartmut Brandt <harti@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: bus_dma(9) incorrectly documents BUS_DMA_ALLOCNOW
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         53751
>Category:       docs
>Synopsis:       bus_dma(9) incorrectly documents BUS_DMA_ALLOCNOW
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 26 01:30:09 PDT 2003
>Closed-Date:    
>Last-Modified:  Tue Jul 31 05:52:45 GMT 2007
>Originator:     Hartmut Brandt
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
Fraunhofer Fokus
>Environment:
System: FreeBSD beagle.fokus.fraunhofer.de 5.1-CURRENT FreeBSD 5.1-CURRENT #7: Thu Jun 19 12:19:27 CEST 2003 hbb@beagle.fokus.fraunhofer.de:/opt/obj/usr/src/sys/BEAGLE i386


	
>Description:

The explanaition of the BUS_DMA_ALLOCNOW flag to bus_dma_tag_create is
correct only if that tag is used for just one map. This is because
bus_dma_tag_create tries to allocate bounce pages based only on the size of
the desired mapping. It cannot now how many maps will be created using that
tag. One example where it doesn't work are network drivers which will use on
tag to map all the receive or transmit buffers. Each mapped buffer may require
its own bounce buffer, but tag_create has allocated only space for one map.
Therefor bus_dmamap_load_mbuf will return either EINPROGRESS (if called without
BUS_DMA_NOWAIT) or ENOMEM when it fails to allocate bounce buffers.
	
>How-To-Repeat:

Look at the code in i386/i386/busdma_machdep.c

	
>Fix:

Either document a short version of the above or completly overhaul the bus dma
stuff :-)

	


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-doc->hmp 
Responsible-Changed-By: bms 
Responsible-Changed-When: Sat Jul 3 06:42:17 GMT 2004 
Responsible-Changed-Why:  
This is hmp's manor 

http://www.freebsd.org/cgi/query-pr.cgi?pr=53751 
Responsible-Changed-From-To: hmp->freebsd-doc 
Responsible-Changed-By: gnats 
Responsible-Changed-When: Tue Jul 31 05:52:32 UTC 2007 
Responsible-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=53751 
>Unformatted:
