msm: camera: smmu: IOMMU fault id's API update

Need to update API's provided by memory team for retreiving fault id's when an
SMMU translation fault occurs for the new kernel version.

CRs-Fixed: 2835738
Change-Id: I061914ce01196fd1271c8a466f6a4ef8e6dce28f
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
This commit is contained in:
Karthik Jayakumar
2020-11-02 16:42:11 -08:00
parent 54fbe81f3b
commit bc04b3a8ef
3 changed files with 43 additions and 12 deletions

View File

@@ -248,3 +248,38 @@ int camera_component_match_add_drivers(struct device *master_dev,
end:
return rc;
}
#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
#include <linux/qcom-iommu-util.h>
void cam_check_iommu_faults(struct iommu_domain *domain,
struct cam_smmu_pf_info *pf_info)
{
struct qcom_iommu_fault_ids fault_ids = {0, 0, 0};
if (qcom_iommu_get_fault_ids(domain, &fault_ids))
CAM_ERR(CAM_SMMU, "Cannot get smmu fault ids");
else
CAM_ERR(CAM_SMMU, "smmu fault ids bid:%d pid:%d mid:%d",
fault_ids.bid, fault_ids.pid, fault_ids.mid);
pf_info->bid = fault_ids.bid;
pf_info->pid = fault_ids.pid;
pf_info->mid = fault_ids.mid;
}
#else
void cam_check_iommu_faults(struct iommu_domain *domain,
struct cam_smmu_pf_info *pf_info)
{
struct iommu_fault_ids fault_ids = {0, 0, 0};
if (iommu_get_fault_ids(domain, &fault_ids))
CAM_ERR(CAM_SMMU, "Error: Can not get smmu fault ids");
CAM_ERR(CAM_SMMU, "smmu fault ids bid:%d pid:%d mid:%d",
fault_ids.bid, fault_ids.pid, fault_ids.mid);
pf_info->bid = fault_ids.bid;
pf_info->pid = fault_ids.pid;
pf_info->mid = fault_ids.mid;
}
#endif

View File

@@ -12,6 +12,7 @@
#include "cam_csiphy_dev.h"
#include "cam_cpastop_hw.h"
#include "cam_smmu_api.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 7, 0)
@@ -22,6 +23,7 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
#include <linux/msm_ion.h>
#include <linux/iommu.h>
#include <linux/ion.h>
#include <linux/qcom_scm.h>
@@ -48,5 +50,7 @@ int camera_component_match_add_drivers(struct device *master_dev,
int cam_csiphy_notify_secure_mode(struct csiphy_device *csiphy_dev,
bool protect, int32_t offset);
void cam_free_clear(const void *);
void cam_check_iommu_faults(struct iommu_domain *domain,
struct cam_smmu_pf_info *pf_info);
#endif /* _CAM_COMPAT_H_ */