Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Nov 2023 13:40:10 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 2c7dd66d09a1 - main - linuxkpi: dma_get_cache_alignment(): Fix off-by-one result
Message-ID:  <202311021340.3A2DeAc2029856@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

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

commit 2c7dd66d09a1b92a4698232996cded6e5315b3bd
Author:     Olivier Certner <olce.freebsd@certner.fr>
AuthorDate: 2023-10-13 15:13:28 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-11-02 13:30:03 +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
---
 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202311021340.3A2DeAc2029856>