Hi Shunsuke, [FYI, it's a private test report for your RFC patch.] [auto build test WARNING on helgaas-pci/next] [also build test WARNING on helgaas-pci/for-linus linus/master v6.2-rc3 next-20230113] [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#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Shunsuke-Mie/PCI-endpoint-support-an-alignment-aware-map-unmaping/20230113-170756 base: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next patch link: https://lore.kernel.org/r/20230113090350.1103494-2-mie%40igel.co.jp patch subject: [RFC PATCH 1/3] PCI: endpoint: support an alignment aware map/unmaping config: x86_64-randconfig-a014 compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 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/intel-lab-lkp/linux/commit/cccc71b1d7f50a0bc89e0eae0a194b6da166d607 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Shunsuke-Mie/PCI-endpoint-support-an-alignment-aware-map-unmaping/20230113-170756 git checkout cccc71b1d7f50a0bc89e0eae0a194b6da166d607 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/pci/endpoint/functions/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/pci/endpoint/functions/pci-epf-ntb.c:274:60: warning: incompatible integer to pointer conversion passing 'u64' (aka 'unsigned long long') to parameter of type 'phys_addr_t *' (aka 'unsigned long long *'); take the address with & [-Wint-conversion] ret = pci_epc_map_addr(epc, func_no, vfunc_no, phys_addr, addr, size); ^~~~ & include/linux/pci-epc.h:223:38: note: passing argument to parameter 'phys_addr' here u64 pci_addr, phys_addr_t *phys_addr, ^ drivers/pci/endpoint/functions/pci-epf-ntb.c:274:6: warning: incompatible pointer to integer conversion assigning to 'int' from 'void *' [-Wint-conversion] ret = pci_epc_map_addr(epc, func_no, vfunc_no, phys_addr, addr, size); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/pci/endpoint/functions/pci-epf-ntb.c:319:54: error: too few arguments to function call, expected 6, have 4 pci_epc_unmap_addr(epc, func_no, vfunc_no, phys_addr); ~~~~~~~~~~~~~~~~~~ ^ include/linux/pci-epc.h:225:6: note: 'pci_epc_unmap_addr' declared here void pci_epc_unmap_addr(struct pci_epc *epc, u8 func_no, u8 vfunc_no, ^ drivers/pci/endpoint/functions/pci-epf-ntb.c:526:61: warning: incompatible integer to pointer conversion passing 'u64' (aka 'unsigned long long') to parameter of type 'phys_addr_t *' (aka 'unsigned long long *'); take the address with & [-Wint-conversion] ret = pci_epc_map_addr(epc, func_no, vfunc_no, phys_addr, msg_addr, ^~~~~~~~ & include/linux/pci-epc.h:223:38: note: passing argument to parameter 'phys_addr' here u64 pci_addr, phys_addr_t *phys_addr, ^ drivers/pci/endpoint/functions/pci-epf-ntb.c:526:7: warning: incompatible pointer to integer conversion assigning to 'int' from 'void *' [-Wint-conversion] ret = pci_epc_map_addr(epc, func_no, vfunc_no, phys_addr, msg_addr, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/pci/endpoint/functions/pci-epf-ntb.c:608:54: error: too few arguments to function call, expected 6, have 4 pci_epc_unmap_addr(epc, func_no, vfunc_no, phys_addr); ~~~~~~~~~~~~~~~~~~ ^ include/linux/pci-epc.h:225:6: note: 'pci_epc_unmap_addr' declared here void pci_epc_unmap_addr(struct pci_epc *epc, u8 func_no, u8 vfunc_no, ^ 4 warnings and 2 errors generated. vim +274 drivers/pci/endpoint/functions/pci-epf-ntb.c 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 174 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 175 /** 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 176 * epf_ntb_configure_mw() - Configure the Outbound Address Space for one host 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 177 * to access the memory window of other host 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 178 * @ntb: NTB device that facilitates communication between HOST1 and HOST2 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 179 * @type: PRIMARY interface or SECONDARY interface 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 180 * @mw: Index of the memory window (either 0, 1, 2 or 3) 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 181 * 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 182 * +-----------------+ +---->+----------------+-----------+-----------------+ 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 183 * | BAR0 | | | Doorbell 1 +-----------> MSI|X ADDRESS 1 | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 184 * +-----------------+ | +----------------+ +-----------------+ 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 185 * | BAR1 | | | Doorbell 2 +---------+ | | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 186 * +-----------------+----+ +----------------+ | | | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 187 * | BAR2 | | Doorbell 3 +-------+ | +-----------------+ 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 188 * +-----------------+----+ +----------------+ | +-> MSI|X ADDRESS 2 | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 189 * | BAR3 | | | Doorbell 4 +-----+ | +-----------------+ 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 190 * +-----------------+ | |----------------+ | | | | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 191 * | BAR4 | | | | | | +-----------------+ 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 192 * +-----------------+ | | MW1 +---+ | +-->+ MSI|X ADDRESS 3|| 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 193 * | BAR5 | | | | | | +-----------------+ 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 194 * +-----------------+ +---->-----------------+ | | | | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 195 * EP CONTROLLER 1 | | | | +-----------------+ 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 196 * | | | +---->+ MSI|X ADDRESS 4 | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 197 * +----------------+ | +-----------------+ 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 198 * (A) EP CONTROLLER 2 | | | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 199 * (OB SPACE) | | | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 200 * +-------> MW1 | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 201 * | | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 202 * | | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 203 * (B) +-----------------+ 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 204 * | | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 205 * | | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 206 * | | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 207 * | | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 208 * | | 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 209 * +-----------------+ 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 210 * PCI Address Space 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 211 * (Managed by HOST2) 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 212 * 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 213 * This function performs stage (B) in the above diagram (see MW1) i.e., map OB 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 214 * address space of memory window to PCI address space. 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 215 * 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 216 * This operation requires 3 parameters 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 217 * 1) Address in the outbound address space 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 218 * 2) Address in the PCI Address space 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 219 * 3) Size of the address region to be mapped 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 220 * 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 221 * The address in the outbound address space (for MW1, MW2, MW3 and MW4) is 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 222 * stored in epf_bar corresponding to BAR_DB_MW1 for MW1 and BAR_MW2, BAR_MW3 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 223 * BAR_MW4 for rest of the BARs of epf_ntb_epc that is connected to HOST1. This 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 224 * is populated in epf_ntb_alloc_peer_mem() in this driver. 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 225 * 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 226 * The address and size of the PCI address region that has to be mapped would 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 227 * be provided by HOST2 in ctrl->addr and ctrl->size of epf_ntb_epc that is 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 228 * connected to HOST2. 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 229 * 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 230 * Please note Memory window1 (MW1) and Doorbell registers together will be 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 231 * mapped to a single BAR (BAR2) above for 32-bit BARs. The exact BAR that's 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 232 * used for Memory window (MW) can be obtained from epf_ntb_bar[BAR_DB_MW1], 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 233 * epf_ntb_bar[BAR_MW2], epf_ntb_bar[BAR_MW2], epf_ntb_bar[BAR_MW2]. 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 234 */ 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 235 static int epf_ntb_configure_mw(struct epf_ntb *ntb, 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 236 enum pci_epc_interface_type type, u32 mw) 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 237 { 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 238 struct epf_ntb_epc *peer_ntb_epc, *ntb_epc; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 239 struct pci_epf_bar *peer_epf_bar; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 240 enum pci_barno peer_barno; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 241 struct epf_ntb_ctrl *ctrl; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 242 phys_addr_t phys_addr; 53fd3cbe5e9d79 Kishon Vijay Abraham I 2021-08-19 243 u8 func_no, vfunc_no; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 244 struct pci_epc *epc; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 245 u64 addr, size; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 246 int ret = 0; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 247 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 248 ntb_epc = ntb->epc[type]; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 249 epc = ntb_epc->epc; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 250 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 251 peer_ntb_epc = ntb->epc[!type]; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 252 peer_barno = peer_ntb_epc->epf_ntb_bar[mw + NTB_MW_OFFSET]; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 253 peer_epf_bar = &peer_ntb_epc->epf_bar[peer_barno]; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 254 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 255 phys_addr = peer_epf_bar->phys_addr; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 256 ctrl = ntb_epc->reg; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 257 addr = ctrl->addr; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 258 size = ctrl->size; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 259 if (mw + NTB_MW_OFFSET == BAR_DB_MW1) 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 260 phys_addr += ctrl->mw1_offset; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 261 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 262 if (size > ntb->mws_size[mw]) { 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 263 dev_err(&epc->dev, 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 264 "%s intf: MW: %d Req Sz:%llxx > Supported Sz:%llx\n", 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 265 pci_epc_interface_string(type), mw, size, 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 266 ntb->mws_size[mw]); 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 267 ret = -EINVAL; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 268 goto err_invalid_size; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 269 } 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 270 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 271 func_no = ntb_epc->func_no; 53fd3cbe5e9d79 Kishon Vijay Abraham I 2021-08-19 272 vfunc_no = ntb_epc->vfunc_no; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 273 53fd3cbe5e9d79 Kishon Vijay Abraham I 2021-08-19 @274 ret = pci_epc_map_addr(epc, func_no, vfunc_no, phys_addr, addr, size); 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 275 if (ret) 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 276 dev_err(&epc->dev, 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 277 "%s intf: Failed to map memory window %d address\n", 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 278 pci_epc_interface_string(type), mw); 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 279 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 280 err_invalid_size: 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 281 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 282 return ret; 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 283 } 8b821cf761503b Kishon Vijay Abraham I 2021-02-02 284 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests