The branch stable/13 has been updated by np:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=35c9bbff43423f4d8b0920ef1eb1d79975b9776e

commit 35c9bbff43423f4d8b0920ef1eb1d79975b9776e
Author:     Navdeep Parhar <[email protected]>
AuthorDate: 2022-08-16 07:48:21 +0000
Commit:     Navdeep Parhar <[email protected]>
CommitDate: 2023-02-02 07:16:20 +0000

    cxgbe(4): Add a knob to request that clocks be gated on suspend.
    
    Sponsored by:   Chelsio Communications
    
    (cherry picked from commit a8dc67388ae11a3bbb0175acb3ef9f6478d0c233)
---
 sys/dev/cxgbe/t4_main.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

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);

Reply via email to