msm: camera: common: Page Fault notification to userspace
Upon Page Fault, smmu driver invokes faulted client's callback which looks for faulted buffer and context. The client driver can be ISP, ICP, JPEG, IFE CDM and CPAS CDM. The driver then fills PF msg struct, logs related info, and notify PF msg to userspace. Userspace is expected to abort and calls to shut down kernel drivers. When Titan powers on next session, CAMSS undergoes async reset. This change also ensures the page fault related changes added to TFE, OPE, CRE do not break the drivers compilation. CRs-Fixed: 3156671 Change-Id: Icd6c8c9a38cac206fe8260d374d03964fb280879 Signed-off-by: sokchetra eung <quic_eung@quicinc.com>
This commit is contained in:

committed by
Camera Software Integration

parent
d43146eb4f
commit
c52c83e7ce
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/delay.h>
|
||||
@@ -20,6 +21,7 @@
|
||||
#include "cam_smmu_api.h"
|
||||
#include "camera_main.h"
|
||||
#include "cam_common_util.h"
|
||||
#include "cam_context_utils.h"
|
||||
|
||||
static struct cam_isp_dev g_isp_dev;
|
||||
|
||||
@@ -38,20 +40,35 @@ static int cam_isp_dev_err_inject_cb(void *err_param)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static void cam_isp_dev_iommu_fault_handler(struct cam_smmu_pf_info *pf_info)
|
||||
static void cam_isp_dev_iommu_fault_handler(struct cam_smmu_pf_info *pf_smmu_info)
|
||||
{
|
||||
int i = 0;
|
||||
int i, rc;
|
||||
struct cam_node *node = NULL;
|
||||
struct cam_hw_dump_pf_args pf_args = {0};
|
||||
|
||||
if (!pf_info || !pf_info->token) {
|
||||
if (!pf_smmu_info || !pf_smmu_info->token) {
|
||||
CAM_ERR(CAM_ISP, "invalid token in page handler cb");
|
||||
return;
|
||||
}
|
||||
|
||||
node = (struct cam_node *)pf_info->token;
|
||||
node = (struct cam_node *)pf_smmu_info->token;
|
||||
|
||||
for (i = 0; i < node->ctx_size; i++)
|
||||
cam_context_dump_pf_info(&(node->ctx_list[i]), pf_info);
|
||||
pf_args.pf_smmu_info = pf_smmu_info;
|
||||
|
||||
for (i = 0; i < node->ctx_size; i++) {
|
||||
cam_context_dump_pf_info(&(node->ctx_list[i]), &pf_args);
|
||||
if (pf_args.pf_context_info.ctx_found)
|
||||
/* Faulted ctx found */
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == node->ctx_size) {
|
||||
/* Faulted ctx not found. Report PF to userspace */
|
||||
rc = cam_context_send_pf_evt(NULL, &pf_args);
|
||||
if (rc)
|
||||
CAM_ERR(CAM_ISP,
|
||||
"Failed to notify PF event to userspace rc: %d", rc);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct of_device_id cam_isp_dt_match[] = {
|
||||
|
Reference in New Issue
Block a user