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

dmaengine: hidma: In hidma_prep_dma_memset treat value as a single byte

The value parameter is a single byte, so duplicate it to the 8 byte
range that is used as the pattern.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Cc: Sinan Kaya <okaya@kernel.org>
Link: https://lore.kernel.org/r/20220301182551.883474-5-benjamin.walker@intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Ben Walker and committed by
Vinod Koul
643a4a85 3e0c0696

+12 -1
+12 -1
drivers/dma/qcom/hidma.c
··· 431 431 struct hidma_desc *mdesc = NULL; 432 432 struct hidma_dev *mdma = mchan->dmadev; 433 433 unsigned long irqflags; 434 + u64 byte_pattern, fill_pattern; 434 435 435 436 /* Get free descriptor */ 436 437 spin_lock_irqsave(&mchan->lock, irqflags); ··· 444 443 if (!mdesc) 445 444 return NULL; 446 445 446 + byte_pattern = (char)value; 447 + fill_pattern = (byte_pattern << 56) | 448 + (byte_pattern << 48) | 449 + (byte_pattern << 40) | 450 + (byte_pattern << 32) | 451 + (byte_pattern << 24) | 452 + (byte_pattern << 16) | 453 + (byte_pattern << 8) | 454 + byte_pattern; 455 + 447 456 mdesc->desc.flags = flags; 448 457 hidma_ll_set_transfer_params(mdma->lldev, mdesc->tre_ch, 449 - value, dest, len, flags, 458 + fill_pattern, dest, len, flags, 450 459 HIDMA_TRE_MEMSET); 451 460 452 461 /* Place descriptor in prepared list */