Re: [PATCH] dc395x: Fix support for highmem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2005-04-24 at 02:22 +0200, Guennadi Liakhovetski wrote:
> Thanks for the info. Let me see, if I got you right. Say, we've got an sg 
> with 2 elements: first 2 * PAGE_SIZE long, offset 0, pointing to page #0, 
> second PAGE_SIZE long, offset 0, page #3. Say, dma_map_sg returned 1, so, 
> it mapped all those 3 (physically discontiguous) pages to a contiguous bus 
> address range. And now sg_dma_len() returns 3 * PAGE_SIZE.

Yes, that's true.

>  But, I hope, 
> the .page, .length, and .offset elements stayed unchanged, so, one can 
> still walk elements 0 and 1, calculating a sum of sg[i].length and thus 
> arrive to the required page, right?

This, I'm not entirely sure about.  There are some weird iommu mapping
implementations out there.  The only absolute requirement is that the
map_sg unmap_sg map_sg actually work.  There was some debate over
whether unmap_sg was supposed to return the sg list to its original
form, but x86_64 got beaten up in the argument, so this is true too.

So ... I think the answer to your question is "yes", at least for all
the iommu implementations I know about.  However, nothing in the
published API actually requires this.

What I think all this means is that you can get away with what you're
proposing.  However, the proper route would be to unmap the sglist
before you start feeding the leftovers via pio.

James


-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux