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

Commit 4d3234f5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: dma-removed: use memset_io for ioremap region"

parents e00f13ca 542fbe9f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -378,6 +378,7 @@ static void alloc_init_pud(struct mm_struct *mm, pgd_t *pgd,
		 * For 4K granule only, attempt to put down a 1GB block
		 */
		if (use_1G_block(addr, next, phys) &&
				!force_pages &&
				!dma_overlap(phys, phys + next - addr) &&
				!IS_ENABLED(CONFIG_FORCE_PAGES)) {
			pud_t old_pud = *pud;
+8 −6
Original line number Diff line number Diff line
/*
 *
 *  Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 *  Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 *  Copyright (C) 2000-2004 Russell King
 *
 * This program is free software; you can redistribute it and/or modify
@@ -79,17 +79,19 @@ void *removed_alloc(struct device *dev, size_t size, dma_addr_t *handle,
					attrs);
	bool skip_zeroing = dma_get_attr(DMA_ATTR_SKIP_ZEROING, attrs);
	int pageno;
	unsigned long order = get_order(size);
	unsigned long order;
	void *addr = NULL;
	struct removed_region *dma_mem = dev->removed_mem;
	int nbits = size >> PAGE_SHIFT;
	int nbits;
	unsigned int align;

	size = PAGE_ALIGN(size);

	if (!(gfp & __GFP_WAIT))
		return NULL;

	size = PAGE_ALIGN(size);
	nbits = size >> PAGE_SHIFT;
	order = get_order(size);

	if (order > get_order(SZ_1M))
		order = get_order(SZ_1M);

@@ -116,7 +118,7 @@ void *removed_alloc(struct device *dev, size_t size, dma_addr_t *handle,
			bitmap_clear(dma_mem->bitmap, pageno, nbits);
		} else {
			if (!skip_zeroing)
				memset(addr, 0, size);
				memset_io(addr, 0, size);
			if (no_kernel_mapping) {
				iounmap(addr);
				addr = (void *)NO_KERNEL_MAPPING_DUMMY;