Skip to content

Commit fcd9f2a

Browse files
authored
CR-1076408 P2P buffer allocation failing while running Bytecopy on Ra… (Xilinx#4088)
1 parent 08b7d82 commit fcd9f2a

File tree

1 file changed

+8
-14
lines changed
  • src/runtime_src/core/pcie/driver/linux/xocl/userpf

1 file changed

+8
-14
lines changed

src/runtime_src/core/pcie/driver/linux/xocl/userpf/xocl_drv.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,12 @@ int xocl_refresh_subdevs(struct xocl_dev *xdev)
798798
userpf_err(xdev, "create subdev failed %d", ret);
799799
goto failed;
800800
}
801+
ret = xocl_p2p_init(xdev);
802+
if (ret) {
803+
userpf_err(xdev, "failed to init p2p memory");
804+
goto failed;
805+
}
806+
801807
(void) xocl_peer_listen(xdev, xocl_mailbox_srv, (void *)xdev);
802808

803809
ret = xocl_init_sysfs(xdev);
@@ -841,26 +847,15 @@ void user_pci_reset_done(struct pci_dev *pdev)
841847
}
842848
#endif
843849

844-
void xocl_p2p_fini(struct xocl_dev *xdev)
845-
{
846-
if (xocl_subdev_is_vsec(xdev))
847-
return;
848-
849-
xocl_subdev_destroy_by_id(xdev, XOCL_SUBDEV_P2P);
850-
}
851-
852850
int xocl_p2p_init(struct xocl_dev *xdev)
853851
{
854852
struct xocl_subdev_info subdev_info = XOCL_DEVINFO_P2P;
855853
int ret;
856854

857-
if (xocl_subdev_is_vsec(xdev))
858-
return 0;
859-
860855
/* create p2p subdev for legacy platform */
861856
ret = xocl_subdev_create(xdev, &subdev_info);
862-
if (ret) {
863-
xocl_xdev_info(xdev, "create p2p subdev failed. ret %d", ret);
857+
if (ret && ret != -EEXIST) {
858+
xocl_xdev_err(xdev, "create p2p subdev failed. ret %d", ret);
864859
return ret;
865860
}
866861

@@ -924,7 +919,6 @@ void xocl_userpf_remove(struct pci_dev *pdev)
924919
xdev->core.drm = NULL;
925920
}
926921

927-
xocl_p2p_fini(xdev);
928922
xocl_fini_persist_sysfs(xdev);
929923
xocl_fini_sysfs(xdev);
930924

0 commit comments

Comments
 (0)