[PATCH v7 3/4] drivers: of: add initialization code for dma reserved memory

Kumar Gala galak at codeaurora.org
Fri Sep 27 11:47:14 EDT 2013


On Aug 26, 2013, at 9:39 AM, Marek Szyprowski wrote:

> +/**
> + * of_reserved_mem_device_init() - assign reserved memory region to given device
> + *
> + * This function assign memory region pointed by "memory-region" device tree
> + * property to the given device.
> + */
> +void of_reserved_mem_device_init(struct device *dev)
> +{
> +	struct reserved_mem *region = get_dma_memory_region(dev);
> +	if (!region)
> +		return;
> +
> +	if (region->cma) {
> +		dev_set_cma_area(dev, region->cma);
> +		pr_info("Assigned CMA %s to %s device\n", region->name,
> +			dev_name(dev));
> +	} else {

I don't think its a reasonable assumption that a 'reserved-memory-region' is necessary dma coherent if its not cma.

> +		if (dma_declare_coherent_memory(dev, region->base, region->base,
> +		    region->size, DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE) != 0)
> +			pr_info("Declared reserved memory %s to %s device\n",
> +				region->name, dev_name(dev));
> +	}
> +}
> +

- k

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation




More information about the linux-arm-kernel mailing list