From owner-freebsd-doc@FreeBSD.ORG Fri Jun 13 02:00:32 2003 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6998A37B401 for ; Fri, 13 Jun 2003 02:00:32 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B91D43FAF for ; Fri, 13 Jun 2003 02:00:31 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h5D90VUp029772 for ; Fri, 13 Jun 2003 02:00:31 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h5D90VTl029771; Fri, 13 Jun 2003 02:00:31 -0700 (PDT) Resent-Date: Fri, 13 Jun 2003 02:00:31 -0700 (PDT) Resent-Message-Id: <200306130900.h5D90VTl029771@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, harti@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 212EA37B401 for ; Fri, 13 Jun 2003 01:55:42 -0700 (PDT) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id BBCE243FB1 for ; Fri, 13 Jun 2003 01:55:40 -0700 (PDT) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle.fokus.fraunhofer.de (beagle [193.175.132.100]) h5D8tXd10837 for ; Fri, 13 Jun 2003 10:55:38 +0200 (MEST) Received: from beagle.fokus.fraunhofer.de (localhost [127.0.0.1]) h5D8tI3j006678 for ; Fri, 13 Jun 2003 10:55:33 +0200 (CEST) (envelope-from hbb@beagle.fokus.fraunhofer.de) Received: (from hbb@localhost)h5D8t7SY006677; Fri, 13 Jun 2003 10:55:07 +0200 (CEST) (envelope-from hbb) Message-Id: <200306130855.h5D8t7SY006677@beagle.fokus.fraunhofer.de> Date: Fri, 13 Jun 2003 10:55:07 +0200 (CEST) From: harti@FreeBSD.org To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: docs/53271: the bus_dma man page fails to document alignment restrictions X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: harti@FreeBSD.org List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2003 09:00:32 -0000 >Number: 53271 >Category: docs >Synopsis: the bus_dma man page fails to document alignment restrictions >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: Fri Jun 13 02:00:30 PDT 2003 >Closed-Date: >Last-Modified: >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 #0: Thu Jun 12 11:30:16 CEST 2003 hbb@beagle.fokus.fraunhofer.de:/opt/obj/usr/src/sys/BEAGLE i386 >Description: While it is possible to specify an alignment to the bus_dma_tag_create function this alignment is ignored in many (if not most cases). For i386 it is only effective if the tag is used to allocate memory via bus_dmamem_alloc() and that memory is larger than PAGE_SIZE. For sparc64 the minimum alignment that may be specified seems to be a IO_PAGE_SIZE. Other architectures probably have equivalent restrictions. Many io devices need buffers that are aligned to 4-byte or other boundaries. In these cases specifying an alignment does NOT help. This should be documented as an implementation limitation, because it can cause driver developers much grief searching for the problem. >How-To-Repeat: look at sys/i386/i386/bus_machdep.c, sys/sparc64/sparc64/{bus_machdep,iommu}.c >Fix: Add something like the following to either the paragraph about bus_dma_tag_create or into a BUGS or IMPLEMENTATION NOTES section: The alignment argument to bus_dma_tag_create cannot be used to enforce alignments that are lesser than a PAGE_SIZE. Generally it should be assumed that the argument is ignored by the bus_dma code. >Release-Note: >Audit-Trail: >Unformatted: