From 4b6cb2c61a2fcf0652636345c83a0abed7fdbe5e Mon Sep 17 00:00:00 2001 From: marius Date: Sat, 18 Sep 2010 08:20:36 +0000 Subject: [PATCH] MFC: r212620 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. git-svn-id: svn://svn.freebsd.org/base/stable/8@212816 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/sparc64/sparc64/iommu.c | 3 --- sys/sun4v/sun4v/hviommu.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/sys/sparc64/sparc64/iommu.c b/sys/sparc64/sparc64/iommu.c index 9d31303c6..a638e526d 100644 --- a/sys/sparc64/sparc64/iommu.c +++ b/sys/sparc64/sparc64/iommu.c @@ -874,9 +874,6 @@ iommu_dvmamap_create(bus_dma_tag_t dt, int flags, bus_dmamap_t *mapp) */ 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); diff --git a/sys/sun4v/sun4v/hviommu.c b/sys/sun4v/sun4v/hviommu.c index 5724d752c..78076e372 100644 --- a/sys/sun4v/sun4v/hviommu.c +++ b/sys/sun4v/sun4v/hviommu.c @@ -513,9 +513,6 @@ hviommu_dvmamap_create(bus_dma_tag_t dt, int flags, bus_dmamap_t *mapp) */ 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); -- 2.45.0