git: 03572a87a84c - releng/13.0 - riscv: fix errors in some atomic type aliases

Mitchell Horne mhorne at FreeBSD.org
Mon Mar 8 23:05:27 UTC 2021


The branch releng/13.0 has been updated by mhorne:

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

commit 03572a87a84cde47f672480d3c5485713b7c39fb
Author:     Mitchell Horne <mhorne at FreeBSD.org>
AuthorDate: 2021-03-04 17:52:45 +0000
Commit:     Mitchell Horne <mhorne at FreeBSD.org>
CommitDate: 2021-03-08 23:04:25 +0000

    riscv: fix errors in some atomic type aliases
    
    This appears to be a copy-and-paste error that has simply been
    overlooked. The tree contains only two calls to any of the affected
    variants, but recent additions to the test suite started exercising the
    call to atomic_clear_rel_int() in ng_leave_write(), reliably causing
    panics.
    
    Apparently, the issue was inherited from the arm64 atomic header. That
    instance was addressed in c90baf6817a0, but the fix did not make its way
    to RISC-V.
    
    Note that the particular test case ng_macfilter_test:main still appears
    to fail on this platform, but this change reduces the panic to a
    timeout.
    
    PR:             253237
    Reported by:    Jenkins, arichardson
    Reviewed by:    kp, arichardson
    Approved by:    re (gjb)
    
    (cherry picked from commit 0d3b3beeb253e09b2b6b3805065594aecc7e2c2f)
    (cherry picked from commit cc24f5bc6f6eb56a959bd23ebb051d3bf6ebf670)
---
 sys/riscv/include/atomic.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/riscv/include/atomic.h b/sys/riscv/include/atomic.h
index d08047593861..d743fce6f1ff 100644
--- a/sys/riscv/include/atomic.h
+++ b/sys/riscv/include/atomic.h
@@ -288,7 +288,7 @@ atomic_store_rel_32(volatile uint32_t *p, uint32_t val)
 #define	atomic_subtract_acq_int	atomic_subtract_acq_32
 
 #define	atomic_add_rel_int	atomic_add_rel_32
-#define	atomic_clear_rel_int	atomic_add_rel_32
+#define	atomic_clear_rel_int	atomic_clear_rel_32
 #define	atomic_cmpset_rel_int	atomic_cmpset_rel_32
 #define	atomic_fcmpset_rel_int	atomic_fcmpset_rel_32
 #define	atomic_set_rel_int	atomic_set_rel_32
@@ -490,7 +490,7 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val)
 }
 
 #define	atomic_add_acq_long		atomic_add_acq_64
-#define	atomic_clear_acq_long		atomic_add_acq_64
+#define	atomic_clear_acq_long		atomic_clear_acq_64
 #define	atomic_cmpset_acq_long		atomic_cmpset_acq_64
 #define	atomic_fcmpset_acq_long		atomic_fcmpset_acq_64
 #define	atomic_load_acq_long		atomic_load_acq_64
@@ -498,7 +498,7 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val)
 #define	atomic_subtract_acq_long	atomic_subtract_acq_64
 
 #define	atomic_add_acq_ptr		atomic_add_acq_64
-#define	atomic_clear_acq_ptr		atomic_add_acq_64
+#define	atomic_clear_acq_ptr		atomic_clear_acq_64
 #define	atomic_cmpset_acq_ptr		atomic_cmpset_acq_64
 #define	atomic_fcmpset_acq_ptr		atomic_fcmpset_acq_64
 #define	atomic_load_acq_ptr		atomic_load_acq_64


More information about the dev-commits-src-all mailing list