openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

commit 7c3d3a5e4d69009d175d7596148afbe0355bfeff
parent 3161c9ce0ed4310896150ef6e5ac3e6d9ff0b6cd
Author: Broadcom SDK Release <sdk.releases@broadcom.com>
Date:   Sun,  7 Jul 2019 19:33:31 -0700

SDK-184054: In previous releases, dead lock would happen between sramscan and...

Devices: 56850_A2
Module: SER

Symptom:
Dead Lock observed in TD2 SDK code with ALPM enabled.

In previous releases, dead lock would happen between sramscan and dpc
thread on TD2. In this release, this issue has been fixed.

Diffstat:
Msdk-6.5.16/src/soc/common/sramscan.c | 4++--
Msdk-6.5.16/src/soc/esw/trident2.c | 21+++++++++++++--------
2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/sdk-6.5.16/src/soc/common/sramscan.c b/sdk-6.5.16/src/soc/common/sramscan.c @@ -528,10 +528,10 @@ _soc_sram_scan_thread(void *unit_vp) } else if (mem == L3_DEFIP_ALPM_IPV4m || mem == L3_DEFIP_ALPM_IPV4_1m || mem == L3_DEFIP_ALPM_IPV6_64m || mem == L3_DEFIP_ALPM_IPV6_64_1m || mem == L3_DEFIP_ALPM_IPV6_128m || mem == L3_DEFIP_PAIR_128m || + mem == L3_DEFIP_ALPM_RAWm || mem == L3_DEFIP_ALPM_ECCm || mem == L3_DEFIPm || mem == L3_DEFIP_AUX_TABLEm) { _ALPM_LOCK(unit); - } else - { + } else { MEM_LOCK(unit, mem); } diff --git a/sdk-6.5.16/src/soc/esw/trident2.c b/sdk-6.5.16/src/soc/esw/trident2.c @@ -4390,14 +4390,16 @@ _soc_trident2_process_ser_fifo(int unit, soc_block_t blk, int pipe, char *prefix (spci.mem == L3_DEFIP_ALPM_IPV6_128m) || (spci.mem == L3_DEFIP_AUX_TABLEm)) { SOC_ALPM_LPM_LOCK(unit); - } + } else #endif + { + if (spci.mem != INVALIDm) { + MEM_LOCK(unit,spci.mem); + } + } if (SOC_MEM_SER_CORRECTION_TYPE(unit, spci.mem) != SOC_MEM_FLAG_SER_SPECIAL) { spci.flags |= SOC_SER_LOG_WRITE_CACHE; } - if (spci.mem != INVALIDm) { - MEM_LOCK(unit,spci.mem); - } spci.log_id = _soc_td2_populate_ser_log(unit, parity_enable_reg, parity_enable_field, @@ -4410,9 +4412,6 @@ _soc_trident2_process_ser_fifo(int unit, soc_block_t blk, int pipe, char *prefix spci.addr, pipe, TRUE, 0); - if (spci.mem != INVALIDm) { - MEM_UNLOCK(unit,spci.mem); - } #ifdef ALPM_ENABLE if ((spci.mem == L3_DEFIP_ALPM_ECCm) || (spci.mem == L3_DEFIP_ALPM_IPV4m) || @@ -4420,10 +4419,16 @@ _soc_trident2_process_ser_fifo(int unit, soc_block_t blk, int pipe, char *prefix (spci.mem == L3_DEFIP_ALPM_IPV6_64m) || (spci.mem == L3_DEFIP_ALPM_IPV6_64_1m) || (spci.mem == L3_DEFIP_ALPM_IPV6_128m) || + (spci.mem == L3_DEFIP_ALPM_RAWm) || (spci.mem == L3_DEFIP_AUX_TABLEm)) { SOC_ALPM_LPM_UNLOCK(unit); - } + } else #endif + { + if (spci.mem != INVALIDm) { + MEM_UNLOCK(unit,spci.mem); + } + } rv = soc_ser_correction(unit, &spci); if (spci.log_id != 0) {