Skip to content

Commit 9e68817

Browse files
WeiFang-NXPkuba-moo
authored andcommitted
net: enetc: avoid VF->PF mailbox timeout during SR-IOV teardown
During SR-IOV teardown, enetc_msg_psi_free() disables the MR interrupt before pci_disable_sriov() removes the VFs. If a VF sends a mailbox message during this window, the PF cannot receive it, causing the VF to timeout waiting for a reply. Since the timeout occurs during SR-IOV teardown when the VF is about to be removed anyway, it has no functional impact on operation. However, more messages will be added in the future, some visible error logs may confuse users. So fix it by calling pci_disable_sriov() first to remove all VFs, then safely clean up the mailbox resources. This eliminates the race window where VFs could send messages to an unresponsive PF. Fixes: beb74ac ("enetc: Add vf to pf messaging support") Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com> Link: https://patch.msgid.link/20260520064421.91569-10-wei.fang@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 54362b0 commit 9e68817

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/ethernet/freescale/enetc/enetc_pf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,9 @@ static int enetc_sriov_configure(struct pci_dev *pdev, int num_vfs)
563563
int err;
564564

565565
if (!num_vfs) {
566+
pci_disable_sriov(pdev);
566567
enetc_msg_psi_free(pf);
567568
pf->num_vfs = 0;
568-
pci_disable_sriov(pdev);
569569
} else {
570570
pf->num_vfs = num_vfs;
571571

0 commit comments

Comments
 (0)