Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Dec 2013 03:49:46 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r259093 - stable/9/sys/arm/arm
Message-ID:  <201312080349.rB83nkhC070669@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sun Dec  8 03:49:45 2013
New Revision: 259093
URL: http://svnweb.freebsd.org/changeset/base/259093

Log:
  MFC:
  
  r246881 | ian | 2013-02-16 13:43:16 -0700 (Sat, 16 Feb 2013) | 4 lines
  
  In _bus_dmamap_addseg(), the return value must be zero for error, or the size
  actually added to the segment (possibly smaller than the requested size if
  boundary crossings had to be avoided).
  
  This fixes NFS root on Atmel platforms, and likely others.

Modified:
  stable/9/sys/arm/arm/busdma_machdep.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/sys/   (props changed)

Modified: stable/9/sys/arm/arm/busdma_machdep.c
==============================================================================
--- stable/9/sys/arm/arm/busdma_machdep.c	Sun Dec  8 03:02:44 2013	(r259092)
+++ stable/9/sys/arm/arm/busdma_machdep.c	Sun Dec  8 03:49:45 2013	(r259093)
@@ -913,7 +913,7 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, b
 		dr = _bus_dma_inrange(dmat->ranges, dmat->_nranges,
 		    curaddr);
 		if (dr == NULL)
-			return (EINVAL);
+			return (0);
 		/*
 		 * In a valid DMA range.  Translate the physical
 		 * memory address to an address in the DMA window.
@@ -935,12 +935,12 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, b
 		segs[seg].ds_len += sgsize;
 	} else {
 		if (++seg >= dmat->nsegments)
-			return (EFBIG);
+			return (0);
 		segs[seg].ds_addr = curaddr;
 		segs[seg].ds_len = sgsize;
 	}
 	*segp = seg;
-	return (0);
+	return (sgsize);
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312080349.rB83nkhC070669>