525.89.02

This commit is contained in:
Andy Ritger
2023-02-08 10:15:15 -08:00
parent 1dc88ff75e
commit e598191e8e
58 changed files with 1104 additions and 233 deletions

View File

@@ -1168,6 +1168,7 @@ _flcnQueueResponseHandle_IMPL
NV_STATUS status = NV_OK;
RM_FLCN_MSG_GEN *pMsgGen = (RM_FLCN_MSG_GEN *)pMsg;
PFALCON_QUEUE_INFO pQueueInfo = pFlcn->pQueueInfo;
NvU32 msgSize;
NVSWITCH_ASSERT(pQueueInfo != NULL);
@@ -1186,6 +1187,14 @@ _flcnQueueResponseHandle_IMPL
return NV_ERR_GENERIC;
}
// If response was requested
if (pSeqInfo->pMsgResp != NULL && pMsgGen != NULL)
{
NVSWITCH_ASSERT(pSeqInfo->pMsgResp->hdr.size == pMsgGen->hdr.size);
msgSize = pMsgGen->hdr.size - RM_FLCN_QUEUE_HDR_SIZE;
nvswitch_os_memcpy(&pSeqInfo->pMsgResp->msg, &pMsgGen->msg, msgSize);
}
//
// Make a client callback to notify the client that the command has
// completed. Also provide the private client data, the sequence
@@ -1472,6 +1481,7 @@ _flcnQueueCmdPostNonBlocking_IMPL
//
pSeqInfo->pCallback = pCallback;
pSeqInfo->pCallbackParams = pCallbackParams;
pSeqInfo->pMsgResp = (RM_FLCN_MSG_GEN *)pMsg;
pSeqInfo->seqDesc = pQueueInfo->nextSeqDesc++;
// Set the sequence descriptor return value.

View File

@@ -30,6 +30,7 @@
*/
#include "nvstatus.h"
#include "flcnifcmn.h"
struct nvswitch_device;
struct NVSWITCH_TIMEOUT;
@@ -226,6 +227,10 @@ typedef struct FLCN_QMGR_SEQ_INFO
* Client-specified params that must be provided to the callback function.
*/
void *pCallbackParams;
/*!
* The client message buffer that will be filled when the sequence completes.
*/
RM_FLCN_MSG_GEN *pMsgResp;
/*!
* CMD Queue associated with this Seq.

View File

@@ -223,6 +223,7 @@
_op(NvlStatus, nvswitch_ctrl_clear_counters, (nvswitch_device *device, NVSWITCH_NVLINK_CLEAR_COUNTERS_PARAMS *ret), _arch) \
_op(NvlStatus, nvswitch_ctrl_set_nvlink_error_threshold, (nvswitch_device *device, NVSWITCH_SET_NVLINK_ERROR_THRESHOLD_PARAMS *pParams), _arch) \
_op(NvlStatus, nvswitch_ctrl_get_nvlink_error_threshold, (nvswitch_device *device, NVSWITCH_GET_NVLINK_ERROR_THRESHOLD_PARAMS *pParams), _arch) \
_op(NvlStatus, nvswitch_ctrl_therm_read_voltage, (nvswitch_device *device, NVSWITCH_CTRL_GET_VOLTAGE_PARAMS *info), _arch) \
_op(NvlStatus, nvswitch_ctrl_get_board_part_number, (nvswitch_device *device, NVSWITCH_GET_BOARD_PART_NUMBER_VECTOR *p), _arch)
#define NVSWITCH_HAL_FUNCTION_LIST_LS10(_op, _arch) \

View File

@@ -55,4 +55,11 @@ nvswitch_monitor_thermal_alert_lr10
nvswitch_device *device
);
NvlStatus
nvswitch_ctrl_therm_read_voltage_lr10
(
nvswitch_device *device,
NVSWITCH_CTRL_GET_VOLTAGE_PARAMS *info
);
#endif //_THERM_LR10_H_

View File

@@ -50,4 +50,10 @@ nvswitch_monitor_thermal_alert_ls10
nvswitch_device *device
);
NvlStatus
nvswitch_ctrl_therm_read_voltage_ls10
(
nvswitch_device *device,
NVSWITCH_CTRL_GET_VOLTAGE_PARAMS *info
);
#endif //_THERM_LS10_H_

View File

@@ -297,3 +297,20 @@ nvswitch_therm_soe_callback_lr10
}
}
//
// nvswitch_therm_read_voltage
//
// Temperature and voltage are only available on SKUs which have thermal and
// voltage sensors.
//
NvlStatus
nvswitch_ctrl_therm_read_voltage_lr10
(
nvswitch_device *device,
NVSWITCH_CTRL_GET_VOLTAGE_PARAMS *info
)
{
return -NVL_ERR_NOT_SUPPORTED;
}

View File

@@ -5498,10 +5498,10 @@ nvswitch_create_deferred_link_state_check_task_ls10
pErrorReportParams->nvlipt_instance = nvlipt_instance;
pErrorReportParams->link = link;
status = nvswitch_task_create_args(device, (void*)pErrorReportParams,
status = nvswitch_task_create_args(device, (void*)pErrorReportParams,
&_nvswitch_deferred_link_state_check_ls10,
NVSWITCH_DEFERRED_LINK_STATE_CHECK_INTERVAL_NS,
NVSWITCH_TASK_TYPE_FLAGS_RUN_ONCE |
NVSWITCH_TASK_TYPE_FLAGS_RUN_ONCE |
NVSWITCH_TASK_TYPE_FLAGS_VOID_PTR_ARGS);
}
@@ -5527,7 +5527,7 @@ _nvswitch_deferred_link_errors_check_ls10
void *fn_args
)
{
NVSWITCH_DEFERRED_ERROR_REPORTING_ARGS *pErrorReportParams =
NVSWITCH_DEFERRED_ERROR_REPORTING_ARGS *pErrorReportParams =
(NVSWITCH_DEFERRED_ERROR_REPORTING_ARGS*)fn_args;
NvU32 nvlipt_instance = pErrorReportParams->nvlipt_instance;
NvU32 link = pErrorReportParams->link;
@@ -5550,7 +5550,7 @@ _nvswitch_deferred_link_errors_check_ls10
if (pErrorReportParams)
{
nvswitch_os_free(pErrorReportParams);
nvswitch_os_free(pErrorReportParams);
}
chip_device->deferredLinkErrors[link].bLinkErrorsCallBackEnabled = NV_FALSE;
}
@@ -5566,7 +5566,7 @@ _nvswitch_create_deferred_link_errors_task_ls10
ls10_device *chip_device = NVSWITCH_GET_CHIP_DEVICE_LS10(device);
NVSWITCH_DEFERRED_ERROR_REPORTING_ARGS *pErrorReportParams;
NvlStatus status;
if (chip_device->deferredLinkErrors[link].bLinkErrorsCallBackEnabled)
{
return;
@@ -7168,7 +7168,7 @@ nvswitch_service_nvldl_fatal_link_ls10
chip_device->deferredLinkErrors[link].fatalIntrMask.dl |= bit;
_nvswitch_create_deferred_link_errors_task_ls10(device, nvlipt_instance, link);
nvswitch_clear_flags(&unhandled, bit);
device->hal.nvswitch_reset_and_drain_links(device, NVBIT64(link));
@@ -7244,7 +7244,7 @@ nvswitch_service_minion_link_ls10
}
unhandled = pending;
FOR_EACH_INDEX_IN_MASK(32, localLinkIdx, pending)
{
link = (instance * NVSWITCH_LINKS_PER_NVLIPT_LS10) + localLinkIdx;

View File

@@ -30,6 +30,11 @@
#include "soe/soeiftherm.h"
#include "rmflcncmdif_nvswitch.h"
#include "flcn/flcnable_nvswitch.h"
#include "flcn/flcn_nvswitch.h"
#include "rmflcncmdif_nvswitch.h"
#include "soe/soeifcmn.h"
#include "nvswitch/ls10/dev_therm.h"
//
@@ -454,3 +459,87 @@ nvswitch_therm_soe_callback_ls10
}
}
//
// nvswitch_therm_read_voltage
//
// Temperature and voltage are only available on SKUs which have thermal and
// voltage sensors.
//
NvlStatus
nvswitch_ctrl_therm_read_voltage_ls10
(
nvswitch_device *device,
NVSWITCH_CTRL_GET_VOLTAGE_PARAMS *pParams
)
{
FLCN *pFlcn;
NvU32 cmdSeqDesc;
NV_STATUS status;
NvU8 flcnStatus;
RM_FLCN_CMD_SOE cmd;
RM_FLCN_MSG_SOE msg;
RM_SOE_CORE_CMD_GET_VOLTAGE *pGetVoltageCmd;
NVSWITCH_TIMEOUT timeout;
if (!nvswitch_is_soe_supported(device))
{
return -NVL_ERR_NOT_SUPPORTED;
}
if (pParams == NULL)
{
return -NVL_BAD_ARGS;
}
pFlcn = device->pSoe->pFlcn;
nvswitch_os_memset(pParams, 0, sizeof(NVSWITCH_CTRL_GET_VOLTAGE_PARAMS));
nvswitch_os_memset(&cmd, 0, sizeof(RM_FLCN_CMD_SOE));
nvswitch_os_memset(&msg, 0, sizeof(RM_FLCN_MSG_SOE));
cmd.hdr.unitId = RM_SOE_UNIT_CORE;
cmd.hdr.size = RM_SOE_CMD_SIZE(CORE, GET_VOLTAGE);
msg.hdr.unitId = RM_SOE_UNIT_CORE;
msg.hdr.size = RM_SOE_MSG_SIZE(CORE, GET_VOLTAGE);
pGetVoltageCmd = &cmd.cmd.core.getVoltage;
pGetVoltageCmd->cmdType = RM_SOE_CORE_CMD_GET_VOLTAGE_VALUES;
cmdSeqDesc = 0;
nvswitch_timeout_create(NVSWITCH_INTERVAL_1SEC_IN_NS * 5, &timeout);
status = flcnQueueCmdPostBlocking(device, pFlcn,
(PRM_FLCN_CMD)&cmd,
(PRM_FLCN_MSG)&msg, // pMsg
NULL, // pPayload
SOE_RM_CMDQ_LOG_ID,
&cmdSeqDesc,
&timeout);
if (status != NV_OK)
{
NVSWITCH_PRINT(device, ERROR, "%s: Failed to read VRs 0x%x\n",
__FUNCTION__, status);
return -NVL_ERR_INVALID_STATE;
}
flcnStatus = msg.msg.core.getVoltage.flcnStatus;
if (flcnStatus != FLCN_OK)
{
if (flcnStatus == FLCN_ERR_MORE_PROCESSING_REQUIRED)
{
return -NVL_MORE_PROCESSING_REQUIRED;
}
else
{
return -NVL_ERR_GENERIC;
}
}
pParams->vdd_mv = msg.msg.core.getVoltage.vdd_mv;
pParams->dvdd_mv = msg.msg.core.getVoltage.dvdd_mv;
pParams->hvdd_mv = msg.msg.core.getVoltage.hvdd_mv;
return NVL_SUCCESS;
}

View File

@@ -4722,6 +4722,16 @@ _nvswitch_ctrl_get_nvlink_error_threshold
return device->hal.nvswitch_ctrl_get_nvlink_error_threshold(device, pParams);
}
static NvlStatus
_nvswitch_ctrl_therm_read_voltage
(
nvswitch_device *device,
NVSWITCH_CTRL_GET_VOLTAGE_PARAMS *info
)
{
return device->hal.nvswitch_ctrl_therm_read_voltage(device, info);
}
NvlStatus
nvswitch_lib_ctrl
(
@@ -5058,6 +5068,9 @@ nvswitch_lib_ctrl
NVSWITCH_DEV_CMD_DISPATCH(CTRL_NVSWITCH_GET_NVLINK_ERROR_THRESHOLD,
_nvswitch_ctrl_get_nvlink_error_threshold,
NVSWITCH_GET_NVLINK_ERROR_THRESHOLD_PARAMS);
NVSWITCH_DEV_CMD_DISPATCH(CTRL_NVSWITCH_GET_VOLTAGE,
_nvswitch_ctrl_therm_read_voltage,
NVSWITCH_CTRL_GET_VOLTAGE_PARAMS);
default:
nvswitch_os_print(NVSWITCH_DBG_LEVEL_INFO, "unknown ioctl %x\n", cmd);