Re: Handling of bounce buffers by rh_call_control

From: David Brownell
Date: Wed Dec 17 2003 - 21:35:30 EST



| > - u8 *ubuf = urb->transfer_buffer;
| > + u8 *ubuf = (u8 *) urb->transfer_dma;
| > int len = 0;
| > | > ...
| > memcpy (ubuf, bufp, len);
| | Which is why that particular patch is wrong: "ubuf" is a dma address,
| not expected to work for memcpy().

But the existing code most certainly does use it with memcpy. I'm
looking at test11-mm1 source, but the last memcpy line he noted is most
definitely in the existing source.

As in, "ubuf is NOW a dma address ... it wasn't one before that patch,
it was a regular kernel mappped address. Otherwise memcpy() would
never have worked. Changing it would break more typical kernels, with
no need for bounce buffering.

The right fix is just to bypass the DMA mapping for root hubs,
as in that 2.6 patch from Russell that I mentioned. It's the
unmap that was causing trouble, since it clobbered the data
which memcpy() had just stored into that buffer.

- Dave




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/