Loading drivers/cam_smmu/cam_smmu_api.c +25 −1 Original line number Original line Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only /* /* * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. */ */ #include <linux/module.h> #include <linux/module.h> Loading Loading @@ -133,6 +133,7 @@ struct cam_context_bank_info { bool is_fw_allocated; bool is_fw_allocated; bool is_secheap_allocated; bool is_secheap_allocated; bool is_qdss_allocated; bool is_qdss_allocated; bool stall_disable; struct scratch_mapping scratch_map; struct scratch_mapping scratch_map; struct gen_pool *shared_mem_pool; struct gen_pool *shared_mem_pool; Loading Loading @@ -3641,6 +3642,8 @@ static int cam_smmu_setup_cb(struct cam_context_bank_info *cb, struct device *dev) struct device *dev) { { int rc = 0; int rc = 0; int32_t stall_disable = 1; int32_t hupcf = 1; if (!cb || !dev) { if (!cb || !dev) { CAM_ERR(CAM_SMMU, "Error: invalid input params"); CAM_ERR(CAM_SMMU, "Error: invalid input params"); Loading Loading @@ -3708,6 +3711,24 @@ static int cam_smmu_setup_cb(struct cam_context_bank_info *cb, cb->discard_iova_len); cb->discard_iova_len); cb->state = CAM_SMMU_ATTACH; cb->state = CAM_SMMU_ATTACH; if (cb->stall_disable) { if (iommu_domain_set_attr(cb->domain, DOMAIN_ATTR_FAULT_MODEL_NO_STALL, &stall_disable) < 0) { CAM_ERR(CAM_SMMU, "Error: failed to set cb stall disable for node: %s", cb->name[0]); } if (iommu_domain_set_attr(cb->domain, DOMAIN_ATTR_FAULT_MODEL_HUPCF, &hupcf) < 0) { CAM_ERR(CAM_SMMU, "Error: failed to set attribute HUPCF for node: %s", cb->name[0]); } } } else { } else { CAM_ERR(CAM_SMMU, "Context bank does not have IO region"); CAM_ERR(CAM_SMMU, "Context bank does not have IO region"); rc = -ENODEV; rc = -ENODEV; Loading Loading @@ -4046,6 +4067,9 @@ static int cam_populate_smmu_context_banks(struct device *dev, cb->num_shared_hdl = of_property_count_strings(dev->of_node, cb->num_shared_hdl = of_property_count_strings(dev->of_node, "cam-smmu-label"); "cam-smmu-label"); cb->stall_disable = of_property_read_bool(dev->of_node, "stall-disable"); if (cb->num_shared_hdl > if (cb->num_shared_hdl > CAM_SMMU_SHARED_HDL_MAX) { CAM_SMMU_SHARED_HDL_MAX) { CAM_ERR(CAM_CDM, "Invalid count of client names count=%d", CAM_ERR(CAM_CDM, "Invalid count of client names count=%d", Loading Loading
drivers/cam_smmu/cam_smmu_api.c +25 −1 Original line number Original line Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only /* /* * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. */ */ #include <linux/module.h> #include <linux/module.h> Loading Loading @@ -133,6 +133,7 @@ struct cam_context_bank_info { bool is_fw_allocated; bool is_fw_allocated; bool is_secheap_allocated; bool is_secheap_allocated; bool is_qdss_allocated; bool is_qdss_allocated; bool stall_disable; struct scratch_mapping scratch_map; struct scratch_mapping scratch_map; struct gen_pool *shared_mem_pool; struct gen_pool *shared_mem_pool; Loading Loading @@ -3641,6 +3642,8 @@ static int cam_smmu_setup_cb(struct cam_context_bank_info *cb, struct device *dev) struct device *dev) { { int rc = 0; int rc = 0; int32_t stall_disable = 1; int32_t hupcf = 1; if (!cb || !dev) { if (!cb || !dev) { CAM_ERR(CAM_SMMU, "Error: invalid input params"); CAM_ERR(CAM_SMMU, "Error: invalid input params"); Loading Loading @@ -3708,6 +3711,24 @@ static int cam_smmu_setup_cb(struct cam_context_bank_info *cb, cb->discard_iova_len); cb->discard_iova_len); cb->state = CAM_SMMU_ATTACH; cb->state = CAM_SMMU_ATTACH; if (cb->stall_disable) { if (iommu_domain_set_attr(cb->domain, DOMAIN_ATTR_FAULT_MODEL_NO_STALL, &stall_disable) < 0) { CAM_ERR(CAM_SMMU, "Error: failed to set cb stall disable for node: %s", cb->name[0]); } if (iommu_domain_set_attr(cb->domain, DOMAIN_ATTR_FAULT_MODEL_HUPCF, &hupcf) < 0) { CAM_ERR(CAM_SMMU, "Error: failed to set attribute HUPCF for node: %s", cb->name[0]); } } } else { } else { CAM_ERR(CAM_SMMU, "Context bank does not have IO region"); CAM_ERR(CAM_SMMU, "Context bank does not have IO region"); rc = -ENODEV; rc = -ENODEV; Loading Loading @@ -4046,6 +4067,9 @@ static int cam_populate_smmu_context_banks(struct device *dev, cb->num_shared_hdl = of_property_count_strings(dev->of_node, cb->num_shared_hdl = of_property_count_strings(dev->of_node, "cam-smmu-label"); "cam-smmu-label"); cb->stall_disable = of_property_read_bool(dev->of_node, "stall-disable"); if (cb->num_shared_hdl > if (cb->num_shared_hdl > CAM_SMMU_SHARED_HDL_MAX) { CAM_SMMU_SHARED_HDL_MAX) { CAM_ERR(CAM_CDM, "Invalid count of client names count=%d", CAM_ERR(CAM_CDM, "Invalid count of client names count=%d", Loading