git: f946a5ec9692 - stable/14 - linuxkpi: dma_get_cache_alignment(): Fix off-by-one result

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Thu, 16 Nov 2023 20:54:45 UTC
The branch stable/14 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=f946a5ec9692973831db93691ad06a93240d5937

commit f946a5ec9692973831db93691ad06a93240d5937
Author:     Olivier Certner <olce.freebsd@certner.fr>
AuthorDate: 2023-10-13 15:13:28 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-11-16 15:07:18 +0000

    linuxkpi: dma_get_cache_alignment(): Fix off-by-one result
    
    Substituting 'uma_align_cache' by the appropriately named accessor
    uma_get_cache_align_mask() made apparent that dma_get_cache_alignment()
    was off by one, since it was defined to be the mask derived from the
    alignment value.
    
    Reviewed by:            markj, bz
    MFC after:              2 weeks
    Sponsored by:           The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D42264
    
    (cherry picked from commit 2c7dd66d09a1b92a4698232996cded6e5315b3bd)
---
 sys/compat/linuxkpi/common/include/linux/dma-mapping.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
index 53c59bea8ef2..84f0361de765 100644
--- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
+++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
@@ -351,7 +351,7 @@ dma_max_mapping_size(struct device *dev)
 #define	dma_unmap_len(p, name)			((p)->name)
 #define	dma_unmap_len_set(p, name, v)		(((p)->name) = (v))
 
-#define	dma_get_cache_alignment()	uma_get_cache_align_mask()
+#define	dma_get_cache_alignment()	(uma_get_cache_align_mask() + 1)
 
 
 static inline int