tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: bb74bc369fd2ab5f41a32c4ddc2e23bc76c3c550 commit: 4332dbb07181359cccca3ba757ef54e434fb1296 [9619/9669] Add kh40000_direct_dma_ops for KH-40000 platform config: x86_64-buildonly-randconfig-001-20240520 (https://download.01.org/0day-ci/archive/20240520/202405202027.XOiN2dDz-lkp@i...) compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240520/202405202027.XOiN2dDz-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/202405202027.XOiN2dDz-lkp@intel.com/
All errors (new ones prefixed by >>):
arch/x86/kernel/zhaoxin_kh40000.c:47:30: warning: bitwise or with non-zero value always evaluates to true [-Wtautological-bitwise-compare] 47 | if (ZHAOXIN_P2CW_NODE_CHECK | zhaoxin_patch_code) | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
arch/x86/kernel/zhaoxin_kh40000.c:87:33: error: call to undeclared function 'iommu_get_dma_domain'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
87 | struct iommu_domain *domain = iommu_get_dma_domain(dev); | ^ arch/x86/kernel/zhaoxin_kh40000.c:87:33: note: did you mean 'iommu_is_dma_domain'? include/linux/iommu.h:273:20: note: 'iommu_is_dma_domain' declared here 273 | static inline bool iommu_is_dma_domain(struct iommu_domain *domain) | ^
arch/x86/kernel/zhaoxin_kh40000.c:87:24: error: incompatible integer to pointer conversion initializing 'struct iommu_domain *' with an expression of type 'int' [-Wint-conversion]
87 | struct iommu_domain *domain = iommu_get_dma_domain(dev); | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning and 2 errors generated. --
kernel/dma/contiguous.c:228:6: error: use of undeclared identifier 'is_zhaoxin_kh40000'
228 | if (is_zhaoxin_kh40000) | ^ 1 error generated.
Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for CRYPTO_CRC32C_INTEL Depends on [n]: CRYPTO [=y] && !KMSAN [=y] && X86 [=y] Selected by [y]: - ISCSI_TARGET [=y] && TARGET_CORE [=y] && INET [=y] && X86 [=y]
vim +/iommu_get_dma_domain +87 arch/x86/kernel/zhaoxin_kh40000.c
64 65 static void kh40000_sync_single_dma_for_cpu(struct device *dev, dma_addr_t paddr, 66 enum dma_data_direction dir, bool is_iommu) 67 { 68 u8 vid; 69 struct pci_dev *pci; 70 u64 dma_mask = *dev->dma_mask; 71 72 /* check direction */ 73 if ((dir != DMA_FROM_DEVICE) && (dir != DMA_BIDIRECTIONAL)) 74 return; 75 76 /* check dma capability */ 77 if (dma_mask <= DMA_BIT_MASK(32)) 78 return; 79 80 /* check device type */ 81 pci = kh40000_get_pci_dev(dev); 82 if (pci == NULL) 83 return; 84 85 /* get real physical address */ 86 if (is_iommu) {
87 struct iommu_domain *domain = iommu_get_dma_domain(dev);
88 89 paddr = iommu_iova_to_phys(domain, paddr); 90 if (!paddr) 91 return; 92 } 93 94 /* check node or not */ 95 if ((zhaoxin_patch_code & ZHAOXIN_P2CW_NODE_CHECK) 96 && pfn_to_nid(PFN_DOWN(paddr)) == dev_to_node(dev)) 97 return; 98 99 /* flush data by one pci read cycle */ 100 pci_read_config_byte(pci, PCI_VENDOR_ID, &vid); 101 } 102