--- zzzz-none-000/linux-4.19.183/arch/arm/include/asm/spinlock.h 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/arch/arm/include/asm/spinlock.h 2023-06-28 08:54:18.000000000 +0000 @@ -74,8 +74,11 @@ wfe(); lockval.tickets.owner = READ_ONCE(lock->tickets.owner); } - +#if defined(CONFIG_BCM_KF_ARM_BCM963XX) && defined(CONFIG_BCM_B15_MEGA_BARRIER) + smp_rmb(); +#else smp_mb(); +#endif } static inline int arch_spin_trylock(arch_spinlock_t *lock) @@ -97,7 +100,11 @@ } while (res); if (!contended) { +#if defined(CONFIG_BCM_KF_ARM_BCM963XX) && defined(CONFIG_BCM_B15_MEGA_BARRIER) + smp_rmb(); +#else smp_mb(); +#endif return 1; } else { return 0; @@ -106,7 +113,11 @@ static inline void arch_spin_unlock(arch_spinlock_t *lock) { +#if defined(CONFIG_BCM_KF_ARM_BCM963XX) && defined(CONFIG_BCM_B15_MEGA_BARRIER) + smp_rmb(); +#else smp_mb(); +#endif lock->tickets.owner++; dsb_sev(); } @@ -152,7 +163,11 @@ : "r" (&rw->lock), "r" (0x80000000) : "cc"); +#if defined(CONFIG_BCM_KF_ARM_BCM963XX) && defined(CONFIG_BCM_B15_MEGA_BARRIER) + smp_rmb(); +#else smp_mb(); +#endif } static inline int arch_write_trylock(arch_rwlock_t *rw) @@ -172,7 +187,11 @@ } while (res); if (!contended) { +#if defined(CONFIG_BCM_KF_ARM_BCM963XX) && defined(CONFIG_BCM_B15_MEGA_BARRIER) + smp_rmb(); +#else smp_mb(); +#endif return 1; } else { return 0; @@ -181,7 +200,11 @@ static inline void arch_write_unlock(arch_rwlock_t *rw) { +#if defined(CONFIG_BCM_KF_ARM_BCM963XX) && defined(CONFIG_BCM_B15_MEGA_BARRIER) + smp_rmb(); +#else smp_mb(); +#endif __asm__ __volatile__( "str %1, [%0]\n" @@ -220,7 +243,11 @@ : "r" (&rw->lock) : "cc"); +#if defined(CONFIG_BCM_KF_ARM_BCM963XX) && defined(CONFIG_BCM_B15_MEGA_BARRIER) + smp_rmb(); +#else smp_mb(); +#endif } static inline void arch_read_unlock(arch_rwlock_t *rw) @@ -262,7 +289,11 @@ /* If the lock is negative, then it is already held for write. */ if (contended < 0x80000000) { +#if defined(CONFIG_BCM_KF_ARM_BCM963XX) && defined(CONFIG_BCM_B15_MEGA_BARRIER) + smp_rmb(); +#else smp_mb(); +#endif return 1; } else { return 0;