Commit 74d6790c authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'stable/for-linus-5.13' of...

Merge branch 'stable/for-linus-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb

Pull swiotlb updates from Konrad Rzeszutek Wilk:
 "Christoph Hellwig has taken a cleaver and trimmed off the not-needed
  code and nicely folded duplicate code in the generic framework.

  This lays the groundwork for more work to add extra DMA-backend-ish in
  the future. Along with that some bug-fixes to make this a nice working
  package"

* 'stable/for-linus-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb:
  swiotlb: don't override user specified size in swiotlb_adjust_size
  swiotlb: Fix the type of index
  swiotlb: Make SWIOTLB_NO_FORCE perform no allocation
  ARM: Qualify enabling of swiotlb_init()
  swiotlb: remove swiotlb_nr_tbl
  swiotlb: dynamically allocate io_tlb_default_mem
  swiotlb: move global variables into a new io_tlb_mem structure
  xen-swiotlb: remove the unused size argument from xen_swiotlb_fixup
  xen-swiotlb: split xen_swiotlb_init
  swiotlb: lift the double initialization protection from xen-swiotlb
  xen-swiotlb: remove xen_io_tlb_start and xen_io_tlb_nslabs
  xen-swiotlb: remove xen_set_nslabs
  xen-swiotlb: use io_tlb_end in xen_swiotlb_dma_supported
  xen-swiotlb: use is_swiotlb_buffer in is_xen_swiotlb_buffer
  swiotlb: split swiotlb_tbl_sync_single
  swiotlb: move orig addr and size validation into swiotlb_bounce
  swiotlb: remove the alloc_size parameter to swiotlb_tbl_unmap_single
  powerpc/svm: stop using io_tlb_start
parents 954b7207 dfc06b38
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -301,7 +301,11 @@ static void __init free_highpages(void)
void __init mem_init(void)
{
#ifdef CONFIG_ARM_LPAE
	if (swiotlb_force == SWIOTLB_FORCE ||
	    max_pfn > arm_dma_pfn_limit)
		swiotlb_init(1);
	else
		swiotlb_force = SWIOTLB_NO_FORCE;
#endif

	set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
+1 −1
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ static int __init xen_mm_init(void)
	struct gnttab_cache_flush cflush;
	if (!xen_swiotlb_detect())
		return 0;
	xen_swiotlb_init(1, false);
	xen_swiotlb_init();

	cflush.op = 0;
	cflush.a.dev_bus_addr = 0;
+3 −3
Original line number Diff line number Diff line
@@ -55,8 +55,8 @@ void __init svm_swiotlb_init(void)
	if (vstart && !swiotlb_init_with_tbl(vstart, io_tlb_nslabs, false))
		return;

	if (io_tlb_start)
		memblock_free_early(io_tlb_start,

	memblock_free_early(__pa(vstart),
			    PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT));
	panic("SVM: Cannot allocate SWIOTLB buffer");
}
+2 −2
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ int __init pci_xen_swiotlb_detect(void)
void __init pci_xen_swiotlb_init(void)
{
	if (xen_swiotlb) {
		xen_swiotlb_init(1, true /* early */);
		xen_swiotlb_init_early();
		dma_ops = &xen_swiotlb_dma_ops;

#ifdef CONFIG_PCI
@@ -76,7 +76,7 @@ int pci_xen_swiotlb_init_late(void)
	if (xen_swiotlb)
		return 0;

	rc = xen_swiotlb_init(1, false /* late */);
	rc = xen_swiotlb_init();
	if (rc)
		return rc;

+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ static int i915_gem_object_get_pages_internal(struct drm_i915_gem_object *obj)

	max_order = MAX_ORDER;
#ifdef CONFIG_SWIOTLB
	if (swiotlb_nr_tbl()) {
	if (is_swiotlb_active()) {
		unsigned int max_segment;

		max_segment = swiotlb_max_segment();
Loading