octeontx2-af: Send Link events one by one
authorSubbaraya Sundeep <sbhatta@marvell.com>
Wed, 21 May 2025 10:30:43 +0000 (16:00 +0530)
committerPaolo Abeni <pabeni@redhat.com>
Mon, 26 May 2025 16:07:40 +0000 (18:07 +0200)
Send link events one after another otherwise new message
is overwriting the message which is being processed by PF.

Fixes: a88e0f936ba9 ("octeontx2: Detect the mbox up or down message via register")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/1747823443-404-1-git-send-email-sbhatta@marvell.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c

index 655dd4726d36efb52313895e7ccf7e3c587dbf1b..0277d226293e9cc3a4d01a26eaa041948cfcb94a 100644 (file)
@@ -143,6 +143,8 @@ static int mcs_notify_pfvf(struct mcs_intr_event *event, struct rvu *rvu)
 
        otx2_mbox_msg_send_up(&rvu->afpf_wq_info.mbox_up, pf);
 
+       otx2_mbox_wait_for_rsp(&rvu->afpf_wq_info.mbox_up, pf);
+
        mutex_unlock(&rvu->mbox_lock);
 
        return 0;
index 992fa0b82e8d2d0451aae136c683618433c45123..ebb56eb0d18cfdd2dff2d372094ee8fd343c1797 100644 (file)
@@ -272,6 +272,8 @@ static void cgx_notify_pfs(struct cgx_link_event *event, struct rvu *rvu)
 
                otx2_mbox_msg_send_up(&rvu->afpf_wq_info.mbox_up, pfid);
 
+               otx2_mbox_wait_for_rsp(&rvu->afpf_wq_info.mbox_up, pfid);
+
                mutex_unlock(&rvu->mbox_lock);
        } while (pfmap);
 }
index 052ae5923e3a851c0ec626ac46ab56d910772b54..32953cca108c8094aa4a9583e272717c0a7eab64 100644 (file)
@@ -60,6 +60,8 @@ static int rvu_rep_up_notify(struct rvu *rvu, struct rep_event *event)
 
        otx2_mbox_msg_send_up(&rvu->afpf_wq_info.mbox_up, pf);
 
+       otx2_mbox_wait_for_rsp(&rvu->afpf_wq_info.mbox_up, pf);
+
        mutex_unlock(&rvu->mbox_lock);
        return 0;
 }