Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sfc: Wait for MC reboot to complete before scheduling driver reset

Scheduling a reset following an MC reboot event before waiting for
reboot to complete results in a race that can lead to a state where
must_realloc_vis is false in efx_ef10_fini_dmaq() but the VIs have
been destroyed during the MC reboot.

To avoid MC errors when trying to remove VIs that do not exist, wait
for the MC reboot to complete before scheduling the reset.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>

authored by

Daniel Pieczko and committed by
Ben Hutchings
dfdaa95c dcb30e65

+3 -3
+3 -3
drivers/net/ethernet/sfc/mcdi.c
··· 800 800 } else { 801 801 int count; 802 802 803 - /* Nobody was waiting for an MCDI request, so trigger a reset */ 804 - efx_schedule_reset(efx, RESET_TYPE_MC_FAILURE); 805 - 806 803 /* Consume the status word since efx_mcdi_rpc_finish() won't */ 807 804 for (count = 0; count < MCDI_STATUS_DELAY_COUNT; ++count) { 808 805 if (efx_mcdi_poll_reboot(efx)) ··· 807 810 udelay(MCDI_STATUS_DELAY_US); 808 811 } 809 812 mcdi->new_epoch = true; 813 + 814 + /* Nobody was waiting for an MCDI request, so trigger a reset */ 815 + efx_schedule_reset(efx, RESET_TYPE_MC_FAILURE); 810 816 } 811 817 812 818 spin_unlock(&mcdi->iface_lock);