CC: [email protected] CC: [email protected] TO: Dmitry Osipenko <[email protected]> CC: Joerg Roedel <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 23859ae44402f4d935b9ee548135dd1e65e2cbf4 commit: 404d0b308e4f730b1c9b2f33e84a6f7069db94c5 iommu/tegra-smmu: Add locking around mapping operations date: 8 weeks ago :::::: branch date: 6 hours ago :::::: commit date: 8 weeks ago config: arm64-randconfig-s032-20201029 (attached as .config) compiler: aarch64-linux-gcc (GCC) 9.3.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.3-56-gc09e8239-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=404d0b308e4f730b1c9b2f33e84a6f7069db94c5 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout 404d0b308e4f730b1c9b2f33e84a6f7069db94c5 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> "sparse warnings: (new ones prefixed by >>)" >> drivers/iommu/tegra-smmu.c:687:9: sparse: sparse: context imbalance in >> 'as_get_pde_page' - different lock contexts for basic block vim +/as_get_pde_page +687 drivers/iommu/tegra-smmu.c 8482ee5ea109744 Russell King 2015-07-27 657 404d0b308e4f730 Dmitry Osipenko 2020-09-01 658 static struct page *as_get_pde_page(struct tegra_smmu_as *as, 404d0b308e4f730 Dmitry Osipenko 2020-09-01 659 unsigned long iova, gfp_t gfp, 404d0b308e4f730 Dmitry Osipenko 2020-09-01 660 unsigned long *flags) 404d0b308e4f730 Dmitry Osipenko 2020-09-01 661 { 404d0b308e4f730 Dmitry Osipenko 2020-09-01 662 unsigned int pde = iova_pd_index(iova); 404d0b308e4f730 Dmitry Osipenko 2020-09-01 663 struct page *page = as->pts[pde]; 404d0b308e4f730 Dmitry Osipenko 2020-09-01 664 404d0b308e4f730 Dmitry Osipenko 2020-09-01 665 /* at first check whether allocation needs to be done at all */ 404d0b308e4f730 Dmitry Osipenko 2020-09-01 666 if (page) 404d0b308e4f730 Dmitry Osipenko 2020-09-01 667 return page; 404d0b308e4f730 Dmitry Osipenko 2020-09-01 668 404d0b308e4f730 Dmitry Osipenko 2020-09-01 669 /* 404d0b308e4f730 Dmitry Osipenko 2020-09-01 670 * In order to prevent exhaustion of the atomic memory pool, we 404d0b308e4f730 Dmitry Osipenko 2020-09-01 671 * allocate page in a sleeping context if GFP flags permit. Hence 404d0b308e4f730 Dmitry Osipenko 2020-09-01 672 * spinlock needs to be unlocked and re-locked after allocation. 404d0b308e4f730 Dmitry Osipenko 2020-09-01 673 */ 404d0b308e4f730 Dmitry Osipenko 2020-09-01 674 if (!(gfp & __GFP_ATOMIC)) 404d0b308e4f730 Dmitry Osipenko 2020-09-01 675 spin_unlock_irqrestore(&as->lock, *flags); 404d0b308e4f730 Dmitry Osipenko 2020-09-01 676 404d0b308e4f730 Dmitry Osipenko 2020-09-01 677 page = alloc_page(gfp | __GFP_DMA | __GFP_ZERO); 404d0b308e4f730 Dmitry Osipenko 2020-09-01 678 404d0b308e4f730 Dmitry Osipenko 2020-09-01 679 if (!(gfp & __GFP_ATOMIC)) 404d0b308e4f730 Dmitry Osipenko 2020-09-01 680 spin_lock_irqsave(&as->lock, *flags); 404d0b308e4f730 Dmitry Osipenko 2020-09-01 681 404d0b308e4f730 Dmitry Osipenko 2020-09-01 682 /* 404d0b308e4f730 Dmitry Osipenko 2020-09-01 683 * In a case of blocking allocation, a concurrent mapping may win 404d0b308e4f730 Dmitry Osipenko 2020-09-01 684 * the PDE allocation. In this case the allocated page isn't needed 404d0b308e4f730 Dmitry Osipenko 2020-09-01 685 * if allocation succeeded and the allocation failure isn't fatal. 404d0b308e4f730 Dmitry Osipenko 2020-09-01 686 */ 404d0b308e4f730 Dmitry Osipenko 2020-09-01 @687 if (as->pts[pde]) { 404d0b308e4f730 Dmitry Osipenko 2020-09-01 688 if (page) 404d0b308e4f730 Dmitry Osipenko 2020-09-01 689 __free_page(page); 404d0b308e4f730 Dmitry Osipenko 2020-09-01 690 404d0b308e4f730 Dmitry Osipenko 2020-09-01 691 page = as->pts[pde]; 404d0b308e4f730 Dmitry Osipenko 2020-09-01 692 } 404d0b308e4f730 Dmitry Osipenko 2020-09-01 693 404d0b308e4f730 Dmitry Osipenko 2020-09-01 694 return page; 404d0b308e4f730 Dmitry Osipenko 2020-09-01 695 } 404d0b308e4f730 Dmitry Osipenko 2020-09-01 696 --- 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]
