From c6382f708e82f0838df4b9a2d0e338052af0982f Mon Sep 17 00:00:00 2001 From: Bhadram Varka Date: Tue, 25 Apr 2023 14:08:21 +0000 Subject: [PATCH] osi: mgbe: Enable LSI only after UPHY lane bring up Issue: During boot or interface up/down test local fault interrupts observed during UPHY lane bring up and which resuts in scheduling the UPHY lane bring up again. With this HW is generating the continuous local faults and link ok interrupts. This causes CPU to stall. Fix: Enable Link Status interrupt only after the PCS block lock is a success. Bug 4076432 Change-Id: I00049900d5d687cc043b184a7b87cc68a2651aea Signed-off-by: Bhadram Varka Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2893961 (cherry picked from commit 438811eb89ab5826df17349c1be9128d28e897f1) Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2894369 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: Narayan Reddy Reviewed-by: Krishna Thota GVS: Gerrit_Virtual_Submit --- osi/core/core_common.c | 5 +++++ osi/core/mgbe_core.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/osi/core/core_common.c b/osi/core/core_common.c index 02d0199..cd13d89 100644 --- a/osi/core/core_common.c +++ b/osi/core/core_common.c @@ -193,6 +193,11 @@ nve32_t hw_set_speed(struct osi_core_priv_data *const osi_core, const nve32_t sp if (ret < 0) { goto fail; } + + value = osi_readla(osi_core, (nveu8_t *)osi_core->base + MGBE_MAC_IER); + /* Enable Link Status interrupt only after lane bring up success */ + value |= MGBE_IMR_RGSMIIIE; + osi_writela(osi_core, value, (nveu8_t *)osi_core->base + MGBE_MAC_IER); } fail: return ret; diff --git a/osi/core/mgbe_core.c b/osi/core/mgbe_core.c index 382ce95..701ef6d 100644 --- a/osi/core/mgbe_core.c +++ b/osi/core/mgbe_core.c @@ -1832,7 +1832,9 @@ static nve32_t mgbe_configure_mac(struct osi_core_priv_data *osi_core) #ifndef OSI_STRIPPED_LIB value |= (MGBE_IMR_TXESIE); #endif - value |= (MGBE_IMR_RGSMIIIE | MGBE_IMR_TSIE); + /* Clear link status interrupt and enable after lane bring up done */ + value &= ~MGBE_IMR_RGSMIIIE; + value |= MGBE_IMR_TSIE; osi_writela(osi_core, value, (nveu8_t *)osi_core->base + MGBE_MAC_IER); /* Enable common interrupt at wrapper level */