CC: [email protected] CC: [email protected] TO: Nicolin Chen <[email protected]> CC: Will Deacon <[email protected]> CC: Dmitry Osipenko <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 2734d6c1b1a089fb593ef6a23d4b70903526fe0c commit: d5f583bf8654c231b781096bc1a186065cda72b3 iommu/tegra-smmu: Expand mutex protection range date: 8 months ago :::::: branch date: 18 hours ago :::::: commit date: 8 months ago config: arm64-randconfig-m031-20210719 (attached as .config) compiler: aarch64-linux-gcc (GCC) 10.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> smatch warnings: drivers/iommu/tegra-smmu.c:422 tegra_smmu_as_prepare() warn: missing error code 'err' vim +/err +422 drivers/iommu/tegra-smmu.c 7a31f6f48bb6e3 Hiroshi DOYU 2011-11-17 411 89184651631713 Thierry Reding 2014-04-16 412 static int tegra_smmu_as_prepare(struct tegra_smmu *smmu, 89184651631713 Thierry Reding 2014-04-16 413 struct tegra_smmu_as *as) 7a31f6f48bb6e3 Hiroshi DOYU 2011-11-17 414 { 89184651631713 Thierry Reding 2014-04-16 415 u32 value; d5f583bf8654c2 Nicolin Chen 2020-11-25 416 int err = 0; d5f583bf8654c2 Nicolin Chen 2020-11-25 417 d5f583bf8654c2 Nicolin Chen 2020-11-25 418 mutex_lock(&smmu->lock); 7a31f6f48bb6e3 Hiroshi DOYU 2011-11-17 419 89184651631713 Thierry Reding 2014-04-16 420 if (as->use_count > 0) { 89184651631713 Thierry Reding 2014-04-16 421 as->use_count++; d5f583bf8654c2 Nicolin Chen 2020-11-25 @422 goto unlock; 7a31f6f48bb6e3 Hiroshi DOYU 2011-11-17 423 } 7a31f6f48bb6e3 Hiroshi DOYU 2011-11-17 424 e3c971960fd41f Russell King 2015-07-27 425 as->pd_dma = dma_map_page(smmu->dev, as->pd, 0, SMMU_SIZE_PD, e3c971960fd41f Russell King 2015-07-27 426 DMA_TO_DEVICE); d5f583bf8654c2 Nicolin Chen 2020-11-25 427 if (dma_mapping_error(smmu->dev, as->pd_dma)) { d5f583bf8654c2 Nicolin Chen 2020-11-25 428 err = -ENOMEM; d5f583bf8654c2 Nicolin Chen 2020-11-25 429 goto unlock; d5f583bf8654c2 Nicolin Chen 2020-11-25 430 } e3c971960fd41f Russell King 2015-07-27 431 e3c971960fd41f Russell King 2015-07-27 432 /* We can't handle 64-bit DMA addresses */ e3c971960fd41f Russell King 2015-07-27 433 if (!smmu_dma_addr_valid(smmu, as->pd_dma)) { e3c971960fd41f Russell King 2015-07-27 434 err = -ENOMEM; e3c971960fd41f Russell King 2015-07-27 435 goto err_unmap; e3c971960fd41f Russell King 2015-07-27 436 } e3c971960fd41f Russell King 2015-07-27 437 89184651631713 Thierry Reding 2014-04-16 438 err = tegra_smmu_alloc_asid(smmu, &as->id); 89184651631713 Thierry Reding 2014-04-16 439 if (err < 0) e3c971960fd41f Russell King 2015-07-27 440 goto err_unmap; 7a31f6f48bb6e3 Hiroshi DOYU 2011-11-17 441 e3c971960fd41f Russell King 2015-07-27 442 smmu_flush_ptc(smmu, as->pd_dma, 0); 89184651631713 Thierry Reding 2014-04-16 443 smmu_flush_tlb_asid(smmu, as->id); 7a31f6f48bb6e3 Hiroshi DOYU 2011-11-17 444 89184651631713 Thierry Reding 2014-04-16 445 smmu_writel(smmu, as->id & 0x7f, SMMU_PTB_ASID); e3c971960fd41f Russell King 2015-07-27 446 value = SMMU_PTB_DATA_VALUE(as->pd_dma, as->attr); 89184651631713 Thierry Reding 2014-04-16 447 smmu_writel(smmu, value, SMMU_PTB_DATA); 89184651631713 Thierry Reding 2014-04-16 448 smmu_flush(smmu); 7a31f6f48bb6e3 Hiroshi DOYU 2011-11-17 449 89184651631713 Thierry Reding 2014-04-16 450 as->smmu = smmu; 89184651631713 Thierry Reding 2014-04-16 451 as->use_count++; 7a31f6f48bb6e3 Hiroshi DOYU 2011-11-17 452 d5f583bf8654c2 Nicolin Chen 2020-11-25 453 mutex_unlock(&smmu->lock); d5f583bf8654c2 Nicolin Chen 2020-11-25 454 89184651631713 Thierry Reding 2014-04-16 455 return 0; e3c971960fd41f Russell King 2015-07-27 456 e3c971960fd41f Russell King 2015-07-27 457 err_unmap: e3c971960fd41f Russell King 2015-07-27 458 dma_unmap_page(smmu->dev, as->pd_dma, SMMU_SIZE_PD, DMA_TO_DEVICE); d5f583bf8654c2 Nicolin Chen 2020-11-25 459 unlock: d5f583bf8654c2 Nicolin Chen 2020-11-25 460 mutex_unlock(&smmu->lock); d5f583bf8654c2 Nicolin Chen 2020-11-25 461 e3c971960fd41f Russell King 2015-07-27 462 return err; 7a31f6f48bb6e3 Hiroshi DOYU 2011-11-17 463 } 7a31f6f48bb6e3 Hiroshi DOYU 2011-11-17 464 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected]
.config.gz
Description: application/gzip
_______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
