svn commit: r196381 - in stable/8/sys: . amd64/include/xen
cddl/contrib/opensolaris contrib/dev/acpica contrib/pf
dev/usb dev/xen/xenpci
Rafal Jaworowski
raj at FreeBSD.org
Wed Aug 19 14:48:59 UTC 2009
Author: raj
Date: Wed Aug 19 14:48:59 2009
New Revision: 196381
URL: http://svn.freebsd.org/changeset/base/196381
Log:
MFC r196380
Fix USB cache sync operations for platforms with non-coherent DMA.
- usb_pc_cpu_invalidate() is called between [consecutive] reads from a device,
so a sequence of BUS_DMASYNC_POSTREAD and _PREREAD should be used. Note we
cannot use or'ed shorthand ( _POSTREAD | _PREREAD) for BUS_DMASYNC flags, as
the low level bus dma sync operation is implementation dependent and we
cannot assume the required order of operations to be guaranteed.
- usb_pc_cpu_flush() is called before writing to a device, so
BUS_DMASYNC_PREWRITE should be used.
Submitted by: Grzegorz Bernacki
Reviewed by: HPS, arm@, usb@ ML
Tested by: HPS, Mike Tancsa
Approved by: re (kib)
Obtained from: Semihalf
Modified:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/usb/usb_busdma.c
stable/8/sys/dev/xen/xenpci/ (props changed)
Modified: stable/8/sys/dev/usb/usb_busdma.c
==============================================================================
--- stable/8/sys/dev/usb/usb_busdma.c Wed Aug 19 14:39:08 2009 (r196380)
+++ stable/8/sys/dev/usb/usb_busdma.c Wed Aug 19 14:48:59 2009 (r196381)
@@ -679,8 +679,8 @@ usb_pc_cpu_invalidate(struct usb_page_ca
/* nothing has been loaded into this page cache! */
return;
}
- bus_dmamap_sync(pc->tag, pc->map,
- BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
+ bus_dmamap_sync(pc->tag, pc->map, BUS_DMASYNC_POSTREAD);
+ bus_dmamap_sync(pc->tag, pc->map, BUS_DMASYNC_PREREAD);
}
/*------------------------------------------------------------------------*
@@ -693,8 +693,7 @@ usb_pc_cpu_flush(struct usb_page_cache *
/* nothing has been loaded into this page cache! */
return;
}
- bus_dmamap_sync(pc->tag, pc->map,
- BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
+ bus_dmamap_sync(pc->tag, pc->map, BUS_DMASYNC_PREWRITE);
}
/*------------------------------------------------------------------------*
More information about the svn-src-stable
mailing list