freebsd-dev/sys
Rafal Jaworowski 5713ef0ced Eliminate BUS_DMA <-> cache incoherencies in USB transfers.
With write-allocate cache we get into the following scenario:

1. data has been updated in the memory by the USB HC, but
2. D-cache holds an un-flushed value of it
3. when affected cache line is being replaced, the old (un-flushed) value is
flushed and overwrites the newly arrived

This is possible due to how write-allocate works with virtual caches (ARM for
example).

In case of USB transfers it leads to fatal tags discrepancies in umass(4)
operation, which look like the following:

umass0: Invalid CSW: tag 1 should be 2
(probe0:umass-sim0:0:0:0): Request completed with CAM_REQ_CMP_ERR
(probe0:umass-sim0:0:0:0): Retrying Command
umass0: Invalid CSW: tag 1 should be 3
(probe0:umass-sim0:0:0:0): Request completed with CAM_REQ_CMP_ERR
(probe0:umass-sim0:0:0:0): Retrying Command
umass0: Invalid CSW: tag 1 should be 4
(probe0:umass-sim0:0:0:0): Request completed with CAM_REQ_CMP_ERR
(probe0:umass-sim0:0:0:0): Retrying Command
umass0: Invalid CSW: tag 1 should be 5
(probe0:umass-sim0:0:0:0): Request completed with CAM_REQ_CMP_ERR
(probe0:umass-sim0:0:0:0): Retrying Command
umass0: Invalid CSW: tag 1 should be 6
(probe0:umass-sim0:0:0:0): Request completed with CAM_REQ_CMP_ERR
(probe0:umass-sim0:0:0:0): error 5
(probe0:umass-sim0:0:0:0): Retries Exausted

To eliminate this, a BUS_DMASYNC_PREREAD sync operation is required in
usbd_start_transfer().

Credits for nailing this down go to Grzegorz Bernacki gjb AT semihalf DOT com.

Reviewed by:	imp
Approved by:	cognet (mentor)
2008-02-12 11:03:29 +00:00
..
amd64 Fix Linux mmap with MAP_GROWSDOWN flag. 2008-02-11 19:35:03 +00:00
arm ARM locore cosmetics. 2008-02-05 10:23:42 +00:00
boot Clean up PowerPC loader(8) build config. 2008-02-11 12:30:32 +00:00
bsm Merge OpenBSM 1.0 changes to src/sys/bsm: 2007-10-29 18:47:25 +00:00
cam Correct the kernel config hint in a printf statement. 2008-01-28 18:13:03 +00:00
cddl - Reduce how much ZFS caches by default. This is another change to mitigate 2008-01-24 11:24:16 +00:00
compat Give MEXTADD() another argument to make both void pointers to the 2008-02-01 19:36:27 +00:00
conf The Sun disk label only uses 16-bit fields for cylinders, heads and 2008-02-11 21:40:22 +00:00
contrib - Reduce how much ZFS caches by default. This is another change to mitigate 2008-01-24 11:24:16 +00:00
crypto Make test00 compilable again. 2008-01-15 18:34:47 +00:00
ddb Use dump_write() instead of direct calls to di->dumper() in textdumps. 2008-01-31 16:22:14 +00:00
dev Eliminate BUS_DMA <-> cache incoherencies in USB transfers. 2008-02-12 11:03:29 +00:00
fs Clean up coda_pathconf() slightly while debugging a problem there. 2008-02-11 00:01:45 +00:00
gdb Add kdb_cpu_sync_icache(), intended to synchronize instruction 2007-06-09 21:55:17 +00:00
geom Unbreak build, size_t is larger on 64bit platforms. 2008-02-11 09:20:01 +00:00
gnu Cleanup lockmgr interface and exported KPI: 2008-01-24 12:34:30 +00:00
i4b Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
i386 Fix Linux mmap with MAP_GROWSDOWN flag. 2008-02-11 19:35:03 +00:00
ia64 Allocate a stack for thread0 and switch to it before calling 2008-02-04 02:21:33 +00:00
isa Use cpu_spinwait() (i.e., "pause") when spinning on rdtsc during DELAY(). 2008-01-17 18:59:38 +00:00
kern Add support for displaying a process' current working directory, root 2008-02-09 05:16:26 +00:00
libkern Do not use __XSCALE__ to detect if clz is available, use _ARM_ARCH_5 instead. 2007-10-13 12:05:36 +00:00
modules Hook geom_lvm(4) up to the build. 2008-02-11 03:10:40 +00:00
net Add comment that bpfread() has multi-threading issues. 2008-02-02 20:35:05 +00:00
net80211 - Correctly handle ALTQ in ieee80211_deliver_data() 2008-02-03 12:00:03 +00:00
netatalk Annotate two possible bugs in a comment: (1) we allocate and explicitly 2007-11-20 18:50:54 +00:00
netatm Disconnect netatm from the build as it is not MPSAFE and relies on 2007-07-14 21:49:24 +00:00
netgraph Use rtalloc1() instead of rtalloc_ign(). It returns a locked 2008-02-07 11:10:17 +00:00
netinet If the vhid already present, return EEXIST instead of 2008-02-07 13:18:59 +00:00
netinet6 Rather than passing around a cached 'priv', pass in an ucred to 2008-02-02 14:11:31 +00:00
netipsec Rather than passing around a cached 'priv', pass in an ucred to 2008-02-02 14:11:31 +00:00
netipx Make tcpstates[] static, and make sure TCPSTATES is defined before 2007-07-30 11:06:42 +00:00
netnatm s/destory/destroy/ (except for the code in contrib/). 2007-04-16 12:31:35 +00:00
netncp Cleanup lockmgr interface and exported KPI: 2008-01-24 12:34:30 +00:00
netsmb Cleanup lockmgr interface and exported KPI: 2008-01-24 12:34:30 +00:00
nfs
nfs4client Conver all explicit instances to VOP_ISLOCKED(arg, NULL) into 2008-02-08 21:45:47 +00:00
nfsclient Switch the default NFS mount mode from UDP to TCP. UDP mounts are a 2008-02-11 23:23:21 +00:00
nfsserver Use nfsrv_destroycache() only once, else it crashes the server. 2008-01-18 17:03:36 +00:00
opencrypto Make ftruncate a 'struct file' operation rather than a vnode operation. 2008-01-07 20:05:19 +00:00
pc98 Add COMPAT_FREEBSD7 and enable it in configs that have COMPAT_FREEBSD6. 2008-01-07 21:40:11 +00:00
pccard
pci Give MEXTADD() another argument to make both void pointers to the 2008-02-01 19:36:27 +00:00
powerpc One of my powerbooks has this chip in it.. 2008-01-26 05:11:09 +00:00
rpc Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which 2007-08-06 14:26:03 +00:00
security Make sure that the termid type is initialized to AU_IPv4 by default. 2008-01-28 17:33:46 +00:00
sparc64 The Sun disk label only uses 16-bit fields for cylinders, heads and 2008-02-11 21:40:22 +00:00
sun4v Add a wrapper function that bound checks writes to the dump device. 2008-01-28 19:04:07 +00:00
sys - Revert last ehci.c change 2008-02-10 15:50:21 +00:00
tools Introduce a standalone shell script for embedding MFS image. 2008-02-05 10:46:30 +00:00
ufs Cleanup lockmgr interface and exported KPI: 2008-01-24 12:34:30 +00:00
vm VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in 2008-01-13 14:44:15 +00:00
Makefile o Add boot, gdb, nfsserver and opencrypto dirs to CSCOPEDIRS; sort. 2008-01-23 08:50:34 +00:00