From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 20:31:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD0DF106566B; Tue, 14 Sep 2010 20:31:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 904428FC16; Tue, 14 Sep 2010 20:31:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EKV9f2091800; Tue, 14 Sep 2010 20:31:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EKV9mP091797; Tue, 14 Sep 2010 20:31:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009142031.o8EKV9mP091797@svn.freebsd.org> From: Marius Strobl Date: Tue, 14 Sep 2010 20:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212620 - in head/sys: sparc64/sparc64 sun4v/sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 20:31:09 -0000 Author: marius Date: Tue Sep 14 20:31:09 2010 New Revision: 212620 URL: http://svn.freebsd.org/changeset/base/212620 Log: Remove a KASSERT which will also trigger for perfectly valid combinations of small maxsize and "large" (including BUS_SPACE_UNRESTRICTED) nsegments parameters. Generally using a presz of 0 (which indeed might indicate the use of bogus parameters for DMA tag creation) is not fatal, it just means that no additional DVMA space will be preallocated. Modified: head/sys/sparc64/sparc64/iommu.c head/sys/sun4v/sun4v/hviommu.c Modified: head/sys/sparc64/sparc64/iommu.c ============================================================================== --- head/sys/sparc64/sparc64/iommu.c Tue Sep 14 19:35:43 2010 (r212619) +++ head/sys/sparc64/sparc64/iommu.c Tue Sep 14 20:31:09 2010 (r212620) @@ -874,9 +874,6 @@ iommu_dvmamap_create(bus_dma_tag_t dt, i */ maxpre = imin(dt->dt_nsegments, IOMMU_MAX_PRE_SEG); presz = dt->dt_maxsize / maxpre; - KASSERT(presz != 0, ("%s: bogus preallocation size , nsegments = %d, " - "maxpre = %d, maxsize = %lu", __func__, dt->dt_nsegments, maxpre, - dt->dt_maxsize)); for (i = 1; i < maxpre && totsz < IOMMU_MAX_PRE; i++) { currsz = round_io_page(ulmin(presz, IOMMU_MAX_PRE - totsz)); error = iommu_dvma_valloc(dt, is, *mapp, currsz); Modified: head/sys/sun4v/sun4v/hviommu.c ============================================================================== --- head/sys/sun4v/sun4v/hviommu.c Tue Sep 14 19:35:43 2010 (r212619) +++ head/sys/sun4v/sun4v/hviommu.c Tue Sep 14 20:31:09 2010 (r212620) @@ -513,9 +513,6 @@ hviommu_dvmamap_create(bus_dma_tag_t dt, */ maxpre = imin(dt->dt_nsegments, IOMMU_MAX_PRE_SEG); presz = dt->dt_maxsize / maxpre; - KASSERT(presz != 0, ("hviommu_dvmamap_create: bogus preallocation size " - ", nsegments = %d, maxpre = %d, maxsize = %lu", dt->dt_nsegments, - maxpre, dt->dt_maxsize)); for (i = 1; i < maxpre && totsz < IOMMU_MAX_PRE; i++) { currsz = round_io_page(ulmin(presz, IOMMU_MAX_PRE - totsz)); error = hviommu_dvma_valloc(dt, him, *mapp, currsz);