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.
This commit is contained in:
parent
50850cf4b9
commit
6fb9ae8f43
1 changed files with 3 additions and 4 deletions
|
@ -2171,11 +2171,10 @@ epgettd(Ctlr *ctlr, Qio *io, int flags, void *a, int count, int maxpkt)
|
||||||
td->buff = (*ctlr->dmaalloc)(count+0x1000);
|
td->buff = (*ctlr->dmaalloc)(count+0x1000);
|
||||||
td->data = (uchar*)ROUND((uintptr)td->buff, 0x1000);
|
td->data = (uchar*)ROUND((uintptr)td->buff, 0x1000);
|
||||||
}
|
}
|
||||||
if(a != nil && count > 0){
|
if(a != nil && count > 0)
|
||||||
memmove(td->data, a, count);
|
memmove(td->data, a, count);
|
||||||
if(ctlr->dmaflush != nil && td->buff != nil)
|
if(ctlr->dmaflush != nil && td->buff != nil)
|
||||||
(*ctlr->dmaflush)(1, td->data, count);
|
(*ctlr->dmaflush)(1, td->data, count);
|
||||||
}
|
|
||||||
pa = PADDR(td->data);
|
pa = PADDR(td->data);
|
||||||
for(i = 0; i < nelem(td->buffer); i++){
|
for(i = 0; i < nelem(td->buffer); i++){
|
||||||
td->buffer[i] = pa;
|
td->buffer[i] = pa;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue