From 9c461efef28ae916c947f33ee64169d3425b385c Mon Sep 17 00:00:00 2001 From: "H. Nestler" <81570977+H-Nestler@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:12:08 +0200 Subject: [PATCH] at_hdmac: Fix ATC_DST_PER_MSB for sama5d3 Only the upper nibble of handshake interface identifire (id) should put into CFG bits 15 and 14 (ATC_DST_PER_MSB), because the lower four bits are always in bits 3 to 0 (ATC_DST_PER). Same for ATC_SRC_PER_MSB. Typically effect of this bug are loosing charcters on serial output with DMA enabled, because the flow controller would connect with wrong interface. --- drivers/dma/at_hdmac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 8858470246e155..f654fb59917066 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -181,9 +181,9 @@ #define ATC_DPIP_HOLE GENMASK(15, 0) #define ATC_DPIP_BOUNDARY GENMASK(25, 16) -#define ATC_SRC_PER_ID(id) (FIELD_PREP(ATC_SRC_PER_MSB, (id)) | \ +#define ATC_SRC_PER_ID(id) (FIELD_PREP(ATC_SRC_PER_MSB, ATC_PER_MSB(id)) | \ FIELD_PREP(ATC_SRC_PER, (id))) -#define ATC_DST_PER_ID(id) (FIELD_PREP(ATC_DST_PER_MSB, (id)) | \ +#define ATC_DST_PER_ID(id) (FIELD_PREP(ATC_DST_PER_MSB, ATC_PER_MSB(id)) | \ FIELD_PREP(ATC_DST_PER, (id)))