lkml.org 
[lkml]   [2010]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 12/19] swiotlb-xen: Make 'xen_swiotlb_map_sg_attrs' work.
Date
Refer to "swiotlb-xen: Make 'xen_swiotlb_[map|unmap]_page' work." for
details why we want to use our own address translation mechanism.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
lib/swiotlb-xen.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/swiotlb-xen.c b/lib/swiotlb-xen.c
index ca6c537..d457f7e 100644
--- a/lib/swiotlb-xen.c
+++ b/lib/swiotlb-xen.c
@@ -343,10 +343,11 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl,

for_each_sg(sgl, sg, nelems, i) {
phys_addr_t paddr = sg_phys(sg);
- dma_addr_t dev_addr = phys_to_dma(hwdev, paddr);
+ dma_addr_t dev_addr = xen_phys_to_bus(hwdev, paddr);

if (swiotlb_force ||
- !dma_capable(hwdev, dev_addr, sg->length)) {
+ !dma_capable(hwdev, dev_addr, sg->length) ||
+ range_straddles_page_boundary(paddr, sg->length)) {
void *map = xen_map_single(hwdev, sg_phys(sg),
sg->length, dir);
if (!map) {
--
1.7.0.1


\
 
 \ /
  Last update: 2010-06-22 21:51    [W:0.068 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site