git: f4ab14044c1d - main - cxgbe(4): Make sure suspend/resume works in recovery mode.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 14 Feb 2025 06:39:04 UTC
The branch main has been updated by np:
URL: https://cgit.FreeBSD.org/src/commit/?id=f4ab14044c1de35b1aefad5449bddc5a1272f8d9
commit f4ab14044c1de35b1aefad5449bddc5a1272f8d9
Author: Navdeep Parhar <np@FreeBSD.org>
AuthorDate: 2025-02-14 00:17:54 +0000
Commit: Navdeep Parhar <np@FreeBSD.org>
CommitDate: 2025-02-14 00:41:50 +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
MFC after: 1 week
Sponsored by: Chelsio Communications
---
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 e4120e76000c..435e6fd19c9a 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -1924,6 +1924,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) {
/*
@@ -2035,6 +2037,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;
@@ -4013,6 +4017,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);
@@ -4023,6 +4029,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));