From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============6912753779594728729==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH 16/16] PCI: Remove usage of the deprecated "pci-dma-compat.h" API Date: Fri, 07 Jan 2022 17:20:45 +0800 Message-ID: <202201071756.7k3Nd6AQ-lkp@intel.com> In-Reply-To: List-Id: --===============6912753779594728729== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Christophe, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on media-tree/master] [also build test WARNING on helgaas-pci/next soc/for-next linus/master v5.1= 6-rc8 next-20220106] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Christophe-JAILLET/Remove-= usage-of-the-deprecated-pci-dma-compat-h-API/20220107-055614 base: git://linuxtv.org/media_tree.git master config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20220107= /202201071756.7k3Nd6AQ-lkp(a)intel.com/config) compiler: s390-linux-gcc (GCC) 11.2.0 reproduce (this is a W=3D1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/= make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/24f5ae55a3ed7f1638a921db6= 6d8e2f428f2e79d git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Christophe-JAILLET/Remove-usage-of= -the-deprecated-pci-dma-compat-h-API/20220107-055614 git checkout 24f5ae55a3ed7f1638a921db66d8e2f428f2e79d # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= O=3Dbuild_dir ARCH=3Ds390 SHELL=3D/bin/bash drivers/s390/net/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): drivers/s390/net/ism_drv.c: In function 'register_sba': drivers/s390/net/ism_drv.c:93:15: error: implicit declaration of functio= n 'dma_alloc_coherent' [-Werror=3Dimplicit-function-declaration] 93 | sba =3D dma_alloc_coherent(&ism->pdev->dev, PAGE_SIZE, &= dma_handle, | ^~~~~~~~~~~~~~~~~~ >> drivers/s390/net/ism_drv.c:93:13: warning: assignment to 'struct ism_sba= *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 93 | sba =3D dma_alloc_coherent(&ism->pdev->dev, PAGE_SIZE, &= dma_handle, | ^ drivers/s390/net/ism_drv.c:104:17: error: implicit declaration of functi= on 'dma_free_coherent' [-Werror=3Dimplicit-function-declaration] 104 | dma_free_coherent(&ism->pdev->dev, PAGE_SIZE, sb= a, dma_handle); | ^~~~~~~~~~~~~~~~~ drivers/s390/net/ism_drv.c: In function 'register_ieq': >> drivers/s390/net/ism_drv.c:120:13: warning: assignment to 'struct ism_eq= *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 120 | ieq =3D dma_alloc_coherent(&ism->pdev->dev, PAGE_SIZE, &= dma_handle, | ^ drivers/s390/net/ism_drv.c: In function 'ism_alloc_dmb': drivers/s390/net/ism_drv.c:229:40: error: implicit declaration of functi= on 'dma_get_max_seg_size' [-Werror=3Dimplicit-function-declaration] 229 | if (PAGE_ALIGN(dmb->dmb_len) > dma_get_max_seg_size(&ism= ->pdev->dev)) | ^~~~~~~~~~~~~~~~~~~~ >> drivers/s390/net/ism_drv.c:244:23: warning: assignment to 'void *' from = 'int' makes pointer from integer without a cast [-Wint-conversion] 244 | dmb->cpu_addr =3D dma_alloc_coherent(&ism->pdev->dev, dm= b->dmb_len, | ^ drivers/s390/net/ism_drv.c: In function 'ism_probe': drivers/s390/net/ism_drv.c:558:15: error: implicit declaration of functi= on 'dma_set_mask'; did you mean 'xa_set_mark'? [-Werror=3Dimplicit-function= -declaration] 558 | ret =3D dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)); | ^~~~~~~~~~~~ | xa_set_mark drivers/s390/net/ism_drv.c:558:40: error: implicit declaration of functi= on 'DMA_BIT_MASK'; did you mean 'BIT_MASK'? [-Werror=3Dimplicit-function-de= claration] 558 | ret =3D dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)); | ^~~~~~~~~~~~ | BIT_MASK drivers/s390/net/ism_drv.c:562:9: error: implicit declaration of functio= n 'dma_set_seg_boundary' [-Werror=3Dimplicit-function-declaration] 562 | dma_set_seg_boundary(&pdev->dev, SZ_1M - 1); | ^~~~~~~~~~~~~~~~~~~~ drivers/s390/net/ism_drv.c:563:9: error: implicit declaration of functio= n 'dma_set_max_seg_size' [-Werror=3Dimplicit-function-declaration] 563 | dma_set_max_seg_size(&pdev->dev, SZ_1M); | ^~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors vim +93 drivers/s390/net/ism_drv.c 684b89bc39ce4f Sebastian Ott 2018-06-28 86 = 684b89bc39ce4f Sebastian Ott 2018-06-28 87 static int register_sba(st= ruct ism_dev *ism) 684b89bc39ce4f Sebastian Ott 2018-06-28 88 { 684b89bc39ce4f Sebastian Ott 2018-06-28 89 union ism_reg_sba cmd; 684b89bc39ce4f Sebastian Ott 2018-06-28 90 dma_addr_t dma_handle; 684b89bc39ce4f Sebastian Ott 2018-06-28 91 struct ism_sba *sba; 684b89bc39ce4f Sebastian Ott 2018-06-28 92 = 750afb08ca7131 Luis Chamberlain 2019-01-04 @93 sba =3D dma_alloc_coheren= t(&ism->pdev->dev, PAGE_SIZE, &dma_handle, 750afb08ca7131 Luis Chamberlain 2019-01-04 94 GFP_KERNEL); 684b89bc39ce4f Sebastian Ott 2018-06-28 95 if (!sba) 684b89bc39ce4f Sebastian Ott 2018-06-28 96 return -ENOMEM; 684b89bc39ce4f Sebastian Ott 2018-06-28 97 = 684b89bc39ce4f Sebastian Ott 2018-06-28 98 memset(&cmd, 0, sizeof(cm= d)); 684b89bc39ce4f Sebastian Ott 2018-06-28 99 cmd.request.hdr.cmd =3D I= SM_REG_SBA; 684b89bc39ce4f Sebastian Ott 2018-06-28 100 cmd.request.hdr.len =3D s= izeof(cmd.request); 684b89bc39ce4f Sebastian Ott 2018-06-28 101 cmd.request.sba =3D dma_h= andle; 684b89bc39ce4f Sebastian Ott 2018-06-28 102 = 684b89bc39ce4f Sebastian Ott 2018-06-28 103 if (ism_cmd(ism, &cmd)) { 684b89bc39ce4f Sebastian Ott 2018-06-28 104 dma_free_coherent(&ism->= pdev->dev, PAGE_SIZE, sba, dma_handle); 684b89bc39ce4f Sebastian Ott 2018-06-28 105 return -EIO; 684b89bc39ce4f Sebastian Ott 2018-06-28 106 } 684b89bc39ce4f Sebastian Ott 2018-06-28 107 = 684b89bc39ce4f Sebastian Ott 2018-06-28 108 ism->sba =3D sba; 684b89bc39ce4f Sebastian Ott 2018-06-28 109 ism->sba_dma_addr =3D dma= _handle; 684b89bc39ce4f Sebastian Ott 2018-06-28 110 = 684b89bc39ce4f Sebastian Ott 2018-06-28 111 return 0; 684b89bc39ce4f Sebastian Ott 2018-06-28 112 } 684b89bc39ce4f Sebastian Ott 2018-06-28 113 = 684b89bc39ce4f Sebastian Ott 2018-06-28 114 static int register_ieq(st= ruct ism_dev *ism) 684b89bc39ce4f Sebastian Ott 2018-06-28 115 { 684b89bc39ce4f Sebastian Ott 2018-06-28 116 union ism_reg_ieq cmd; 684b89bc39ce4f Sebastian Ott 2018-06-28 117 dma_addr_t dma_handle; 684b89bc39ce4f Sebastian Ott 2018-06-28 118 struct ism_eq *ieq; 684b89bc39ce4f Sebastian Ott 2018-06-28 119 = 750afb08ca7131 Luis Chamberlain 2019-01-04 @120 ieq =3D dma_alloc_coheren= t(&ism->pdev->dev, PAGE_SIZE, &dma_handle, 750afb08ca7131 Luis Chamberlain 2019-01-04 121 GFP_KERNEL); 684b89bc39ce4f Sebastian Ott 2018-06-28 122 if (!ieq) 684b89bc39ce4f Sebastian Ott 2018-06-28 123 return -ENOMEM; 684b89bc39ce4f Sebastian Ott 2018-06-28 124 = 684b89bc39ce4f Sebastian Ott 2018-06-28 125 memset(&cmd, 0, sizeof(cm= d)); 684b89bc39ce4f Sebastian Ott 2018-06-28 126 cmd.request.hdr.cmd =3D I= SM_REG_IEQ; 684b89bc39ce4f Sebastian Ott 2018-06-28 127 cmd.request.hdr.len =3D s= izeof(cmd.request); 684b89bc39ce4f Sebastian Ott 2018-06-28 128 cmd.request.ieq =3D dma_h= andle; 684b89bc39ce4f Sebastian Ott 2018-06-28 129 cmd.request.len =3D sizeo= f(*ieq); 684b89bc39ce4f Sebastian Ott 2018-06-28 130 = 684b89bc39ce4f Sebastian Ott 2018-06-28 131 if (ism_cmd(ism, &cmd)) { 684b89bc39ce4f Sebastian Ott 2018-06-28 132 dma_free_coherent(&ism->= pdev->dev, PAGE_SIZE, ieq, dma_handle); 684b89bc39ce4f Sebastian Ott 2018-06-28 133 return -EIO; 684b89bc39ce4f Sebastian Ott 2018-06-28 134 } 684b89bc39ce4f Sebastian Ott 2018-06-28 135 = 684b89bc39ce4f Sebastian Ott 2018-06-28 136 ism->ieq =3D ieq; 684b89bc39ce4f Sebastian Ott 2018-06-28 137 ism->ieq_idx =3D -1; 684b89bc39ce4f Sebastian Ott 2018-06-28 138 ism->ieq_dma_addr =3D dma= _handle; 684b89bc39ce4f Sebastian Ott 2018-06-28 139 = 684b89bc39ce4f Sebastian Ott 2018-06-28 140 return 0; 684b89bc39ce4f Sebastian Ott 2018-06-28 141 } 684b89bc39ce4f Sebastian Ott 2018-06-28 142 = 684b89bc39ce4f Sebastian Ott 2018-06-28 143 static int unregister_sba(= struct ism_dev *ism) 684b89bc39ce4f Sebastian Ott 2018-06-28 144 { 0ff06c44efeede Sebastian Ott 2019-02-14 145 int ret; 0ff06c44efeede Sebastian Ott 2019-02-14 146 = 684b89bc39ce4f Sebastian Ott 2018-06-28 147 if (!ism->sba) 684b89bc39ce4f Sebastian Ott 2018-06-28 148 return 0; 684b89bc39ce4f Sebastian Ott 2018-06-28 149 = 0ff06c44efeede Sebastian Ott 2019-02-14 150 ret =3D ism_cmd_simple(is= m, ISM_UNREG_SBA); 0ff06c44efeede Sebastian Ott 2019-02-14 151 if (ret && ret !=3D ISM_E= RROR) 684b89bc39ce4f Sebastian Ott 2018-06-28 152 return -EIO; 684b89bc39ce4f Sebastian Ott 2018-06-28 153 = 684b89bc39ce4f Sebastian Ott 2018-06-28 154 dma_free_coherent(&ism->p= dev->dev, PAGE_SIZE, 684b89bc39ce4f Sebastian Ott 2018-06-28 155 ism->sba, ism->sba_dm= a_addr); 684b89bc39ce4f Sebastian Ott 2018-06-28 156 = 684b89bc39ce4f Sebastian Ott 2018-06-28 157 ism->sba =3D NULL; 684b89bc39ce4f Sebastian Ott 2018-06-28 158 ism->sba_dma_addr =3D 0; 684b89bc39ce4f Sebastian Ott 2018-06-28 159 = 684b89bc39ce4f Sebastian Ott 2018-06-28 160 return 0; 684b89bc39ce4f Sebastian Ott 2018-06-28 161 } 684b89bc39ce4f Sebastian Ott 2018-06-28 162 = 684b89bc39ce4f Sebastian Ott 2018-06-28 163 static int unregister_ieq(= struct ism_dev *ism) 684b89bc39ce4f Sebastian Ott 2018-06-28 164 { 0ff06c44efeede Sebastian Ott 2019-02-14 165 int ret; 0ff06c44efeede Sebastian Ott 2019-02-14 166 = 684b89bc39ce4f Sebastian Ott 2018-06-28 167 if (!ism->ieq) 684b89bc39ce4f Sebastian Ott 2018-06-28 168 return 0; 684b89bc39ce4f Sebastian Ott 2018-06-28 169 = 0ff06c44efeede Sebastian Ott 2019-02-14 170 ret =3D ism_cmd_simple(is= m, ISM_UNREG_IEQ); 0ff06c44efeede Sebastian Ott 2019-02-14 171 if (ret && ret !=3D ISM_E= RROR) 684b89bc39ce4f Sebastian Ott 2018-06-28 172 return -EIO; 684b89bc39ce4f Sebastian Ott 2018-06-28 173 = 684b89bc39ce4f Sebastian Ott 2018-06-28 174 dma_free_coherent(&ism->p= dev->dev, PAGE_SIZE, 684b89bc39ce4f Sebastian Ott 2018-06-28 175 ism->ieq, ism->ieq_dm= a_addr); 684b89bc39ce4f Sebastian Ott 2018-06-28 176 = 684b89bc39ce4f Sebastian Ott 2018-06-28 177 ism->ieq =3D NULL; 684b89bc39ce4f Sebastian Ott 2018-06-28 178 ism->ieq_dma_addr =3D 0; 684b89bc39ce4f Sebastian Ott 2018-06-28 179 = 684b89bc39ce4f Sebastian Ott 2018-06-28 180 return 0; 684b89bc39ce4f Sebastian Ott 2018-06-28 181 } 684b89bc39ce4f Sebastian Ott 2018-06-28 182 = 684b89bc39ce4f Sebastian Ott 2018-06-28 183 static int ism_read_local_= gid(struct ism_dev *ism) 684b89bc39ce4f Sebastian Ott 2018-06-28 184 { 684b89bc39ce4f Sebastian Ott 2018-06-28 185 union ism_read_gid cmd; 684b89bc39ce4f Sebastian Ott 2018-06-28 186 int ret; 684b89bc39ce4f Sebastian Ott 2018-06-28 187 = 684b89bc39ce4f Sebastian Ott 2018-06-28 188 memset(&cmd, 0, sizeof(cm= d)); 684b89bc39ce4f Sebastian Ott 2018-06-28 189 cmd.request.hdr.cmd =3D I= SM_READ_GID; 684b89bc39ce4f Sebastian Ott 2018-06-28 190 cmd.request.hdr.len =3D s= izeof(cmd.request); 684b89bc39ce4f Sebastian Ott 2018-06-28 191 = 684b89bc39ce4f Sebastian Ott 2018-06-28 192 ret =3D ism_cmd(ism, &cmd= ); 684b89bc39ce4f Sebastian Ott 2018-06-28 193 if (ret) 684b89bc39ce4f Sebastian Ott 2018-06-28 194 goto out; 684b89bc39ce4f Sebastian Ott 2018-06-28 195 = 684b89bc39ce4f Sebastian Ott 2018-06-28 196 ism->smcd->local_gid =3D = cmd.response.gid; 684b89bc39ce4f Sebastian Ott 2018-06-28 197 out: 684b89bc39ce4f Sebastian Ott 2018-06-28 198 return ret; 684b89bc39ce4f Sebastian Ott 2018-06-28 199 } 684b89bc39ce4f Sebastian Ott 2018-06-28 200 = 684b89bc39ce4f Sebastian Ott 2018-06-28 201 static int ism_query_rgid(= struct smcd_dev *smcd, u64 rgid, u32 vid_valid, 684b89bc39ce4f Sebastian Ott 2018-06-28 202 u32 vid) 684b89bc39ce4f Sebastian Ott 2018-06-28 203 { 684b89bc39ce4f Sebastian Ott 2018-06-28 204 struct ism_dev *ism =3D s= mcd->priv; 684b89bc39ce4f Sebastian Ott 2018-06-28 205 union ism_query_rgid cmd; 684b89bc39ce4f Sebastian Ott 2018-06-28 206 = 684b89bc39ce4f Sebastian Ott 2018-06-28 207 memset(&cmd, 0, sizeof(cm= d)); 684b89bc39ce4f Sebastian Ott 2018-06-28 208 cmd.request.hdr.cmd =3D I= SM_QUERY_RGID; 684b89bc39ce4f Sebastian Ott 2018-06-28 209 cmd.request.hdr.len =3D s= izeof(cmd.request); 684b89bc39ce4f Sebastian Ott 2018-06-28 210 = 684b89bc39ce4f Sebastian Ott 2018-06-28 211 cmd.request.rgid =3D rgid; 684b89bc39ce4f Sebastian Ott 2018-06-28 212 cmd.request.vlan_valid = =3D vid_valid; 684b89bc39ce4f Sebastian Ott 2018-06-28 213 cmd.request.vlan_id =3D v= id; 684b89bc39ce4f Sebastian Ott 2018-06-28 214 = 684b89bc39ce4f Sebastian Ott 2018-06-28 215 return ism_cmd(ism, &cmd); 684b89bc39ce4f Sebastian Ott 2018-06-28 216 } 684b89bc39ce4f Sebastian Ott 2018-06-28 217 = 684b89bc39ce4f Sebastian Ott 2018-06-28 218 static void ism_free_dmb(s= truct ism_dev *ism, struct smcd_dmb *dmb) 684b89bc39ce4f Sebastian Ott 2018-06-28 219 { 684b89bc39ce4f Sebastian Ott 2018-06-28 220 clear_bit(dmb->sba_idx, i= sm->sba_bitmap); 684b89bc39ce4f Sebastian Ott 2018-06-28 221 dma_free_coherent(&ism->p= dev->dev, dmb->dmb_len, 684b89bc39ce4f Sebastian Ott 2018-06-28 222 dmb->cpu_addr, dmb->d= ma_addr); 684b89bc39ce4f Sebastian Ott 2018-06-28 223 } 684b89bc39ce4f Sebastian Ott 2018-06-28 224 = 684b89bc39ce4f Sebastian Ott 2018-06-28 225 static int ism_alloc_dmb(s= truct ism_dev *ism, struct smcd_dmb *dmb) 684b89bc39ce4f Sebastian Ott 2018-06-28 226 { 684b89bc39ce4f Sebastian Ott 2018-06-28 227 unsigned long bit; 684b89bc39ce4f Sebastian Ott 2018-06-28 228 = 684b89bc39ce4f Sebastian Ott 2018-06-28 229 if (PAGE_ALIGN(dmb->dmb_l= en) > dma_get_max_seg_size(&ism->pdev->dev)) 684b89bc39ce4f Sebastian Ott 2018-06-28 230 return -EINVAL; 684b89bc39ce4f Sebastian Ott 2018-06-28 231 = 684b89bc39ce4f Sebastian Ott 2018-06-28 232 if (!dmb->sba_idx) { 684b89bc39ce4f Sebastian Ott 2018-06-28 233 bit =3D find_next_zero_b= it(ism->sba_bitmap, ISM_NR_DMBS, 684b89bc39ce4f Sebastian Ott 2018-06-28 234 ISM_DMB_BIT_OFFSET); 684b89bc39ce4f Sebastian Ott 2018-06-28 235 if (bit =3D=3D ISM_NR_DM= BS) 211e5b7a0007e6 Karsten Graul 2020-07-26 236 return -ENOSPC; 684b89bc39ce4f Sebastian Ott 2018-06-28 237 = 684b89bc39ce4f Sebastian Ott 2018-06-28 238 dmb->sba_idx =3D bit; 684b89bc39ce4f Sebastian Ott 2018-06-28 239 } 684b89bc39ce4f Sebastian Ott 2018-06-28 240 if (dmb->sba_idx < ISM_DM= B_BIT_OFFSET || 684b89bc39ce4f Sebastian Ott 2018-06-28 241 test_and_set_bit(dmb-= >sba_idx, ism->sba_bitmap)) 684b89bc39ce4f Sebastian Ott 2018-06-28 242 return -EINVAL; 684b89bc39ce4f Sebastian Ott 2018-06-28 243 = 750afb08ca7131 Luis Chamberlain 2019-01-04 @244 dmb->cpu_addr =3D dma_all= oc_coherent(&ism->pdev->dev, dmb->dmb_len, 750afb08ca7131 Luis Chamberlain 2019-01-04 245 &dmb->dma_addr, 750afb08ca7131 Luis Chamberlain 2019-01-04 246 GFP_KERNEL | __GFP= _NOWARN | __GFP_NOMEMALLOC | __GFP_COMP | __GFP_NORETRY); 684b89bc39ce4f Sebastian Ott 2018-06-28 247 if (!dmb->cpu_addr) 684b89bc39ce4f Sebastian Ott 2018-06-28 248 clear_bit(dmb->sba_idx, = ism->sba_bitmap); 684b89bc39ce4f Sebastian Ott 2018-06-28 249 = 684b89bc39ce4f Sebastian Ott 2018-06-28 250 return dmb->cpu_addr ? 0 = : -ENOMEM; 684b89bc39ce4f Sebastian Ott 2018-06-28 251 } 684b89bc39ce4f Sebastian Ott 2018-06-28 252 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============6912753779594728729==--