msm: camera: req_mgr: LDAR Debug framework implementation

When user space detects an error or does not receive
response for a request, Lets do a reset(LDAR) is triggered.
Before LDAR, user space sends flush command to the
kernel space.
To debug the cause for this situation and to dump
the information, user space sends a dump command to the
kernel space before sending flush.
As a part of this command, it passes the culprit request id
and the buffer into which the information can be dumped.
Kernel space traverses across the drivers and find the culprit hw
and dumps the relevant information in the buffer.
This data is written to a file for offline processing.
This commit implements the framework for traversal
across the RT and NRT devices.

CRs-Fixed: 2602180
Change-Id: I7e24006c20c23bfab163a2ad13b4ac6e2913bb9e
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
This commit is contained in:
Gaurav Jindal
2019-10-14 15:08:23 +05:30
committed by Gerrit - the friendly Code Review server
parent 14b75bff2d
commit d95d140d40
12 changed files with 477 additions and 1 deletions

View File

@@ -26,6 +26,7 @@
#define CAM_COMMON_OPCODE_BASE_v2 0x150
#define CAM_ACQUIRE_HW (CAM_COMMON_OPCODE_BASE_v2 + 0x1)
#define CAM_RELEASE_HW (CAM_COMMON_OPCODE_BASE_v2 + 0x2)
#define CAM_DUMP_REQ (CAM_COMMON_OPCODE_BASE_v2 + 0x3)
#define CAM_EXT_OPCODE_BASE 0x200
#define CAM_CONFIG_DEV_EXTERNAL (CAM_EXT_OPCODE_BASE + 0x1)
@@ -868,5 +869,26 @@ struct cam_reg_dump_input_info {
uint32_t dump_set_offsets[1];
};
/**
* struct cam_dump_req_cmd -
* Dump the information of issue req id
*
* @issue_req_id : Issue Request Id
* @offset : Offset for the buffer
* @buf_handle : Buffer Handle
* @error_type : Error type, using it, dumping information can be extended
* @session_handle : Session Handle
* @link_hdl : link handle
* @dev_handle : Device Handle
*/
struct cam_dump_req_cmd {
uint64_t issue_req_id;
size_t offset;
uint32_t buf_handle;
uint32_t error_type;
int32_t session_handle;
int32_t link_hdl;
int32_t dev_handle;
};
#endif /* __UAPI_CAM_DEFS_H__ */

View File

@@ -262,6 +262,8 @@ struct cam_req_mgr_link_control {
#define CAM_REQ_MGR_CACHE_OPS (CAM_COMMON_OPCODE_MAX + 12)
#define CAM_REQ_MGR_LINK_CONTROL (CAM_COMMON_OPCODE_MAX + 13)
#define CAM_REQ_MGR_LINK_V2 (CAM_COMMON_OPCODE_MAX + 14)
#define CAM_REQ_MGR_REQUEST_DUMP (CAM_COMMON_OPCODE_MAX + 15)
/* end of cam_req_mgr opcodes */
#define CAM_MEM_FLAG_HW_READ_WRITE (1<<0)