]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge branch 'stable/xen-swiotlb.bugfix' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 9 Jun 2011 19:52:44 +0000 (12:52 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 9 Jun 2011 19:52:44 +0000 (12:52 -0700)
* 'stable/xen-swiotlb.bugfix' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb-2.6:
  swiotlb: Export swioltb_nr_tbl and utilize it as appropiate.

1  2 
drivers/xen/swiotlb-xen.c

index 65ea21a974920f299afbaaa1c6e379930098f09b,5ac3f4843f5cd75bed68c8d537b7e35963d5b9f5..6e8c15a23201a3a280948cf25142001347a0d6cb
@@@ -54,7 -54,7 +54,7 @@@ u64 start_dma_addr
  
  static dma_addr_t xen_phys_to_bus(phys_addr_t paddr)
  {
 -      return phys_to_machine(XPADDR(paddr)).maddr;;
 +      return phys_to_machine(XPADDR(paddr)).maddr;
  }
  
  static phys_addr_t xen_bus_to_phys(dma_addr_t baddr)
@@@ -147,9 -147,15 +147,15 @@@ void __init xen_swiotlb_init(int verbos
  {
        unsigned long bytes;
        int rc;
-       xen_io_tlb_nslabs = (64 * 1024 * 1024 >> IO_TLB_SHIFT);
-       xen_io_tlb_nslabs = ALIGN(xen_io_tlb_nslabs, IO_TLB_SEGSIZE);
+       unsigned long nr_tbl;
+       nr_tbl = swioltb_nr_tbl();
+       if (nr_tbl)
+               xen_io_tlb_nslabs = nr_tbl;
+       else {
+               xen_io_tlb_nslabs = (64 * 1024 * 1024 >> IO_TLB_SHIFT);
+               xen_io_tlb_nslabs = ALIGN(xen_io_tlb_nslabs, IO_TLB_SEGSIZE);
+       }
  
        bytes = xen_io_tlb_nslabs << IO_TLB_SHIFT;