tree: git://git.infradead.org/users/hch/misc.git dma-bypass.3 head: e36a07612143eb7d46684c60596e13359d7dec83 commit: b4f328e819b538d013db8dfe53f75177e1c408b4 [1/5] firmware: qcom_scm: don't include dma-direct.h config: arm-defconfig (attached as .config) compiler: arm-linux-gnueabi-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 git checkout b4f328e819b538d013db8dfe53f75177e1c408b4 # save the attached .config to linux build tree GCC_VERSION=9.3.0 make.cross ARCH=arm If you fix the issue, kindly add following tag as appropriate Reported-by: kbuild test robot All errors (new ones prefixed by >>): drivers/firmware/qcom_scm.c: In function 'qcom_scm_assign_mem': >> drivers/firmware/qcom_scm.c:829:13: error: implicit declaration of function 'dma_to_phys'; did you mean 'idmap_to_phys'? [-Werror=implicit-function-declaration] 829 | ptr_phys = dma_to_phys(__scm->dev, ptr_dma); | ^~~~~~~~~~~ | idmap_to_phys cc1: some warnings being treated as errors vim +829 drivers/firmware/qcom_scm.c 57d3b816718c1c Elliot Berman 2020-01-07 786 d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 787 /** d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 788 * qcom_scm_assign_mem() - Make a secure call to reassign memory ownership d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 789 * @mem_addr: mem region whose ownership need to be reassigned d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 790 * @mem_sz: size of the region. d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 791 * @srcvm: vmid for current set of owners, each set bit in d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 792 * flag indicate a unique owner c8b08fc0d6f834 Stephen Boyd 2019-05-17 793 * @newvm: array having new owners and corresponding permission d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 794 * flags d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 795 * @dest_cnt: number of owners in next set. d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 796 * c8b08fc0d6f834 Stephen Boyd 2019-05-17 797 * Return negative errno on failure or 0 on success with @srcvm updated. d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 798 */ d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 799 int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz, d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 800 unsigned int *srcvm, af311ff9a69189 Stephen Boyd 2019-05-17 801 const struct qcom_scm_vmperm *newvm, af311ff9a69189 Stephen Boyd 2019-05-17 802 unsigned int dest_cnt) d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 803 { d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 804 struct qcom_scm_current_perm_info *destvm; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 805 struct qcom_scm_mem_map_info *mem_to_map; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 806 phys_addr_t mem_to_map_phys; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 807 phys_addr_t dest_phys; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 808 phys_addr_t ptr_phys; 6e37ccf78a5329 Stephen Boyd 2019-05-17 809 dma_addr_t ptr_dma; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 810 size_t mem_to_map_sz; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 811 size_t dest_sz; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 812 size_t src_sz; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 813 size_t ptr_sz; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 814 int next_vm; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 815 __le32 *src; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 816 void *ptr; af311ff9a69189 Stephen Boyd 2019-05-17 817 int ret, i, b; af311ff9a69189 Stephen Boyd 2019-05-17 818 unsigned long srcvm_bits = *srcvm; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 819 af311ff9a69189 Stephen Boyd 2019-05-17 820 src_sz = hweight_long(srcvm_bits) * sizeof(*src); d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 821 mem_to_map_sz = sizeof(*mem_to_map); d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 822 dest_sz = dest_cnt * sizeof(*destvm); d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 823 ptr_sz = ALIGN(src_sz, SZ_64) + ALIGN(mem_to_map_sz, SZ_64) + d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 824 ALIGN(dest_sz, SZ_64); d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 825 6e37ccf78a5329 Stephen Boyd 2019-05-17 826 ptr = dma_alloc_coherent(__scm->dev, ptr_sz, &ptr_dma, GFP_KERNEL); d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 827 if (!ptr) d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 828 return -ENOMEM; 6e37ccf78a5329 Stephen Boyd 2019-05-17 @829 ptr_phys = dma_to_phys(__scm->dev, ptr_dma); d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 830 d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 831 /* Fill source vmid detail */ d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 832 src = ptr; af311ff9a69189 Stephen Boyd 2019-05-17 833 i = 0; af311ff9a69189 Stephen Boyd 2019-05-17 834 for_each_set_bit(b, &srcvm_bits, BITS_PER_LONG) af311ff9a69189 Stephen Boyd 2019-05-17 835 src[i++] = cpu_to_le32(b); d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 836 d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 837 /* Fill details of mem buff to map */ d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 838 mem_to_map = ptr + ALIGN(src_sz, SZ_64); d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 839 mem_to_map_phys = ptr_phys + ALIGN(src_sz, SZ_64); af311ff9a69189 Stephen Boyd 2019-05-17 840 mem_to_map->mem_addr = cpu_to_le64(mem_addr); af311ff9a69189 Stephen Boyd 2019-05-17 841 mem_to_map->mem_size = cpu_to_le64(mem_sz); d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 842 d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 843 next_vm = 0; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 844 /* Fill details of next vmid detail */ d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 845 destvm = ptr + ALIGN(mem_to_map_sz, SZ_64) + ALIGN(src_sz, SZ_64); d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 846 dest_phys = ptr_phys + ALIGN(mem_to_map_sz, SZ_64) + ALIGN(src_sz, SZ_64); af311ff9a69189 Stephen Boyd 2019-05-17 847 for (i = 0; i < dest_cnt; i++, destvm++, newvm++) { af311ff9a69189 Stephen Boyd 2019-05-17 848 destvm->vmid = cpu_to_le32(newvm->vmid); af311ff9a69189 Stephen Boyd 2019-05-17 849 destvm->perm = cpu_to_le32(newvm->perm); af311ff9a69189 Stephen Boyd 2019-05-17 850 destvm->ctx = 0; af311ff9a69189 Stephen Boyd 2019-05-17 851 destvm->ctx_size = 0; af311ff9a69189 Stephen Boyd 2019-05-17 852 next_vm |= BIT(newvm->vmid); d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 853 } d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 854 d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 855 ret = __qcom_scm_assign_mem(__scm->dev, mem_to_map_phys, mem_to_map_sz, d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 856 ptr_phys, src_sz, dest_phys, dest_sz); 6e37ccf78a5329 Stephen Boyd 2019-05-17 857 dma_free_coherent(__scm->dev, ptr_sz, ptr, ptr_dma); d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 858 if (ret) { d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 859 dev_err(__scm->dev, c8b08fc0d6f834 Stephen Boyd 2019-05-17 860 "Assign memory protection call failed %d\n", ret); d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 861 return -EINVAL; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 862 } d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 863 d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 864 *srcvm = next_vm; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 865 return 0; d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 866 } d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 867 EXPORT_SYMBOL(qcom_scm_assign_mem); d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 868 :::::: The code at line 829 was first introduced by commit :::::: 6e37ccf78a53296c6c7bf426065762c27829eb84 firmware: qcom_scm: Use proper types for dma mappings :::::: TO: Stephen Boyd :::::: CC: Bjorn Andersson --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org