Verify that all segments in the loaded segment list are back to back
with regard to the page offset, and not only the two first ones.
This commit is contained in:
parent
998e1ef11f
commit
288edd19d7
@ -472,18 +472,23 @@ usb_pc_common_mem_cb(void *arg, bus_dma_segment_t *segs,
|
|||||||
pc->page_offset_buf = rem;
|
pc->page_offset_buf = rem;
|
||||||
pc->page_offset_end += rem;
|
pc->page_offset_end += rem;
|
||||||
#ifdef USB_DEBUG
|
#ifdef USB_DEBUG
|
||||||
if (nseg > 1 &&
|
if (nseg > 1) {
|
||||||
((segs->ds_addr + segs->ds_len) & (USB_PAGE_SIZE - 1)) !=
|
int x;
|
||||||
((segs + 1)->ds_addr & (USB_PAGE_SIZE - 1))) {
|
|
||||||
|
for (x = 0; x != nseg - 1; x++) {
|
||||||
|
if (((segs[x].ds_addr + segs[x].ds_len) & (USB_PAGE_SIZE - 1)) ==
|
||||||
|
((segs[x + 1].ds_addr & (USB_PAGE_SIZE - 1))))
|
||||||
|
continue;
|
||||||
/*
|
/*
|
||||||
* This check verifies there is no page offset hole
|
* This check verifies there is no page offset
|
||||||
* between the first and second segment. See the
|
* hole between any of the segments. See the
|
||||||
* BUS_DMA_KEEP_PG_OFFSET flag.
|
* BUS_DMA_KEEP_PG_OFFSET flag.
|
||||||
*/
|
*/
|
||||||
DPRINTFN(0, "Page offset was not preserved\n");
|
DPRINTFN(0, "Page offset was not preserved\n");
|
||||||
error = 1;
|
error = 1;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
while (pc->ismultiseg) {
|
while (pc->ismultiseg) {
|
||||||
off += USB_PAGE_SIZE;
|
off += USB_PAGE_SIZE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user