Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: at_hdmac: In atc_prep_dma_memset, treat value as a single byte

The value passed in to .prep_dma_memset is to be treated as a single
byte repeating pattern.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20220301182551.883474-3-benjamin.walker@intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Ben Walker and committed by
Vinod Koul
ceabe10c fc44ff0a

+9 -1
+9 -1
drivers/dma/at_hdmac.c
··· 942 942 struct at_desc *desc; 943 943 void __iomem *vaddr; 944 944 dma_addr_t paddr; 945 + char fill_pattern; 945 946 946 947 dev_vdbg(chan2dev(chan), "%s: d%pad v0x%x l0x%zx f0x%lx\n", __func__, 947 948 &dest, value, len, flags); ··· 964 963 __func__); 965 964 return NULL; 966 965 } 967 - *(u32*)vaddr = value; 966 + 967 + /* Only the first byte of value is to be used according to dmaengine */ 968 + fill_pattern = (char)value; 969 + 970 + *(u32*)vaddr = (fill_pattern << 24) | 971 + (fill_pattern << 16) | 972 + (fill_pattern << 8) | 973 + fill_pattern; 968 974 969 975 desc = atc_create_memset_desc(chan, paddr, dest, len); 970 976 if (!desc) {