git: 4599a3c0b8e2 - stable/14 - cxgbe(4): Make sure suspend/resume works in recovery mode.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 22 Apr 2025 11:22:44 UTC
The branch stable/14 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=4599a3c0b8e2278e8400f0dc2ff54f02836b063f commit 4599a3c0b8e2278e8400f0dc2ff54f02836b063f Author: Navdeep Parhar <np@FreeBSD.org> AuthorDate: 2025-02-14 00:17:54 +0000 Commit: Navdeep Parhar <np@FreeBSD.org> CommitDate: 2025-04-22 11:12:45 +0000 cxgbe(4): Make sure suspend/resume works in recovery mode. The driver does minimal initialization in this mode and suspend/resume should ignore resources that aren't setup. This is for debug only. kenv hw.cxgbe.sos="1" kldload if_cxgbe devctl suspend t6nex0 devctl resume t6nex0 Sponsored by: Chelsio Communications (cherry picked from commit f4ab14044c1de35b1aefad5449bddc5a1272f8d9) --- sys/dev/cxgbe/t4_l2t.c | 4 ++++ sys/dev/cxgbe/t4_main.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/sys/dev/cxgbe/t4_l2t.c b/sys/dev/cxgbe/t4_l2t.c index b210003cfac0..b1307bf2ace5 100644 --- a/sys/dev/cxgbe/t4_l2t.c +++ b/sys/dev/cxgbe/t4_l2t.c @@ -376,6 +376,8 @@ t4_stop_l2t(struct adapter *sc) { struct l2t_data *d = sc->l2t; + if (d == NULL) + return (0); rw_wlock(&d->lock); d->l2t_stopped = true; rw_wunlock(&d->lock); @@ -388,6 +390,8 @@ t4_restart_l2t(struct adapter *sc) { struct l2t_data *d = sc->l2t; + if (d == NULL) + return (0); rw_wlock(&d->lock); d->l2t_stopped = false; rw_wunlock(&d->lock); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 6b3a68b352ad..222f58d056ad 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1935,6 +1935,8 @@ stop_adapter(struct adapter *sc) t4_shutdown_adapter(sc); for_each_port(sc, i) { pi = sc->port[i]; + if (pi == NULL) + continue; PORT_LOCK(pi); if (pi->up_vis > 0 && pi->link_cfg.link_ok) { /* @@ -2046,6 +2048,8 @@ stop_lld(struct adapter *sc) /* Quiesce all activity. */ for_each_port(sc, i) { pi = sc->port[i]; + if (pi == NULL) + continue; pi->vxlan_tcam_entry = false; for_each_vi(pi, j, vi) { vi->xact_addr_filt = -1; @@ -4025,6 +4029,8 @@ stop_atid_allocator(struct adapter *sc) { struct tid_info *t = &sc->tids; + if (t->natids == 0) + return; mtx_lock(&t->atid_lock); t->atid_alloc_stopped = true; mtx_unlock(&t->atid_lock); @@ -4035,6 +4041,8 @@ restart_atid_allocator(struct adapter *sc) { struct tid_info *t = &sc->tids; + if (t->natids == 0) + return; mtx_lock(&t->atid_lock); KASSERT(t->atids_in_use == 0, ("%s: %d atids still in use.", __func__, t->atids_in_use));