aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavdeep Parhar <np@FreeBSD.org>2022-08-16 07:48:21 +0000
committerNavdeep Parhar <np@FreeBSD.org>2023-02-02 07:16:20 +0000
commit35c9bbff43423f4d8b0920ef1eb1d79975b9776e (patch)
tree470832b90be50b414d27690162f6e809a6b31ac0
parent6c2b290e579a444c833d3bf784d762498a123f93 (diff)
downloadsrc-35c9bbff43423f4d8b0920ef1eb1d79975b9776e.tar.gz
src-35c9bbff43423f4d8b0920ef1eb1d79975b9776e.zip
cxgbe(4): Add a knob to request that clocks be gated on suspend.
Sponsored by: Chelsio Communications (cherry picked from commit a8dc67388ae11a3bbb0175acb3ef9f6478d0c233)
-rw-r--r--sys/dev/cxgbe/t4_main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index ebbe1bf1306e..9f4ffba9b3ef 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -631,6 +631,10 @@ static int t4_reset_on_fatal_err = 0;
SYSCTL_INT(_hw_cxgbe, OID_AUTO, reset_on_fatal_err, CTLFLAG_RWTUN,
&t4_reset_on_fatal_err, 0, "reset adapter on fatal errors");
+static int t4_clock_gate_on_suspend = 0;
+SYSCTL_INT(_hw_cxgbe, OID_AUTO, clock_gate_on_suspend, CTLFLAG_RWTUN,
+ &t4_clock_gate_on_suspend, 0, "gate the clock on suspend");
+
static int t4_tx_vm_wr = 0;
SYSCTL_INT(_hw_cxgbe, OID_AUTO, tx_vm_wr, CTLFLAG_RWTUN, &t4_tx_vm_wr, 0,
"Use VM work requests to transmit packets.");
@@ -2074,6 +2078,12 @@ t4_suspend(device_t dev)
sc->reset_thread = NULL;
mtx_unlock(&sc->reg_lock);
+ if (t4_clock_gate_on_suspend) {
+ t4_set_reg_field(sc, A_PMU_PART_CG_PWRMODE, F_MA_PART_CGEN |
+ F_LE_PART_CGEN | F_EDC1_PART_CGEN | F_EDC0_PART_CGEN |
+ F_TP_PART_CGEN | F_PDP_PART_CGEN | F_SGE_PART_CGEN, 0);
+ }
+
CH_ALERT(sc, "suspend completed.\n");
done:
end_synchronized_op(sc, 0);