diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-09-05 10:14:19 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-09-05 10:14:19 +0200 |
commit | 6fb9ae8f4356f6b17f15894491d6339245dcd8ec (patch) | |
tree | 352df4ae3a6ee24e1151ec491cb0e4e9c009cbb2 | |
parent | 50850cf4b93d0a1b3a543a260c367dbf5f3209c1 (diff) |
usbehci: clean cache unconditionally before handing a buffer to the hardware
even in the read case, we need to clean the cache
so the cpu will not flush out old changes while
the hardware updates the buffer.
-rw-r--r-- | sys/src/9/port/usbehci.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/src/9/port/usbehci.c b/sys/src/9/port/usbehci.c index d9fd74d15..aab982b3c 100644 --- a/sys/src/9/port/usbehci.c +++ b/sys/src/9/port/usbehci.c @@ -2171,11 +2171,10 @@ epgettd(Ctlr *ctlr, Qio *io, int flags, void *a, int count, int maxpkt) td->buff = (*ctlr->dmaalloc)(count+0x1000); td->data = (uchar*)ROUND((uintptr)td->buff, 0x1000); } - if(a != nil && count > 0){ + if(a != nil && count > 0) memmove(td->data, a, count); - if(ctlr->dmaflush != nil && td->buff != nil) - (*ctlr->dmaflush)(1, td->data, count); - } + if(ctlr->dmaflush != nil && td->buff != nil) + (*ctlr->dmaflush)(1, td->data, count); pa = PADDR(td->data); for(i = 0; i < nelem(td->buffer); i++){ td->buffer[i] = pa; |