mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
Add a new Central Interrupt Controller(CIC) unit in common code.
The interrupt handling is done in a distributed manner currently.
The error handling policy for different errors resides in each unit's
ISR code. The goal is to converge this data under one central place -
the CIC unit.
This patch creates framework for CIC unit and moves the gv11b QNX
safety LUT to CIC unit. All the error reporting APIs from different
units are also moved to CIC.
New APIs are exposed by CIC unit to access its internal data like:
1. Struct err_desc - the static err handling /injection data per
error id
2. Num_hw_modules - the number of error reporting HW units
supported by CIC
Init and deinit of CIC unit:
1. CIC unit should be initialized earlyon during boot so that it
is available for any interrupt handling.
2. Initialize CIC just before the interrupts are enabled during
boot.
3. Similarly, CIC is disabled late during deinit cycle; right
after the interrupts are masked.
LUT:
1. LUT is currently used only for reporting error to safety
services in gv11b QNX safety build.
2. This error handling policy LUT currently has only two levels
of handing - correctable and quiecse.
3. Once, the error handling policy decision is moved from leaf
unit nodes to CIC, LUT will be updated to have additional levels
like fast recovery and full recovery.
4. Also, then a separate LUT will be added for each platform/build.
5. In current framework, the LUT is set to NULL for all
configurations except gv11b.
report_err() ops is added to report error to safety services.
This ops is only effective for gv11b qnx build; and set to NULL for
other configurations.
NVGPU-6521
NVGPU-6523
NVGPU-6750
NVGPU-6758
NVGPU-6760
NVGPU-6754
Change-Id: I24be7836a96d787741e37b732e19863ed8014635
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2518683
Reviewed-by: Ajesh K V <akv@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
292 lines
7.5 KiB
C
292 lines
7.5 KiB
C
/*
|
|
* Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
* to deal in the Software without restriction, including without limitation
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
* DEALINGS IN THE SOFTWARE.
|
|
*/
|
|
|
|
#ifndef CIC_PRIV_H
|
|
#define CIC_PRIV_H
|
|
|
|
#include <nvgpu/types.h>
|
|
|
|
struct gk20a;
|
|
struct nvgpu_err_hw_module;
|
|
struct nvgpu_err_msg;
|
|
struct gpu_err_header;
|
|
|
|
/*
|
|
* @file
|
|
*
|
|
* Declare CIC's private structure to store error-policy LUT and
|
|
* other data and ops needed during error reporting.
|
|
*/
|
|
|
|
#define ERR_INJECT_TEST_PATTERN 0xA5
|
|
|
|
/*
|
|
* This struct contains members related to error-policy look-up table,
|
|
* number of units reporting errors.
|
|
*/
|
|
struct nvgpu_cic {
|
|
/** Pointer for error look-up table. */
|
|
struct nvgpu_err_hw_module *err_lut;
|
|
|
|
/** Total number of GPU HW modules considered in CIC. */
|
|
u32 num_hw_modules;
|
|
|
|
};
|
|
|
|
/**
|
|
* @brief Inject ECC error.
|
|
*
|
|
* @param g [in] - The GPU driver struct.
|
|
* @param hw_unit [in] - Index of HW unit.
|
|
* @param err_index [in] - Error index.
|
|
* @param inst [in] - Instance ID.
|
|
*
|
|
* - Sets values for error address and error count.
|
|
* - Invokes error reporting API with the required set of inputs.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_inject_ecc_swerror(struct gk20a *g, u32 hw_unit,
|
|
u32 err_index, u32 inst);
|
|
|
|
/**
|
|
* @brief Inject HOST error.
|
|
*
|
|
* @param g [in] - The GPU driver struct.
|
|
* @param hw_unit [in] - Index of HW unit.
|
|
* @param err_index [in] - Error index.
|
|
* @param sub_err_type [in] - Sub error type.
|
|
*
|
|
* - Invokes error reporting API with the required set of inputs.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_inject_host_swerror(struct gk20a *g, u32 hw_unit,
|
|
u32 err_index, u32 sub_err_type);
|
|
|
|
/**
|
|
* @brief Inject GR error.
|
|
*
|
|
* @param g [in] - The GPU driver struct.
|
|
* @param hw_unit [in] - Index of HW unit.
|
|
* @param err_index [in] - Error index.
|
|
* @param sub_err_type [in] - Sub error type.
|
|
*
|
|
* - Sets values for GR exception and SM machine check error information.
|
|
* - Invokes error reporting API with the required set of inputs.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_inject_gr_swerror(struct gk20a *g, u32 hw_unit,
|
|
u32 err_index, u32 sub_err_type);
|
|
|
|
/**
|
|
* @brief Inject CE error.
|
|
*
|
|
* @param g [in] - The GPU driver struct.
|
|
* @param hw_unit [in] - Index of HW unit.
|
|
* @param err_index [in] - Error index.
|
|
* @param sub_err_type [in] - Sub error type.
|
|
*
|
|
* - Invokes error reporting API with the required set of inputs.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_inject_ce_swerror(struct gk20a *g, u32 hw_unit,
|
|
u32 err_index, u32 sub_err_type);
|
|
|
|
/**
|
|
* @brief Inject CE error.
|
|
*
|
|
* @param g [in] - The GPU driver struct.
|
|
* @param hw_unit [in] - Index of HW unit.
|
|
* @param err_index [in] - Error index.
|
|
* @param err_code [in] - Error code.
|
|
*
|
|
* - Invokes error reporting API with the required set of inputs.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_inject_pri_swerror(struct gk20a *g, u32 hw_unit,
|
|
u32 err_index, u32 err_code);
|
|
|
|
/**
|
|
* @brief Inject PMU error.
|
|
*
|
|
* @param g [in] - The GPU driver struct.
|
|
* @param hw_unit [in] - Index of HW unit.
|
|
* @param err_index [in] - Error index.
|
|
* @param sub_err_type [in] - Sub error type.
|
|
*
|
|
* - Sets values for error info.
|
|
* - Invokes error reporting API with the required set of inputs.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_inject_pmu_swerror(struct gk20a *g, u32 hw_unit,
|
|
u32 err_index, u32 sub_err_type);
|
|
|
|
/**
|
|
* @brief Inject CTXSW error.
|
|
*
|
|
* @param g [in] - The GPU driver struct.
|
|
* @param hw_unit [in] - Index of HW unit.
|
|
* @param err_index [in] - Error index.
|
|
* @param inst [in] - Instance ID.
|
|
*
|
|
* - Sets values for error info.
|
|
* - Invokes error reporting API with the required set of inputs.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_inject_ctxsw_swerror(struct gk20a *g, u32 hw_unit,
|
|
u32 err_index, u32 inst);
|
|
|
|
/**
|
|
* @brief Inject MMU error.
|
|
*
|
|
* @param g [in] - The GPU driver struct.
|
|
* @param hw_unit [in] - Index of HW unit.
|
|
* @param err_index [in] - Error index.
|
|
* @param sub_err_type [in] - Sub error type.
|
|
*
|
|
* - Sets values for mmu page fault info.
|
|
* - Invokes error reporting API with the required set of inputs.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_inject_mmu_swerror(struct gk20a *g, u32 hw_unit,
|
|
u32 err_index, u32 sub_err_type);
|
|
|
|
/**
|
|
* @brief Initialize error message header.
|
|
*
|
|
* @param header [in] - Error message header.
|
|
*
|
|
* This is used to initialize error message header.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_init_err_msg_header(struct gpu_err_header *header);
|
|
|
|
/**
|
|
* @brief Initialize error message.
|
|
*
|
|
* @param msg [in] - Error message.
|
|
*
|
|
* This is used to initialize error message that is common
|
|
* for all HW units.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_init_err_msg(struct nvgpu_err_msg *msg);
|
|
|
|
/**
|
|
* @brief Initialize error message for HOST unit.
|
|
*
|
|
* @param msg [in] - Error message.
|
|
*
|
|
* This is used to initialize error message that is specific to HOST unit.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_init_host_err_msg(struct nvgpu_err_msg *msg);
|
|
|
|
/**
|
|
* @brief Initialize ECC error message.
|
|
*
|
|
* @param msg [in] - Error message.
|
|
*
|
|
* This is used to initialize error message that is specific to ECC errors.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_init_ecc_err_msg(struct nvgpu_err_msg *msg);
|
|
|
|
/**
|
|
* @brief Initialize error message for PRI unit.
|
|
*
|
|
* @param msg [in] - Error message.
|
|
*
|
|
* This is used to initialize error message that is specific to PRI unit.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_init_pri_err_msg(struct nvgpu_err_msg *msg);
|
|
|
|
/**
|
|
* @brief Initialize error message for CE unit.
|
|
*
|
|
* @param msg [in] - Error message.
|
|
*
|
|
* This is used to initialize error message that is specific to CE unit.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_init_ce_err_msg(struct nvgpu_err_msg *msg);
|
|
|
|
/**
|
|
* @brief Initialize error message for PMU unit.
|
|
*
|
|
* @param msg [in] - Error message.
|
|
*
|
|
* This is used to initialize error message that is specific to PMU unit.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_init_pmu_err_msg(struct nvgpu_err_msg *msg);
|
|
|
|
/**
|
|
* @brief Initialize error message for GR unit.
|
|
*
|
|
* @param msg [in] - Error message.
|
|
*
|
|
* This is used to initialize error message that is specific to GR unit.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_init_gr_err_msg(struct nvgpu_err_msg *msg);
|
|
|
|
/**
|
|
* @brief Initialize error message for CTXSW.
|
|
*
|
|
* @param msg [in] - Error message.
|
|
*
|
|
* This is used to initialize error message that is specific to CTXSW.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_init_ctxsw_err_msg(struct nvgpu_err_msg *msg);
|
|
|
|
/**
|
|
* @brief Initialize error message for MMU unit.
|
|
*
|
|
* @param msg [in] - Error message.
|
|
*
|
|
* This is used to initialize error message that is specific to MMU unit.
|
|
*
|
|
* @return None
|
|
*/
|
|
void nvgpu_init_mmu_err_msg(struct nvgpu_err_msg *msg);
|
|
|
|
#endif /* CIC_PRIV_H */
|