Commit 2fd8774c authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

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

Pull swiotlb fixes from Konrad Rzeszutek Wilk:
 "This has one fix to make i915 work when using Xen SWIOTLB, and a
  feature from Geert to aid in debugging of devices that can't do DMA
  outside the 32-bit address space.

  The feature from Geert is on top of v4.10 merge window commit
  (specifically you pulling my previous branch), as his changes were
  dependent on the Documentation/ movement patches.

  I figured it would just easier than me trying than to cherry-pick the
  Documentation patches to satisfy git.

  The patches have been soaking since 12/20, albeit I updated the last
  patch due to linux-next catching an compiler error and adding an
  Tested-and-Reported-by tag"

* 'stable/for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb:
  swiotlb: Export swiotlb_max_segment to users
  swiotlb: Add swiotlb=noforce debug option
  swiotlb: Convert swiotlb_force from int to enum
  x86, swiotlb: Simplify pci_swiotlb_detect_override()
parents 65cdc405 7453c549
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3821,10 +3821,11 @@
			it if 0 is given (See Documentation/cgroup-v1/memory.txt)

	swiotlb=	[ARM,IA-64,PPC,MIPS,X86]
			Format: { <int> | force }
			Format: { <int> | force | noforce }
			<int> -- Number of I/O TLB slabs
			force -- force using of bounce buffers even if they
			         wouldn't be automatically used by the kernel
			noforce -- Never use bounce buffers (for debugging)

	switches=	[HW,M68k]

+2 −1
Original line number Diff line number Diff line
@@ -524,7 +524,8 @@ EXPORT_SYMBOL(dummy_dma_ops);

static int __init arm64_dma_init(void)
{
	if (swiotlb_force || max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT))
	if (swiotlb_force == SWIOTLB_FORCE ||
	    max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT))
		swiotlb = 1;

	return atomic_pool_init();
+2 −1
Original line number Diff line number Diff line
@@ -401,7 +401,8 @@ static void __init free_unused_memmap(void)
 */
void __init mem_init(void)
{
	if (swiotlb_force || max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT))
	if (swiotlb_force == SWIOTLB_FORCE ||
	    max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT))
		swiotlb_init(1);

	set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
+2 −4
Original line number Diff line number Diff line
@@ -68,12 +68,10 @@ static struct dma_map_ops swiotlb_dma_ops = {
 */
int __init pci_swiotlb_detect_override(void)
{
	int use_swiotlb = swiotlb | swiotlb_force;

	if (swiotlb_force)
	if (swiotlb_force == SWIOTLB_FORCE)
		swiotlb = 1;

	return use_swiotlb;
	return swiotlb;
}
IOMMU_INIT_FINISH(pci_swiotlb_detect_override,
		  pci_xen_swiotlb_detect,
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ int __init pci_xen_swiotlb_detect(void)
	 * activate this IOMMU. If running as PV privileged, activate it
	 * irregardless.
	 */
	if ((xen_initial_domain() || swiotlb || swiotlb_force))
	if (xen_initial_domain() || swiotlb || swiotlb_force == SWIOTLB_FORCE)
		xen_swiotlb = 1;

	/* If we are running under Xen, we MUST disable the native SWIOTLB.
Loading