Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Nov 2015 12:19:20 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@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: r291251 - stable/9/sys/dev/usb
Message-ID:  <201511241219.tAOCJKXr084907@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Tue Nov 24 12:19:20 2015
New Revision: 291251
URL: https://svnweb.freebsd.org/changeset/base/291251

Log:
  MFC r290326:
  Relax the BUS_DMA_KEEP_PG_OFFSET requirement to allow optimising
  allocation of DMA bounce buffers.
  
  Discussed with:	ian @

Modified:
  stable/9/sys/dev/usb/usb_busdma.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/usb/usb_busdma.c
==============================================================================
--- stable/9/sys/dev/usb/usb_busdma.c	Tue Nov 24 12:17:00 2015	(r291250)
+++ stable/9/sys/dev/usb/usb_busdma.c	Tue Nov 24 12:19:20 2015	(r291251)
@@ -468,9 +468,13 @@ usb_pc_common_mem_cb(void *arg, bus_dma_
 	pc->page_offset_buf = rem;
 	pc->page_offset_end += rem;
 #ifdef USB_DEBUG
-	if (rem != (USB_P2U(pc->buffer) & (USB_PAGE_SIZE - 1))) {
+	if (nseg > 1 &&
+	    ((segs->ds_addr + segs->ds_len) & (USB_PAGE_SIZE - 1)) !=
+	    ((segs + 1)->ds_addr & (USB_PAGE_SIZE - 1))) {
 		/*
-		 * This check verifies that the physical address is correct:
+		 * This check verifies there is no page offset hole
+		 * between the first and second segment. See the
+		 * BUS_DMA_KEEP_PG_OFFSET flag.
 		 */
 		DPRINTFN(0, "Page offset was not preserved\n");
 		error = 1;



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