msm: camera: smmu: Fix misunderstanding buffer handle in smmu log

When smmu page fault happen, buffer handle in smmu log
is always not identified due to using the index defined
in smmu. The index is smmu client index, buffer handle
should use the index defined in memory.

CRs-Fixed: 3096436
Change-Id: I69e5014c88ec507e31c6394564fb1990f5ae2d25
Signed-off-by: zhuo <quic_zhuo@quicinc.com>
This commit is contained in:
zhuo
2021-12-17 16:51:56 +08:00
gecommit door Camera Software Integration
bovenliggende f0d04ce780
commit 8f2d538d47
3 gewijzigde bestanden met toevoegingen van 7 en 8 verwijderingen

Bestand weergeven

@@ -2415,7 +2415,7 @@ static void cam_cre_mgr_print_io_bufs(struct cam_packet *packet,
break;
if (GET_FD_FROM_HANDLE(io_cfg[i].mem_handle[j]) ==
GET_FD_FROM_HANDLE(pf_buf_info)) {
pf_buf_info) {
CAM_INFO(CAM_CRE,
"Found PF at port: %d mem %x fd: %x",
io_cfg[i].resource_type,

Bestand weergeven

@@ -5473,7 +5473,7 @@ static void cam_icp_mgr_print_io_bufs(struct cam_packet *packet,
break;
if (GET_FD_FROM_HANDLE(io_cfg[i].mem_handle[j]) ==
GET_FD_FROM_HANDLE(pf_buf_info)) {
pf_buf_info) {
CAM_INFO(CAM_ICP,
"Found PF at port: %d mem %x fd: %x",
io_cfg[i].resource_type,

Bestand weergeven

@@ -679,7 +679,7 @@ static uint32_t cam_smmu_find_closest_mapping(int idx, void *vaddr)
{
struct cam_dma_buff_info *mapping, *closest_mapping = NULL;
unsigned long start_addr, end_addr, current_addr;
uint32_t buf_handle = 0;
uint32_t buf_info = 0;
long delta = 0, lowest_delta = 0;
@@ -716,21 +716,20 @@ static uint32_t cam_smmu_find_closest_mapping(int idx, void *vaddr)
end:
if (closest_mapping) {
buf_handle = GET_MEM_HANDLE(idx, closest_mapping->ion_fd);
buf_info = closest_mapping->ion_fd;
CAM_INFO(CAM_SMMU,
"Closest map fd %d i_ino %lu 0x%lx %llu-%llu 0x%lx-0x%lx buf=%pK mem %0x",
"Closest map fd %d i_ino %lu 0x%lx %llu-%llu 0x%lx-0x%lx buf=%pK",
closest_mapping->ion_fd, closest_mapping->i_ino, current_addr,
mapping->len, closest_mapping->len,
(unsigned long)closest_mapping->paddr,
(unsigned long)closest_mapping->paddr + mapping->len,
closest_mapping->buf,
buf_handle);
closest_mapping->buf);
} else
CAM_ERR(CAM_SMMU,
"Cannot find vaddr:%lx in SMMU %s virt address",
current_addr, iommu_cb_set.cb_info[idx].name[0]);
return buf_handle;
return buf_info;
}
void cam_smmu_set_client_page_fault_handler(int handle,