Re: [PATCH v14 07/10] iommu/arm-smmu-v3: Maintain a SID->device structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +static int arm_smmu_insert_master(struct arm_smmu_device *smmu,
> +				  struct arm_smmu_master *master)
> +{
> +	int i;
> +	int ret = 0;
> +	struct arm_smmu_stream *new_stream, *cur_stream;
> +	struct rb_node **new_node, *parent_node = NULL;
> +	struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(master->dev);
> +
> +	master->streams = kcalloc(fwspec->num_ids, sizeof(*master->streams),
> +				  GFP_KERNEL);
> +	if (!master->streams)
> +		return -ENOMEM;
> +	master->num_streams = fwspec->num_ids;
> +
> +	mutex_lock(&smmu->streams_mutex);
> +	for (i = 0; i < fwspec->num_ids; i++) {

Hi all experts,

Recently, I have been debugging the smmuv3 code in the Linux kernel,
and I have some questions regarding the `mutex_lock(&smmu->streams_mutex)`
statement in the `arm_smmu_insert_master` function. 
I would like to understand why streams_mutex is being locked here. 
Is it to handle different types of PF under a single EP, each with its own device ID?

Thanks.





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux