Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82c5de0a authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

dma-mapping: remove the DMA_MEMORY_EXCLUSIVE flag



All users of dma_declare_coherent want their allocations to be
exclusive, so default to exclusive allocations.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 91a6fda9
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -566,8 +566,7 @@ boundaries when doing this.

	int
	dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
				    dma_addr_t device_addr, size_t size, int
				    flags)
				    dma_addr_t device_addr, size_t size);

Declare region of memory to be handed out by dma_alloc_coherent() when
it's asked for coherent memory for this device.
@@ -581,12 +580,6 @@ dma_addr_t in dma_alloc_coherent()).

size is the size of the area (must be multiples of PAGE_SIZE).

flags can be ORed together and are:

- DMA_MEMORY_EXCLUSIVE - only allocate memory from the declared regions.
  Do not allow dma_alloc_coherent() to fall back to system memory when
  it's out of memory in the declared region.

As a simplification for the platforms, only *one* such region of
memory may be declared per device.

+4 −8
Original line number Diff line number Diff line
@@ -258,8 +258,7 @@ static void __init visstrim_analog_camera_init(void)
		return;

	dma_declare_coherent_memory(&pdev->dev, mx2_camera_base,
				    mx2_camera_base, MX2_CAMERA_BUF_SIZE,
				    DMA_MEMORY_EXCLUSIVE);
				    mx2_camera_base, MX2_CAMERA_BUF_SIZE);
}

static void __init visstrim_reserve(void)
@@ -445,8 +444,7 @@ static void __init visstrim_coda_init(void)
	dma_declare_coherent_memory(&pdev->dev,
				    mx2_camera_base + MX2_CAMERA_BUF_SIZE,
				    mx2_camera_base + MX2_CAMERA_BUF_SIZE,
				    MX2_CAMERA_BUF_SIZE,
				    DMA_MEMORY_EXCLUSIVE);
				    MX2_CAMERA_BUF_SIZE);
}

/* DMA deinterlace */
@@ -465,8 +463,7 @@ static void __init visstrim_deinterlace_init(void)
	dma_declare_coherent_memory(&pdev->dev,
				    mx2_camera_base + 2 * MX2_CAMERA_BUF_SIZE,
				    mx2_camera_base + 2 * MX2_CAMERA_BUF_SIZE,
				    MX2_CAMERA_BUF_SIZE,
				    DMA_MEMORY_EXCLUSIVE);
				    MX2_CAMERA_BUF_SIZE);
}

/* Emma-PrP for format conversion */
@@ -485,8 +482,7 @@ static void __init visstrim_emmaprp_init(void)
	 */
	ret = dma_declare_coherent_memory(&pdev->dev,
				mx2_camera_base, mx2_camera_base,
				MX2_CAMERA_BUF_SIZE,
				DMA_MEMORY_EXCLUSIVE);
				MX2_CAMERA_BUF_SIZE);
	if (ret)
		pr_err("Failed to declare memory for emmaprp\n");
}
+1 −2
Original line number Diff line number Diff line
@@ -475,8 +475,7 @@ static int __init mx31moboard_init_cam(void)

	ret = dma_declare_coherent_memory(&pdev->dev,
					  mx3_camera_base, mx3_camera_base,
					  MX3_CAMERA_BUF_SIZE,
					  DMA_MEMORY_EXCLUSIVE);
					  MX3_CAMERA_BUF_SIZE);
	if (ret)
		goto err;

+2 −3
Original line number Diff line number Diff line
@@ -530,8 +530,7 @@ static int __init ap325rxa_devices_setup(void)
	arch_setup_pdev_archdata(&ap325rxa_ceu_device);
	dma_declare_coherent_memory(&ap325rxa_ceu_device.dev,
			ceu_dma_membase, ceu_dma_membase,
				    ceu_dma_membase + CEU_BUFFER_MEMORY_SIZE - 1,
				    DMA_MEMORY_EXCLUSIVE);
			ceu_dma_membase + CEU_BUFFER_MEMORY_SIZE - 1);

	platform_device_add(&ap325rxa_ceu_device);

+2 −4
Original line number Diff line number Diff line
@@ -1440,8 +1440,7 @@ static int __init arch_setup(void)
	dma_declare_coherent_memory(&ecovec_ceu_devices[0]->dev,
				    ceu0_dma_membase, ceu0_dma_membase,
				    ceu0_dma_membase +
				    CEU_BUFFER_MEMORY_SIZE - 1,
				    DMA_MEMORY_EXCLUSIVE);
				    CEU_BUFFER_MEMORY_SIZE - 1);
	platform_device_add(ecovec_ceu_devices[0]);

	device_initialize(&ecovec_ceu_devices[1]->dev);
@@ -1449,8 +1448,7 @@ static int __init arch_setup(void)
	dma_declare_coherent_memory(&ecovec_ceu_devices[1]->dev,
				    ceu1_dma_membase, ceu1_dma_membase,
				    ceu1_dma_membase +
				    CEU_BUFFER_MEMORY_SIZE - 1,
				    DMA_MEMORY_EXCLUSIVE);
				    CEU_BUFFER_MEMORY_SIZE - 1);
	platform_device_add(ecovec_ceu_devices[1]);

	gpiod_add_lookup_table(&cn12_power_gpiod_table);
Loading