[PATCH 01/10] ARM: change ARM_DMA_ZONE_SIZE into a variable

Russell King - ARM Linux linux at arm.linux.org.uk
Wed Jul 6 19:04:55 EDT 2011


On Tue, Jul 05, 2011 at 10:30:33PM -0400, Nicolas Pitre wrote:
> +extern unsigned long arm_dma_zone_size;
> +#define MAX_DMA_ADDRESS	(PAGE_OFFSET + arm_dma_zone_size)
...
> -#ifndef ARM_DMA_ZONE_SIZE
> +#ifndef CONFIG_ZONE_DMA
>  #define ISA_DMA_THRESHOLD	(0xffffffffULL)
>  #else
> -#define ISA_DMA_THRESHOLD	(PHYS_OFFSET + ARM_DMA_ZONE_SIZE - 1)
> +#define ISA_DMA_THRESHOLD	({ \
> +	extern unsigned long arm_dma_zone_size; \
> +	arm_dma_zone_size ? \
> +		(PHYS_OFFSET + arm_dma_zone_size - 1) : 0xffffffffULL; })

These two usages do not agree.  With unrestricted DMA, both
MAX_DMA_ADDRESS and ISA_DMA_THRESHOLD should be 0xffffffff.  However,
you get that with arm_dma_zone_size=0 for ISA_DMA_THRESHOLD, which
then gives a MAX_DMA_ADDRESS of PAGE_OFFSET.  So this potentially
changes the behaviour of these macros.



More information about the linux-arm-kernel mailing list