svn commit: r355252 - stable/11/sys/dev/cxgbe
Navdeep Parhar
np at FreeBSD.org
Sat Nov 30 20:51:48 UTC 2019
Author: np
Date: Sat Nov 30 20:51:47 2019
New Revision: 355252
URL: https://svnweb.freebsd.org/changeset/base/355252
Log:
MFC r354522:
cxgbe(4): Query Vdd from the firmware if its last known value is 0.
TVSENSE may not be ready by the time t4_fw_initialize returns and the
firmware returns 0 if the driver asks for the Vdd before the sensor is
ready.
Sponsored by: Chelsio Communications
Modified:
stable/11/sys/dev/cxgbe/t4_main.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/cxgbe/t4_main.c
==============================================================================
--- stable/11/sys/dev/cxgbe/t4_main.c Sat Nov 30 20:43:30 2019 (r355251)
+++ stable/11/sys/dev/cxgbe/t4_main.c Sat Nov 30 20:51:47 2019 (r355252)
@@ -640,6 +640,7 @@ static int sysctl_fec(SYSCTL_HANDLER_ARGS);
static int sysctl_autoneg(SYSCTL_HANDLER_ARGS);
static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS);
static int sysctl_temperature(SYSCTL_HANDLER_ARGS);
+static int sysctl_vdd(SYSCTL_HANDLER_ARGS);
static int sysctl_loadavg(SYSCTL_HANDLER_ARGS);
static int sysctl_cctrl(SYSCTL_HANDLER_ARGS);
static int sysctl_cim_ibq_obq(SYSCTL_HANDLER_ARGS);
@@ -5959,8 +5960,8 @@ t4_sysctls(struct adapter *sc)
CTLFLAG_RD, sc, 0, sysctl_loadavg, "A",
"microprocessor load averages (debug firmwares only)");
- SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_vdd", CTLFLAG_RD,
- &sc->params.core_vdd, 0, "core Vdd (in mV)");
+ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "core_vdd", CTLTYPE_INT |
+ CTLFLAG_RD, sc, 0, sysctl_vdd, "I", "core Vdd (in mV)");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "local_cpus",
CTLTYPE_STRING | CTLFLAG_RD, sc, LOCAL_CPUS,
@@ -7087,6 +7088,31 @@ sysctl_temperature(SYSCTL_HANDLER_ARGS)
rc = sysctl_handle_int(oidp, &t, 0, req);
return (rc);
+}
+
+static int
+sysctl_vdd(SYSCTL_HANDLER_ARGS)
+{
+ struct adapter *sc = arg1;
+ int rc;
+ uint32_t param, val;
+
+ if (sc->params.core_vdd == 0) {
+ rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK,
+ "t4vdd");
+ if (rc)
+ return (rc);
+ param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) |
+ V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_DIAG) |
+ V_FW_PARAMS_PARAM_Y(FW_PARAM_DEV_DIAG_VDD);
+ rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val);
+ end_synchronized_op(sc, 0);
+ if (rc)
+ return (rc);
+ sc->params.core_vdd = val;
+ }
+
+ return (sysctl_handle_int(oidp, &sc->params.core_vdd, 0, req));
}
static int
More information about the svn-src-stable-11
mailing list