mirror of
https://github.com/torvalds/linux.git
synced 2026-07-29 18:51:21 +02:00
Merge "qcom-iommu-util: Introduce qcom_iommu_get_asid_nr()"
This commit is contained in:
commit
d835cb2d8b
|
|
@ -14,7 +14,7 @@
|
|||
* - Context fault reporting
|
||||
* - Extended Stream ID (16 bit)
|
||||
*
|
||||
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2021-2022, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) "arm-smmu: " fmt
|
||||
|
|
@ -2678,6 +2678,20 @@ static int arm_smmu_get_context_bank_nr(struct iommu_domain *domain)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int arm_smmu_get_asid_nr(struct iommu_domain *domain)
|
||||
{
|
||||
struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
|
||||
int ret;
|
||||
|
||||
mutex_lock(&smmu_domain->init_mutex);
|
||||
if (!smmu_domain->smmu)
|
||||
ret = -EINVAL;
|
||||
else
|
||||
ret = smmu_domain->cfg.asid;
|
||||
mutex_unlock(&smmu_domain->init_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int arm_smmu_set_secure_vmid(struct iommu_domain *domain, enum vmid vmid)
|
||||
{
|
||||
struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
|
||||
|
|
@ -2770,6 +2784,7 @@ static struct qcom_iommu_ops arm_smmu_ops = {
|
|||
.sid_switch = arm_smmu_sid_switch,
|
||||
.get_fault_ids = arm_smmu_get_fault_ids,
|
||||
.get_context_bank_nr = arm_smmu_get_context_bank_nr,
|
||||
.get_asid_nr = arm_smmu_get_asid_nr,
|
||||
.set_secure_vmid = arm_smmu_set_secure_vmid,
|
||||
.set_fault_model = arm_smmu_set_fault_model,
|
||||
.enable_s1_translation = arm_smmu_enable_s1_translation,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/dma-mapping-fast.h>
|
||||
|
|
@ -359,6 +360,17 @@ int qcom_iommu_get_context_bank_nr(struct iommu_domain *domain)
|
|||
}
|
||||
EXPORT_SYMBOL(qcom_iommu_get_context_bank_nr);
|
||||
|
||||
int qcom_iommu_get_asid_nr(struct iommu_domain *domain)
|
||||
{
|
||||
struct qcom_iommu_ops *ops = to_qcom_iommu_ops(domain->ops);
|
||||
|
||||
if (unlikely(ops->get_asid_nr == NULL))
|
||||
return -EINVAL;
|
||||
|
||||
return ops->get_asid_nr(domain);
|
||||
}
|
||||
EXPORT_SYMBOL(qcom_iommu_get_asid_nr);
|
||||
|
||||
int qcom_iommu_set_secure_vmid(struct iommu_domain *domain, enum vmid vmid)
|
||||
{
|
||||
struct qcom_iommu_ops *ops = to_qcom_iommu_ops(domain->ops);
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ struct qcom_iommu_ops {
|
|||
int (*get_fault_ids)(struct iommu_domain *domain,
|
||||
struct qcom_iommu_fault_ids *ids);
|
||||
int (*get_context_bank_nr)(struct iommu_domain *domain);
|
||||
int (*get_asid_nr)(struct iommu_domain *domain);
|
||||
int (*set_secure_vmid)(struct iommu_domain *domain, enum vmid vmid);
|
||||
int (*set_fault_model)(struct iommu_domain *domain, int fault_model);
|
||||
int (*enable_s1_translation)(struct iommu_domain *domain);
|
||||
|
|
@ -126,6 +127,8 @@ extern int qcom_iommu_get_msi_size(struct device *dev, u32 *msi_size);
|
|||
|
||||
int qcom_iommu_get_context_bank_nr(struct iommu_domain *domain);
|
||||
|
||||
int qcom_iommu_get_asid_nr(struct iommu_domain *domain);
|
||||
|
||||
int qcom_iommu_set_secure_vmid(struct iommu_domain *domain, enum vmid vmid);
|
||||
|
||||
int qcom_iommu_set_fault_model(struct iommu_domain *domain, int fault_model);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user