mirror of
https://github.com/opnsense/src.git
synced 2026-06-03 13:58:30 -04:00
cxgbe(4): Use correct synchronization when marking the adapter offline.
adapter->flags are guarded by a synch_op, as noted in the comment in adapter.h where the flags are defined. Fixes: 5241b210a4e cxgbe(4): Basic infrastructure for ULDs to participate in adapter reset. Sponsored by: Chelsio Communications (cherry picked from commit 52e5a66eac22d24e29f204c5b65232378e71f4cf)
This commit is contained in:
parent
0eea8754ae
commit
42d8f6b759
1 changed files with 7 additions and 2 deletions
|
|
@ -1990,18 +1990,23 @@ restart_adapter(struct adapter *sc)
|
|||
static inline void
|
||||
set_adapter_hwstatus(struct adapter *sc, const bool usable)
|
||||
{
|
||||
mtx_lock(&sc->reg_lock);
|
||||
if (usable) {
|
||||
/* Must be marked reusable by the designated thread. */
|
||||
ASSERT_SYNCHRONIZED_OP(sc);
|
||||
MPASS(sc->reset_thread == curthread);
|
||||
mtx_lock(&sc->reg_lock);
|
||||
atomic_clear_int(&sc->error_flags, HW_OFF_LIMITS);
|
||||
mtx_unlock(&sc->reg_lock);
|
||||
} else {
|
||||
/* Mark the adapter totally off limits. */
|
||||
begin_synchronized_op(sc, NULL, SLEEP_OK, "t4hwsts");
|
||||
mtx_lock(&sc->reg_lock);
|
||||
atomic_set_int(&sc->error_flags, HW_OFF_LIMITS);
|
||||
mtx_unlock(&sc->reg_lock);
|
||||
sc->flags &= ~(FW_OK | MASTER_PF);
|
||||
sc->reset_thread = NULL;
|
||||
end_synchronized_op(sc, 0);
|
||||
}
|
||||
mtx_unlock(&sc->reg_lock);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Reference in a new issue