tree: https://github.com/AsahiLinux/linux bits/020-t6000-dart head: 259619009267c0042a370b4296bc5208ed78e141 commit: 85a6a15d9e41fa68a42bf3df621ce24e15ea89ae [8/12] iommu: dart: Support >64 stream IDs config: arm-buildonly-randconfig-r002-20220925 compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi # https://github.com/AsahiLinux/linux/commit/85a6a15d9e41fa68a42bf3df621ce24e15ea89ae git remote add asahilinux https://github.com/AsahiLinux/linux git fetch --no-tags asahilinux bits/020-t6000-dart git checkout 85a6a15d9e41fa68a42bf3df621ce24e15ea89ae # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All errors (new ones prefixed by >>): >> drivers/iommu/apple-dart.c:345:41: error: incompatible pointer types passing 'atomic_long_t *' (aka 'atomic_t *') to parameter of type 'const atomic64_t *' [-Werror,-Wincompatible-pointer-types] stream_map.sidmap[j] = atomic64_read(&domain_stream_map->sidmap[j]); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/atomic/atomic-instrumented.h:644:33: note: passing argument to parameter 'v' here atomic64_read(const atomic64_t *v) ^ >> drivers/iommu/apple-dart.c:441:17: error: incompatible pointer types passing 'atomic_long_t *' (aka 'atomic_t *') to parameter of type 'atomic64_t *' [-Werror,-Wincompatible-pointer-types] atomic64_set(&dart_domain->stream_maps[i].sidmap[j], ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/atomic/atomic-instrumented.h:658:26: note: passing argument to parameter 'v' here atomic64_set(atomic64_t *v, s64 i) ^ drivers/iommu/apple-dart.c:490:10: error: incompatible pointer types passing 'atomic_long_t *' (aka 'atomic_t *') to parameter of type 'atomic64_t *' [-Werror,-Wincompatible-pointer-types] &domain_maps[i].sidmap[j]); ^~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/atomic/atomic-instrumented.h:1015:32: note: passing argument to parameter 'v' here atomic64_or(s64 i, atomic64_t *v) ^ drivers/iommu/apple-dart.c:493:11: error: incompatible pointer types passing 'atomic_long_t *' (aka 'atomic_t *') to parameter of type 'atomic64_t *' [-Werror,-Wincompatible-pointer-types] &domain_maps[i].sidmap[j]); ^~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/atomic/atomic-instrumented.h:941:33: note: passing argument to parameter 'v' here atomic64_and(s64 i, atomic64_t *v) ^ 4 errors generated. Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for TEGRA20_APB_DMA Depends on [n]: DMADEVICES [=n] && (ARCH_TEGRA [=y] || COMPILE_TEST [=y]) Selected by [y]: - SOC_TEGRA_FUSE [=y] && ARCH_TEGRA [=y] && ARCH_TEGRA_2x_SOC [=y] vim +345 drivers/iommu/apple-dart.c 334 335 static void apple_dart_domain_flush_tlb(struct apple_dart_domain *domain) 336 { 337 int i, j; 338 struct apple_dart_atomic_stream_map *domain_stream_map; 339 struct apple_dart_stream_map stream_map; 340 341 for_each_stream_map(i, domain, domain_stream_map) { 342 stream_map.dart = domain_stream_map->dart; 343 344 for (j = 0; j < BITS_TO_LONGS(stream_map.dart->num_streams); j++) > 345 stream_map.sidmap[j] = atomic64_read(&domain_stream_map->sidmap[j]); 346 347 apple_dart_hw_invalidate_tlb(&stream_map); 348 } 349 } 350 351 static void apple_dart_flush_iotlb_all(struct iommu_domain *domain) 352 { 353 apple_dart_domain_flush_tlb(to_dart_domain(domain)); 354 } 355 356 static void apple_dart_iotlb_sync(struct iommu_domain *domain, 357 struct iommu_iotlb_gather *gather) 358 { 359 apple_dart_domain_flush_tlb(to_dart_domain(domain)); 360 } 361 362 static void apple_dart_iotlb_sync_map(struct iommu_domain *domain, 363 unsigned long iova, size_t size) 364 { 365 apple_dart_domain_flush_tlb(to_dart_domain(domain)); 366 } 367 368 static phys_addr_t apple_dart_iova_to_phys(struct iommu_domain *domain, 369 dma_addr_t iova) 370 { 371 struct apple_dart_domain *dart_domain = to_dart_domain(domain); 372 struct io_pgtable_ops *ops = dart_domain->pgtbl_ops; 373 374 if (!ops) 375 return 0; 376 377 return ops->iova_to_phys(ops, iova); 378 } 379 380 static int apple_dart_map_pages(struct iommu_domain *domain, unsigned long iova, 381 phys_addr_t paddr, size_t pgsize, 382 size_t pgcount, int prot, gfp_t gfp, 383 size_t *mapped) 384 { 385 struct apple_dart_domain *dart_domain = to_dart_domain(domain); 386 struct io_pgtable_ops *ops = dart_domain->pgtbl_ops; 387 388 if (!ops) 389 return -ENODEV; 390 391 return ops->map_pages(ops, iova, paddr, pgsize, pgcount, prot, gfp, 392 mapped); 393 } 394 395 static size_t apple_dart_unmap_pages(struct iommu_domain *domain, 396 unsigned long iova, size_t pgsize, 397 size_t pgcount, 398 struct iommu_iotlb_gather *gather) 399 { 400 struct apple_dart_domain *dart_domain = to_dart_domain(domain); 401 struct io_pgtable_ops *ops = dart_domain->pgtbl_ops; 402 403 return ops->unmap_pages(ops, iova, pgsize, pgcount, gather); 404 } 405 406 static void 407 apple_dart_setup_translation(struct apple_dart_domain *domain, 408 struct apple_dart_stream_map *stream_map) 409 { 410 int i; 411 struct io_pgtable_cfg *pgtbl_cfg = 412 &io_pgtable_ops_to_pgtable(domain->pgtbl_ops)->cfg; 413 414 for (i = 0; i < pgtbl_cfg->apple_dart_cfg.n_ttbrs; ++i) 415 apple_dart_hw_set_ttbr(stream_map, i, 416 pgtbl_cfg->apple_dart_cfg.ttbr[i]); 417 for (; i < DART_MAX_TTBR; ++i) 418 apple_dart_hw_clear_ttbr(stream_map, i); 419 420 apple_dart_hw_enable_translation(stream_map); 421 apple_dart_hw_invalidate_tlb(stream_map); 422 } 423 424 static int apple_dart_finalize_domain(struct iommu_domain *domain, 425 struct apple_dart_master_cfg *cfg) 426 { 427 struct apple_dart_domain *dart_domain = to_dart_domain(domain); 428 struct apple_dart *dart = cfg->stream_maps[0].dart; 429 struct io_pgtable_cfg pgtbl_cfg; 430 int ret = 0; 431 int i, j; 432 433 mutex_lock(&dart_domain->init_lock); 434 435 if (dart_domain->finalized) 436 goto done; 437 438 for (i = 0; i < MAX_DARTS_PER_DEVICE; ++i) { 439 dart_domain->stream_maps[i].dart = cfg->stream_maps[i].dart; 440 for (j = 0; j < BITS_TO_LONGS(dart->num_streams); j++) > 441 atomic64_set(&dart_domain->stream_maps[i].sidmap[j], 442 cfg->stream_maps[i].sidmap[j]); 443 } 444 445 pgtbl_cfg = (struct io_pgtable_cfg){ 446 .pgsize_bitmap = dart->pgsize, 447 .ias = 32, 448 .oas = dart->hw->oas, 449 .coherent_walk = 1, 450 .iommu_dev = dart->dev, 451 }; 452 453 dart_domain->pgtbl_ops = 454 alloc_io_pgtable_ops(dart->hw->fmt, &pgtbl_cfg, domain); 455 if (!dart_domain->pgtbl_ops) { 456 ret = -ENOMEM; 457 goto done; 458 } 459 460 domain->pgsize_bitmap = pgtbl_cfg.pgsize_bitmap; 461 domain->geometry.aperture_start = 0; 462 domain->geometry.aperture_end = DMA_BIT_MASK(32); 463 domain->geometry.force_aperture = true; 464 465 dart_domain->finalized = true; 466 467 done: 468 mutex_unlock(&dart_domain->init_lock); 469 return ret; 470 } 471 -- 0-DAY CI Kernel Test Service https://01.org/lkp