Re: problem with blk_queue_bounce_limit()

David Mosberger
2003-06-07T06:51:37Z

>>>>> On Fri, 06 Jun 2003 23:44:01 -0700 (PDT), "David S. Miller" <davem@redhat.com> said:

DaveM> But on an IOMMU system, we could end up mapping to the same
DaveM> bogus DMA address.

Ah, yes, just changing the buffer address doesn't guarantee a
different bus address. I missed that.

DaveM> So we have to solve this problem by keeping the existng bad
DaveM> mapping, doing a new DMA mapping, then trowing away the old
DaveM> one.

But you're creating a new mapping for the old buffer. What if you had
a DMA API implementation which consolidates multiple mapping attempts
of the same buffer into a single mapping entry (along with a reference
count)? That would break the workaround.

Isn't the proper fix to (a) get a new buffer, (b) create a mapping for
the new buffer, (c) destroy the mapping for the old buffer. That
should guarantee a different bus address, no matter what the
DMA-mapping implementation.

Plus then you don't have to rely on PCI_DMA_BUS_IS_PHYS.

--david