Merge "defconfig: pineapple: Enable fastmap"

This commit is contained in:
qctecmdr 2022-11-22 14:31:25 -08:00 committed by Gerrit - the friendly Code Review server
commit d18ebfc7cd
7 changed files with 27 additions and 6 deletions

View File

@ -2099,6 +2099,7 @@
__tracepoint_android_rvh_find_lowest_rq
__tracepoint_android_rvh_flush_task
__tracepoint_android_rvh_get_nohz_timer_target
__tracepoint_android_rvh_iommu_setup_dma_ops
__tracepoint_android_rvh_is_cpu_allowed
__tracepoint_android_rvh_migrate_queued_task
__tracepoint_android_rvh_new_task_stats

View File

@ -45,6 +45,7 @@ CONFIG_INPUT_QCOM_HV_HAPTICS=m
CONFIG_INTERCONNECT_QCOM_DEBUG=m
CONFIG_INTERCONNECT_QCOM_PINEAPPLE=m
CONFIG_INTERCONNECT_TEST=m
CONFIG_IOMMU_IO_PGTABLE_FAST=y
CONFIG_IPA3=m
CONFIG_IPC_LOGGING=m
CONFIG_IPC_LOG_MINIDUMP_BUFFERS=0

View File

@ -980,7 +980,7 @@ static void fast_smmu_reserve_iommu_regions(struct device *dev,
bitmap_set(fast->clean_bitmap, lo, hi - lo + 1);
}
spin_unlock_irqrestore(&mapping->lock, flags);
qcom_iommu_put_resv_regions(dev, &resv_regions);
iommu_put_resv_regions(dev, &resv_regions);
fast_smmu_reserve_msi_iova(dev, fast);
}
@ -992,8 +992,6 @@ void fast_smmu_put_dma_cookie(struct iommu_domain *domain)
if (!fast)
return;
iommu_put_dma_cookie(domain);
if (fast->iovad) {
put_iova_domain(fast->iovad);
kfree(fast->iovad);

View File

@ -1203,6 +1203,22 @@ static int iommu_debug_functional_fast_dma_api_show(struct seq_file *s,
void *ignored)
{
int ret = 0;
struct iommu_debug_device *ddev = s->private;
if (!ddev->test_dev) {
pr_err("%s:Have you selected a uscase?\n", __func__);
return -EINVAL;
}
if (!ddev->fastmap_usecase) {
ps_printf(dev_name(ddev->test_dev), s,
"Not a fastmap usecase\n");
return 0;
} else if (!IS_ENABLED(CONFIG_IOMMU_IO_PGTABLE_FAST)) {
ps_printf(dev_name(ddev->test_dev), s,
"CONFIG_IOMMU_IO_PGTABLE_FAST not enabled\n");
return 0;
}
ret |= __apply_to_new_mapping(s, __functional_dma_api_alloc_test, NULL);
ret |= __apply_to_new_mapping(s, __functional_dma_api_basic_test, NULL);

View File

@ -133,6 +133,7 @@ iommu_debug_switch_usecase(struct iommu_debug_device *ddev, u32 usecase_nr)
{
struct platform_device *test_pdev;
struct device_node *child;
const char *str;
int child_nr = 0;
int ret;
@ -169,6 +170,10 @@ iommu_debug_switch_usecase(struct iommu_debug_device *ddev, u32 usecase_nr)
goto out;
}
if (of_property_read_string(child, "qcom,iommu-dma", &str))
str = "default";
ddev->fastmap_usecase = !strcmp(str, "fastmap");
ddev->usecase_nr = usecase_nr;
ddev->test_dev = &test_pdev->dev;
ddev->domain = iommu_get_domain_for_dev(ddev->test_dev);

View File

@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
*
* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef __DRIVERS_IOMMU_QCOM_IOMMU_DEBUG_H__
@ -26,6 +26,7 @@ struct iommu_debug_device {
struct device *test_dev;
struct iommu_domain *domain;
u32 usecase_nr;
bool fastmap_usecase;
/* Protects test_dev */
struct mutex state_lock;
/* For waiting for child probe to complete */

View File

@ -112,9 +112,8 @@ int qcom_iommu_get_fast_iova_range(struct device *dev,
dma_addr_t *ret_iova_base,
dma_addr_t *ret_iova_end);
/* Remove once these functions are exported by upstream kernel */
/* Remove once this function is exported by upstream kernel */
void qcom_iommu_get_resv_regions(struct device *dev, struct list_head *list);
void qcom_iommu_put_resv_regions(struct device *dev, struct list_head *list);
phys_addr_t qcom_iommu_iova_to_phys_hard(struct iommu_domain *domain,
struct qcom_iommu_atos_txn *txn);