Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123210
b: refs/heads/master
c: 2e5b2b8
h: refs/heads/master
v: v3
  • Loading branch information
Ian Campbell authored and Ingo Molnar committed Dec 17, 2008
1 parent db33803 commit b8dd148
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ef9b189352f2eb78f14e52996f4780a523b04a49
refs/heads/master: 2e5b2b86b65fe36bb8401e5608eb0b7603aa1cab
33 changes: 28 additions & 5 deletions trunk/lib/swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,32 @@ static dma_addr_t swiotlb_sg_to_bus(struct scatterlist *sg)
return swiotlb_phys_to_bus(page_to_phys(sg_page(sg)) + sg->offset);
}

static void swiotlb_print_info(unsigned long bytes)
{
phys_addr_t pstart, pend;
dma_addr_t bstart, bend;

pstart = virt_to_phys(io_tlb_start);
pend = virt_to_phys(io_tlb_end);

bstart = swiotlb_phys_to_bus(pstart);
bend = swiotlb_phys_to_bus(pend);

printk(KERN_INFO "Placing %luMB software IO TLB between %p - %p\n",
bytes >> 20, io_tlb_start, io_tlb_end);
if (pstart != bstart || pend != bend)
printk(KERN_INFO "software IO TLB at phys %#llx - %#llx"
" bus %#llx - %#llx\n",
(unsigned long long)pstart,
(unsigned long long)pend,
(unsigned long long)bstart,
(unsigned long long)bend);
else
printk(KERN_INFO "software IO TLB at phys %#llx - %#llx\n",
(unsigned long long)pstart,
(unsigned long long)pend);
}

/*
* Statically reserve bounce buffer space and initialize bounce buffer data
* structures for the software IO TLB used to implement the DMA API.
Expand Down Expand Up @@ -198,8 +224,7 @@ swiotlb_init_with_default_size(size_t default_size)
if (!io_tlb_overflow_buffer)
panic("Cannot allocate SWIOTLB overflow buffer!\n");

printk(KERN_INFO "Placing software IO TLB between 0x%lx - 0x%lx\n",
swiotlb_virt_to_bus(io_tlb_start), swiotlb_virt_to_bus(io_tlb_end));
swiotlb_print_info(bytes);
}

void __init
Expand Down Expand Up @@ -279,9 +304,7 @@ swiotlb_late_init_with_default_size(size_t default_size)
if (!io_tlb_overflow_buffer)
goto cleanup4;

printk(KERN_INFO "Placing %luMB software IO TLB between 0x%lx - "
"0x%lx\n", bytes >> 20,
swiotlb_virt_to_bus(io_tlb_start), swiotlb_virt_to_bus(io_tlb_end));
swiotlb_print_info(bytes);

return 0;

Expand Down

0 comments on commit b8dd148

Please sign in to comment.