tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 3b421b6002e287e38790cbdad4a3e08baf7e1bc4 commit: 22129ea1b367d0101df8cc4a837b3f773021e556 [3272/10596] iommu/arm-smmu-v3: Add support for less than one ECMDQ per core config: arm64-randconfig-r131-20240707 (https://download.01.org/0day-ci/archive/20240708/202407080858.aAMctg7p-lkp@i...) compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project a0c6b8aef853eedaa0980f07c0a502a5a8a9740e) reproduce: (https://download.01.org/0day-ci/archive/20240708/202407080858.aAMctg7p-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202407080858.aAMctg7p-lkp@intel.com/
sparse warnings: (new ones prefixed by >>) drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c:4084:15: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct arm_smmu_ecmdq *ecmdq @@ got struct arm_smmu_ecmdq [noderef] __percpu * @@ drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c:4084:15: sparse: expected struct arm_smmu_ecmdq *ecmdq drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c:4084:15: sparse: got struct arm_smmu_ecmdq [noderef] __percpu *
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c:4087:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct arm_smmu_ecmdq [noderef] __percpu *ecmdq @@ got struct arm_smmu_ecmdq *ecmdq @@
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c:4087:21: sparse: expected struct arm_smmu_ecmdq [noderef] __percpu *ecmdq drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c:4087:21: sparse: got struct arm_smmu_ecmdq *ecmdq drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c:4124:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const *addr @@ got void [noderef] __iomem *base @@ drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c:4124:45: sparse: expected void const *addr drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c:4124:45: sparse: got void [noderef] __iomem *base drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c: note: in included file (through arch/arm64/include/asm/atomic.h, include/linux/atomic.h, include/asm-generic/bitops/atomic.h, ...): arch/arm64/include/asm/cmpxchg.h:168:1: sparse: sparse: cast truncates bits from constant value (ffffffff80000000 becomes 0) arch/arm64/include/asm/cmpxchg.h:168:1: sparse: sparse: cast truncates bits from constant value (ffffffff80000000 becomes 0)
vim +4087 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
4077 4078 #ifdef CONFIG_ARM_SMMU_V3_ECMDQ 4079 static int arm_smmu_ecmdq_layout(struct arm_smmu_device *smmu) 4080 { 4081 int cpu, host_cpu; 4082 struct arm_smmu_ecmdq *ecmdq; 4083
4084 ecmdq = devm_alloc_percpu(smmu->dev, *ecmdq);
4085 if (!ecmdq) 4086 return -ENOMEM;
4087 smmu->ecmdq = ecmdq;
4088 4089 /* A core requires at most one ECMDQ */ 4090 if (num_possible_cpus() < smmu->nr_ecmdq) 4091 smmu->nr_ecmdq = num_possible_cpus(); 4092 4093 for_each_possible_cpu(cpu) { 4094 if (cpu < smmu->nr_ecmdq) { 4095 *per_cpu_ptr(smmu->ecmdqs, cpu) = per_cpu_ptr(smmu->ecmdq, cpu); 4096 } else { 4097 host_cpu = cpu % smmu->nr_ecmdq; 4098 ecmdq = per_cpu_ptr(smmu->ecmdq, host_cpu); 4099 ecmdq->cmdq.shared = 1; 4100 *per_cpu_ptr(smmu->ecmdqs, cpu) = ecmdq; 4101 } 4102 } 4103 4104 return 0; 4105 } 4106