diff options
author | Navdeep Parhar <np@FreeBSD.org> | 2022-08-16 07:48:21 +0000 |
---|---|---|
committer | Navdeep Parhar <np@FreeBSD.org> | 2022-08-16 08:08:35 +0000 |
commit | a8dc67388ae11a3bbb0175acb3ef9f6478d0c233 (patch) | |
tree | 91e06fc9bd75e584a5bf24963df8884da24c8511 | |
parent | a7d081a8ce0e1f4c985d2a771859d35561602b5c (diff) | |
download | src-a8dc67388ae11a3bbb0175acb3ef9f6478d0c233.tar.gz src-a8dc67388ae11a3bbb0175acb3ef9f6478d0c233.zip |
cxgbe(4): Add a knob to request that clocks be gated on suspend.
MFC after: 3 months
Sponsored by: Chelsio Communications
-rw-r--r-- | sys/dev/cxgbe/t4_main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 27403b681208..47caab160d29 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -626,6 +626,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."); @@ -1996,6 +2000,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); |