efx_mcdi.c (228078) | efx_mcdi.c (250460) |
---|---|
1/*- 2 * Copyright 2008-2009 Solarflare Communications Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> | 1/*- 2 * Copyright 2008-2009 Solarflare Communications Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> |
27__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/efx_mcdi.c 228078 2011-11-28 17:19:05Z philip $"); | 27__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/efx_mcdi.c 250460 2013-05-10 16:41:26Z eadler $"); |
28 29#include "efsys.h" 30#include "efx.h" 31#include "efx_types.h" 32#include "efx_regs.h" 33#include "efx_regs_mcdi.h" 34#include "efx_impl.h" 35 --- 45 unchanged lines hidden (view full) --- 81 default: 82 EFSYS_ASSERT(0); 83 pdur = dbr = 0; 84 }; 85 86 /* 87 * efx_mcdi_request_start() is naturally serialised against both 88 * efx_mcdi_request_poll() and efx_mcdi_ev_cpl()/efx_mcdi_ev_death(), | 28 29#include "efsys.h" 30#include "efx.h" 31#include "efx_types.h" 32#include "efx_regs.h" 33#include "efx_regs_mcdi.h" 34#include "efx_impl.h" 35 --- 45 unchanged lines hidden (view full) --- 81 default: 82 EFSYS_ASSERT(0); 83 pdur = dbr = 0; 84 }; 85 86 /* 87 * efx_mcdi_request_start() is naturally serialised against both 88 * efx_mcdi_request_poll() and efx_mcdi_ev_cpl()/efx_mcdi_ev_death(), |
89 * by virtue of there only being one oustanding MCDI request. | 89 * by virtue of there only being one outstanding MCDI request. |
90 * Unfortunately, upper layers may also call efx_mcdi_request_abort() 91 * at any time, to timeout a pending mcdi request, That request may 92 * then subsequently complete, meaning efx_mcdi_ev_cpl() or 93 * efx_mcdi_ev_death() may end up running in parallel with 94 * efx_mcdi_request_start(). This race is handled by ensuring that 95 * %emi_pending_req, %emi_ev_cpl and %emi_seq are protected by the 96 * en_eslp lock. 97 */ --- 336 unchanged lines hidden (view full) --- 434 efx_mcdi_req_t *emrp = NULL; 435 boolean_t ev_cpl; 436 int state; 437 438 /* 439 * The MCDI request (if there is one) has been terminated, either 440 * by a BADASSERT or REBOOT event. 441 * | 90 * Unfortunately, upper layers may also call efx_mcdi_request_abort() 91 * at any time, to timeout a pending mcdi request, That request may 92 * then subsequently complete, meaning efx_mcdi_ev_cpl() or 93 * efx_mcdi_ev_death() may end up running in parallel with 94 * efx_mcdi_request_start(). This race is handled by ensuring that 95 * %emi_pending_req, %emi_ev_cpl and %emi_seq are protected by the 96 * en_eslp lock. 97 */ --- 336 unchanged lines hidden (view full) --- 434 efx_mcdi_req_t *emrp = NULL; 435 boolean_t ev_cpl; 436 int state; 437 438 /* 439 * The MCDI request (if there is one) has been terminated, either 440 * by a BADASSERT or REBOOT event. 441 * |
442 * If there is an oustanding event-completed MCDI operation, then we | 442 * If there is an outstanding event-completed MCDI operation, then we |
443 * will never receive the completion event (because both MCDI 444 * completions and BADASSERT events are sent to the same evq). So 445 * complete this MCDI op. 446 * 447 * This function might run in parallel with efx_mcdi_request_poll() 448 * for poll completed mcdi requests, and also with 449 * efx_mcdi_request_start() for post-watchdog completions. 450 */ --- 286 unchanged lines hidden --- | 443 * will never receive the completion event (because both MCDI 444 * completions and BADASSERT events are sent to the same evq). So 445 * complete this MCDI op. 446 * 447 * This function might run in parallel with efx_mcdi_request_poll() 448 * for poll completed mcdi requests, and also with 449 * efx_mcdi_request_start() for post-watchdog completions. 450 */ --- 286 unchanged lines hidden --- |