[PATCH 1/3] dma: at_hdmac: Fix ATC_DST_PER_MSB for at91 sama5d3

Henry Nestler henrynmail-at91 at yahoo.com
Thu Aug 10 08:16:45 PDT 2023


 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 flow controller would connect with wrong interface.

Signed-off-by: Henry Nestler <henrynmail-at91 at yahoo.com>
---

--- linux-6.1.38.orig/drivers/dma/at_hdmac.c
+++ linux-6.1.38/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)))
 
 





More information about the linux-arm-kernel mailing list