From 2be4ef39bc638e92d0f253f68899a88cd7063365 Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Tue, 17 May 2016 06:28:03 +0000 Subject: [PATCH] sfxge(4): only raise an exception after MC assert or reboot in the common code Fix efx_mcdi_request_poll so it only raises an exception if EIO is reported from a detected MC assert or reboot. This prevents an unnecessary exception being raised if an MCDI response error code is trandlated to EIO. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6392 --- sys/dev/sfxge/common/efx_mcdi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/dev/sfxge/common/efx_mcdi.c b/sys/dev/sfxge/common/efx_mcdi.c index 5fd484e20f9b..1a12b65643a8 100644 --- a/sys/dev/sfxge/common/efx_mcdi.c +++ b/sys/dev/sfxge/common/efx_mcdi.c @@ -519,6 +519,11 @@ efx_mcdi_request_poll( if ((rc = efx_mcdi_poll_reboot(enp)) != 0) { emip->emi_pending_req = NULL; EFSYS_UNLOCK(enp->en_eslp, state); + + /* Reboot/Assertion */ + if (rc == EIO || rc == EINTR) + efx_mcdi_raise_exception(enp, emrp, rc); + goto fail1; } } @@ -553,10 +558,6 @@ fail1: if (!emrp->emr_quiet) EFSYS_PROBE1(fail1, efx_rc_t, rc); - /* Reboot/Assertion */ - if (rc == EIO || rc == EINTR) - efx_mcdi_raise_exception(enp, emrp, rc); - return (B_TRUE); }