[PATCH v2] PL330: Add PL330 DMA controller driver

Marc Zyngier maz at misterjones.org
Thu Mar 25 01:44:30 EDT 2010


On Thu, 25 Mar 2010 12:17:15 +0900
Joonyoung Shim <jy0922.shim at samsung.com> wrote:

> +/* instruction set functions */
> +static inline int pl330_dmaaddh(u8 *desc_pool_virt, u16 imm, bool ra)
> +{
> +	u8 opcode = DMAADDH | (ra << 1);
> +
> +	writeb(opcode, desc_pool_virt++);

desc_pool_virt is a virtual address (from dma_alloc_coherent). In such
case, write[bwl] seems to be the wrong interface. I suggest the
following code:

	*desc_pool_virt++ = opcode;

> +	writew(imm, desc_pool_virt);

Does anything ensure that this won't generate an unaligned access?

> +	return 3;
> +}

	M.
-- 
I'm the slime oozin' out from your TV set...



More information about the linux-arm-kernel mailing list