git: 89af1555b4ef - stable/13 - linuxkpi: dma_get_cache_alignment(): Fix off-by-one result
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 21 Dec 2023 13:43:59 UTC
The branch stable/13 has been updated by olce:
URL: https://cgit.FreeBSD.org/src/commit/?id=89af1555b4ef7efbd8caedf905956b2a2a5df141
commit 89af1555b4ef7efbd8caedf905956b2a2a5df141
Author: Olivier Certner <olce.freebsd@certner.fr>
AuthorDate: 2023-10-13 15:13:28 +0000
Commit: Olivier Certner <olce@FreeBSD.org>
CommitDate: 2023-12-21 13:40:09 +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
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42264
(cherry picked from commit 2c7dd66d09a1b92a4698232996cded6e5315b3bd)
Approved by: markj (mentor)
---
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 fb63a45ac307..d0ada4df3e26 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