From nobody Tue Aug 16 08:57:21 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M6Q5G1N0Zz4YSLj; Tue, 16 Aug 2022 08:57:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M6Q5G0cpJz3qdC; Tue, 16 Aug 2022 08:57:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660640242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G+0IPp7sWHXRgWDPBHrd+2l2hYujygHIjAYggk6Y4wY=; b=kTHfn5WcGbS/HS/qqWcvxXzbHft5SblF4ciJrKCqpTZukMiC3dZttZKhLSTT7UbS39Z+29 kve/7DGX9CgfkUif+jAC9acuhyzLHSfGzfw0QARpw5HYkcTudsGipyqkkFT77i5r5Qv7gm 5Hz3DAL3w1Erf1SeO9CidxTsXDcCc4YdMimyPec2iMTYeDqOVyQGE3SfUm9b/geAnFIHyw 7/pp2rsY9MTraOB0nsztl7ZyiSmo3p6acQqwTeLsAG1pPgdyUYzuPeW06Ta+PbO/IW0A8x GnvDaKvyXr9Az1XNk4Q8Jr9DwOu8lP1DFXJJsgxCl/KCIUJtgf5CLF20cv311A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4M6Q5F6YRsz13fX; Tue, 16 Aug 2022 08:57:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27G8vLjX025751; Tue, 16 Aug 2022 08:57:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27G8vLr2025750; Tue, 16 Aug 2022 08:57:21 GMT (envelope-from git) Date: Tue, 16 Aug 2022 08:57:21 GMT Message-Id: <202208160857.27G8vLr2025750@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: a8dc67388ae1 - main - cxgbe(4): Add a knob to request that clocks be gated on suspend. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8dc67388ae11a3bbb0175acb3ef9f6478d0c233 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660640242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G+0IPp7sWHXRgWDPBHrd+2l2hYujygHIjAYggk6Y4wY=; b=n9CuZrzlOf2kQRi2M5c/oJ7AKKkI4hw6JRk5KPxDfypUUXrrAZshW/18c/jv+dvgsA4SMT Q6+ZSeZFrYl8eGSsgL67Dn91EdUzcv/lNxWPAwQMpIQr3iIh4LUWd8rOo6IjjPc+ajPM2l nyCukTKKsf5ZX+M5FeywXJ8frknx0qFH+ACBC1TfoWuRv/WvpEiievlzEyARhZqp/9Y2GP nlXafhsFHxTby48I1LJ7x8B7IDBxHjakzwDz7B6S9Ti5bYVm39NJUwusy6QlRJD4eRmgb6 4rCgus4Jk9X0uPqjDEzQYz6rJi/h3ltYzucjp2soISt2EmTYjxxYxXSZ9qHTTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660640242; a=rsa-sha256; cv=none; b=CJSmrJm42iDM97wKPh4wu4mtMONV/JV11yTjCcdc00PDzF9UbeZppnINmnrlbcc/MEtlWn mf382ghBrCuAF/wZ1BdZUb35RrbfFUmbk0NTnsjcRhTa08HljruYmNuCnbLTFNqdhjBCRT ND/wWNYDL3dBdOQfxxdAcP9DaiJKAF9wcEQeYV60fUY+vDReCMN6xxDKOtnrShTbAG9n+e KtJbrOqx2qbBe/xyPHFUVxMOYrv6oWRoESPmpvVitx/17IxGeVNzRHplGuriRzRtakieJI 9j1aGLxZkqahseOamZ9oMjAt4iJXN+uemws907eiwtw8pUIDKkzadLDzpgIoWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=a8dc67388ae11a3bbb0175acb3ef9f6478d0c233 commit a8dc67388ae11a3bbb0175acb3ef9f6478d0c233 Author: Navdeep Parhar AuthorDate: 2022-08-16 07:48:21 +0000 Commit: Navdeep Parhar CommitDate: 2022-08-16 08:08:35 +0000 cxgbe(4): Add a knob to request that clocks be gated on suspend. MFC after: 3 months Sponsored by: Chelsio Communications --- 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 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);