Lines Matching refs:ndev
76 static int ndev_mw_to_bar(struct amd_ntb_dev *ndev, int idx) in ndev_mw_to_bar() argument
78 if (idx < 0 || idx > ndev->mw_count) in ndev_mw_to_bar()
81 return ndev->dev_data->mw_idx << idx; in ndev_mw_to_bar()
97 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_mw_get_align() local
103 bar = ndev_mw_to_bar(ndev, idx); in amd_ntb_mw_get_align()
114 *size_max = pci_resource_len(ndev->ntb.pdev, bar); in amd_ntb_mw_get_align()
122 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_mw_set_trans() local
132 bar = ndev_mw_to_bar(ndev, idx); in amd_ntb_mw_set_trans()
142 mmio = ndev->self_mmio; in amd_ntb_mw_set_trans()
143 peer_mmio = ndev->peer_mmio; in amd_ntb_mw_set_trans()
198 static int amd_ntb_get_link_status(struct amd_ntb_dev *ndev) in amd_ntb_get_link_status() argument
206 if (ndev->ntb.topo == NTB_TOPO_SEC) { in amd_ntb_get_link_status()
208 pci_swds = pci_upstream_bridge(ndev->ntb.pdev); in amd_ntb_get_link_status()
227 } else if (ndev->ntb.topo == NTB_TOPO_PRI) { in amd_ntb_get_link_status()
232 pdev = ndev->ntb.pdev; in amd_ntb_get_link_status()
241 ndev->lnk_sta = stat; in amd_ntb_get_link_status()
246 static int amd_link_is_up(struct amd_ntb_dev *ndev) in amd_link_is_up() argument
288 ret = amd_poll_link(ndev); in amd_link_is_up()
295 if (ndev->ntb.topo == NTB_TOPO_PRI) { in amd_link_is_up()
296 if ((ndev->peer_sta & AMD_LINK_UP_EVENT) || in amd_link_is_up()
297 (ndev->peer_sta == 0)) in amd_link_is_up()
299 else if (ndev->peer_sta & AMD_LINK_DOWN_EVENT) { in amd_link_is_up()
301 amd_clear_side_info_reg(ndev, true); in amd_link_is_up()
317 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_link_is_up() local
320 if (amd_link_is_up(ndev)) { in amd_ntb_link_is_up()
322 *speed = NTB_LNK_STA_SPEED(ndev->lnk_sta); in amd_ntb_link_is_up()
324 *width = NTB_LNK_STA_WIDTH(ndev->lnk_sta); in amd_ntb_link_is_up()
345 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_link_enable() local
346 void __iomem *mmio = ndev->self_mmio; in amd_ntb_link_enable()
349 ndev->int_mask &= ~AMD_EVENT_INTMASK; in amd_ntb_link_enable()
350 writel(ndev->int_mask, mmio + AMD_INTMASK_OFFSET); in amd_ntb_link_enable()
352 if (ndev->ntb.topo == NTB_TOPO_SEC) in amd_ntb_link_enable()
361 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_link_disable() local
362 void __iomem *mmio = ndev->self_mmio; in amd_ntb_link_disable()
365 ndev->int_mask |= AMD_EVENT_INTMASK; in amd_ntb_link_disable()
366 writel(ndev->int_mask, mmio + AMD_INTMASK_OFFSET); in amd_ntb_link_disable()
368 if (ndev->ntb.topo == NTB_TOPO_SEC) in amd_ntb_link_disable()
384 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_peer_mw_get_addr() local
387 bar = ndev_mw_to_bar(ndev, idx); in amd_ntb_peer_mw_get_addr()
392 *base = pci_resource_start(ndev->ntb.pdev, bar); in amd_ntb_peer_mw_get_addr()
395 *size = pci_resource_len(ndev->ntb.pdev, bar); in amd_ntb_peer_mw_get_addr()
412 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_db_vector_mask() local
414 if (db_vector < 0 || db_vector > ndev->db_count) in amd_ntb_db_vector_mask()
422 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_db_read() local
423 void __iomem *mmio = ndev->self_mmio; in amd_ntb_db_read()
430 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_db_clear() local
431 void __iomem *mmio = ndev->self_mmio; in amd_ntb_db_clear()
440 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_db_set_mask() local
441 void __iomem *mmio = ndev->self_mmio; in amd_ntb_db_set_mask()
444 if (db_bits & ~ndev->db_valid_mask) in amd_ntb_db_set_mask()
447 spin_lock_irqsave(&ndev->db_mask_lock, flags); in amd_ntb_db_set_mask()
448 ndev->db_mask |= db_bits; in amd_ntb_db_set_mask()
449 writew((u16)ndev->db_mask, mmio + AMD_DBMASK_OFFSET); in amd_ntb_db_set_mask()
450 spin_unlock_irqrestore(&ndev->db_mask_lock, flags); in amd_ntb_db_set_mask()
457 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_db_clear_mask() local
458 void __iomem *mmio = ndev->self_mmio; in amd_ntb_db_clear_mask()
461 if (db_bits & ~ndev->db_valid_mask) in amd_ntb_db_clear_mask()
464 spin_lock_irqsave(&ndev->db_mask_lock, flags); in amd_ntb_db_clear_mask()
465 ndev->db_mask &= ~db_bits; in amd_ntb_db_clear_mask()
466 writew((u16)ndev->db_mask, mmio + AMD_DBMASK_OFFSET); in amd_ntb_db_clear_mask()
467 spin_unlock_irqrestore(&ndev->db_mask_lock, flags); in amd_ntb_db_clear_mask()
474 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_peer_db_set() local
475 void __iomem *mmio = ndev->self_mmio; in amd_ntb_peer_db_set()
489 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_spad_read() local
490 void __iomem *mmio = ndev->self_mmio; in amd_ntb_spad_read()
493 if (idx < 0 || idx >= ndev->spad_count) in amd_ntb_spad_read()
496 offset = ndev->self_spad + (idx << 2); in amd_ntb_spad_read()
503 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_spad_write() local
504 void __iomem *mmio = ndev->self_mmio; in amd_ntb_spad_write()
507 if (idx < 0 || idx >= ndev->spad_count) in amd_ntb_spad_write()
510 offset = ndev->self_spad + (idx << 2); in amd_ntb_spad_write()
518 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_peer_spad_read() local
519 void __iomem *mmio = ndev->self_mmio; in amd_ntb_peer_spad_read()
522 if (sidx < 0 || sidx >= ndev->spad_count) in amd_ntb_peer_spad_read()
525 offset = ndev->peer_spad + (sidx << 2); in amd_ntb_peer_spad_read()
532 struct amd_ntb_dev *ndev = ntb_ndev(ntb); in amd_ntb_peer_spad_write() local
533 void __iomem *mmio = ndev->self_mmio; in amd_ntb_peer_spad_write()
536 if (sidx < 0 || sidx >= ndev->spad_count) in amd_ntb_peer_spad_write()
539 offset = ndev->peer_spad + (sidx << 2); in amd_ntb_peer_spad_write()
569 static void amd_ack_smu(struct amd_ntb_dev *ndev, u32 bit) in amd_ack_smu() argument
571 void __iomem *mmio = ndev->self_mmio; in amd_ack_smu()
579 static void amd_handle_event(struct amd_ntb_dev *ndev, int vec) in amd_handle_event() argument
581 void __iomem *mmio = ndev->self_mmio; in amd_handle_event()
582 struct device *dev = &ndev->ntb.pdev->dev; in amd_handle_event()
594 ndev->peer_sta |= AMD_PEER_FLUSH_EVENT; in amd_handle_event()
599 ndev->peer_sta |= status; in amd_handle_event()
601 ndev->peer_sta &= ~AMD_LINK_UP_EVENT; in amd_handle_event()
603 amd_ack_smu(ndev, status); in amd_handle_event()
606 ntb_link_event(&ndev->ntb); in amd_handle_event()
608 schedule_delayed_work(&ndev->hb_timer, AMD_LINK_HB_TIMEOUT); in amd_handle_event()
614 ndev->peer_sta |= status; in amd_handle_event()
616 ndev->peer_sta &= ~AMD_LINK_DOWN_EVENT; in amd_handle_event()
618 ndev->peer_sta &= ~AMD_PEER_D0_EVENT; in amd_handle_event()
620 amd_ack_smu(ndev, status); in amd_handle_event()
623 ntb_link_event(&ndev->ntb); in amd_handle_event()
627 mmio = ndev->peer_mmio; in amd_handle_event()
633 ndev->peer_sta |= AMD_PEER_D0_EVENT; in amd_handle_event()
634 ndev->peer_sta &= ~AMD_PEER_D3_EVENT; in amd_handle_event()
635 amd_ack_smu(ndev, AMD_PEER_D0_EVENT); in amd_handle_event()
638 schedule_delayed_work(&ndev->hb_timer, in amd_handle_event()
650 static void amd_handle_db_event(struct amd_ntb_dev *ndev, int vec) in amd_handle_db_event() argument
652 struct device *dev = &ndev->ntb.pdev->dev; in amd_handle_db_event()
655 status = amd_ntb_db_read(&ndev->ntb); in amd_handle_db_event()
664 if (status & BIT(ndev->db_last_bit)) { in amd_handle_db_event()
665 ntb_db_clear(&ndev->ntb, BIT(ndev->db_last_bit)); in amd_handle_db_event()
667 ntb_link_event(&ndev->ntb); in amd_handle_db_event()
676 schedule_delayed_work(&ndev->hb_timer, AMD_LINK_HB_TIMEOUT); in amd_handle_db_event()
680 static irqreturn_t ndev_interrupt(struct amd_ntb_dev *ndev, int vec) in ndev_interrupt() argument
682 dev_dbg(&ndev->ntb.pdev->dev, "vec %d\n", vec); in ndev_interrupt()
684 if (vec > (AMD_DB_CNT - 1) || (ndev->msix_vec_count == 1)) in ndev_interrupt()
685 amd_handle_event(ndev, vec); in ndev_interrupt()
688 amd_handle_db_event(ndev, vec); in ndev_interrupt()
689 ntb_db_event(&ndev->ntb, vec); in ndev_interrupt()
699 return ndev_interrupt(nvec->ndev, nvec->num); in ndev_vec_isr()
704 struct amd_ntb_dev *ndev = dev; in ndev_irq_isr() local
706 return ndev_interrupt(ndev, irq - ndev->ntb.pdev->irq); in ndev_irq_isr()
709 static int ndev_init_isr(struct amd_ntb_dev *ndev, in ndev_init_isr() argument
715 pdev = ndev->ntb.pdev; in ndev_init_isr()
719 ndev->db_mask = ndev->db_valid_mask; in ndev_init_isr()
722 ndev->vec = kcalloc_node(msix_max, sizeof(*ndev->vec), in ndev_init_isr()
724 if (!ndev->vec) in ndev_init_isr()
727 ndev->msix = kcalloc_node(msix_max, sizeof(*ndev->msix), in ndev_init_isr()
729 if (!ndev->msix) in ndev_init_isr()
733 ndev->msix[i].entry = i; in ndev_init_isr()
735 msix_count = pci_enable_msix_range(pdev, ndev->msix, in ndev_init_isr()
749 ndev->vec[i].ndev = ndev; in ndev_init_isr()
750 ndev->vec[i].num = i; in ndev_init_isr()
751 rc = request_irq(ndev->msix[i].vector, ndev_vec_isr, 0, in ndev_init_isr()
752 "ndev_vec_isr", &ndev->vec[i]); in ndev_init_isr()
758 ndev->db_count = msix_min; in ndev_init_isr()
759 ndev->msix_vec_count = msix_max; in ndev_init_isr()
764 free_irq(ndev->msix[i].vector, &ndev->vec[i]); in ndev_init_isr()
767 kfree(ndev->msix); in ndev_init_isr()
769 kfree(ndev->vec); in ndev_init_isr()
771 ndev->msix = NULL; in ndev_init_isr()
772 ndev->vec = NULL; in ndev_init_isr()
780 "ndev_irq_isr", ndev); in ndev_init_isr()
785 ndev->db_count = 1; in ndev_init_isr()
786 ndev->msix_vec_count = 1; in ndev_init_isr()
797 "ndev_irq_isr", ndev); in ndev_init_isr()
802 ndev->db_count = 1; in ndev_init_isr()
803 ndev->msix_vec_count = 1; in ndev_init_isr()
810 static void ndev_deinit_isr(struct amd_ntb_dev *ndev) in ndev_deinit_isr() argument
813 void __iomem *mmio = ndev->self_mmio; in ndev_deinit_isr()
816 pdev = ndev->ntb.pdev; in ndev_deinit_isr()
819 ndev->db_mask = ndev->db_valid_mask; in ndev_deinit_isr()
820 writel(ndev->db_mask, mmio + AMD_DBMASK_OFFSET); in ndev_deinit_isr()
822 if (ndev->msix) { in ndev_deinit_isr()
823 i = ndev->msix_vec_count; in ndev_deinit_isr()
825 free_irq(ndev->msix[i].vector, &ndev->vec[i]); in ndev_deinit_isr()
827 kfree(ndev->msix); in ndev_deinit_isr()
828 kfree(ndev->vec); in ndev_deinit_isr()
830 free_irq(pdev->irq, ndev); in ndev_deinit_isr()
841 struct amd_ntb_dev *ndev; in ndev_debugfs_read() local
848 ndev = filp->private_data; in ndev_debugfs_read()
849 mmio = ndev->self_mmio; in ndev_debugfs_read()
864 ntb_topo_string(ndev->ntb.topo)); in ndev_debugfs_read()
867 "LNK STA -\t\t%#06x\n", ndev->lnk_sta); in ndev_debugfs_read()
869 if (!amd_link_is_up(ndev)) { in ndev_debugfs_read()
877 NTB_LNK_STA_SPEED(ndev->lnk_sta)); in ndev_debugfs_read()
880 NTB_LNK_STA_WIDTH(ndev->lnk_sta)); in ndev_debugfs_read()
884 "Memory Window Count -\t%u\n", ndev->mw_count); in ndev_debugfs_read()
886 "Scratchpad Count -\t%u\n", ndev->spad_count); in ndev_debugfs_read()
888 "Doorbell Count -\t%u\n", ndev->db_count); in ndev_debugfs_read()
890 "MSIX Vector Count -\t%u\n", ndev->msix_vec_count); in ndev_debugfs_read()
893 "Doorbell Valid Mask -\t%#llx\n", ndev->db_valid_mask); in ndev_debugfs_read()
895 u.v32 = readl(ndev->self_mmio + AMD_DBMASK_OFFSET); in ndev_debugfs_read()
910 u.v64 = read64(ndev->self_mmio + AMD_BAR23XLAT_OFFSET); in ndev_debugfs_read()
914 u.v64 = read64(ndev->self_mmio + AMD_BAR45XLAT_OFFSET); in ndev_debugfs_read()
922 u.v64 = read64(ndev->self_mmio + AMD_BAR23LMT_OFFSET); in ndev_debugfs_read()
926 u.v64 = read64(ndev->self_mmio + AMD_BAR45LMT_OFFSET); in ndev_debugfs_read()
935 static void ndev_init_debugfs(struct amd_ntb_dev *ndev) in ndev_init_debugfs() argument
938 ndev->debugfs_dir = NULL; in ndev_init_debugfs()
939 ndev->debugfs_info = NULL; in ndev_init_debugfs()
941 ndev->debugfs_dir = in ndev_init_debugfs()
942 debugfs_create_dir(pci_name(ndev->ntb.pdev), in ndev_init_debugfs()
944 ndev->debugfs_info = in ndev_init_debugfs()
946 ndev->debugfs_dir, ndev, in ndev_init_debugfs()
951 static void ndev_deinit_debugfs(struct amd_ntb_dev *ndev) in ndev_deinit_debugfs() argument
953 debugfs_remove_recursive(ndev->debugfs_dir); in ndev_deinit_debugfs()
956 static inline void ndev_init_struct(struct amd_ntb_dev *ndev, in ndev_init_struct() argument
959 ndev->ntb.pdev = pdev; in ndev_init_struct()
960 ndev->ntb.topo = NTB_TOPO_NONE; in ndev_init_struct()
961 ndev->ntb.ops = &amd_ntb_ops; in ndev_init_struct()
962 ndev->int_mask = AMD_EVENT_INTMASK; in ndev_init_struct()
963 spin_lock_init(&ndev->db_mask_lock); in ndev_init_struct()
966 static int amd_poll_link(struct amd_ntb_dev *ndev) in amd_poll_link() argument
968 void __iomem *mmio = ndev->peer_mmio; in amd_poll_link()
974 dev_dbg(&ndev->ntb.pdev->dev, "%s: reg_val = 0x%x.\n", __func__, reg); in amd_poll_link()
976 ndev->cntl_sta = reg; in amd_poll_link()
978 amd_ntb_get_link_status(ndev); in amd_poll_link()
980 return ndev->cntl_sta; in amd_poll_link()
985 struct amd_ntb_dev *ndev = hb_ndev(work); in amd_link_hb() local
987 if (amd_poll_link(ndev)) in amd_link_hb()
988 ntb_link_event(&ndev->ntb); in amd_link_hb()
990 if (!amd_link_is_up(ndev)) in amd_link_hb()
991 schedule_delayed_work(&ndev->hb_timer, AMD_LINK_HB_TIMEOUT); in amd_link_hb()
994 static int amd_init_isr(struct amd_ntb_dev *ndev) in amd_init_isr() argument
996 return ndev_init_isr(ndev, AMD_DB_CNT, AMD_MSIX_VECTOR_CNT); in amd_init_isr()
999 static void amd_set_side_info_reg(struct amd_ntb_dev *ndev, bool peer) in amd_set_side_info_reg() argument
1005 mmio = ndev->peer_mmio; in amd_set_side_info_reg()
1007 mmio = ndev->self_mmio; in amd_set_side_info_reg()
1016 static void amd_clear_side_info_reg(struct amd_ntb_dev *ndev, bool peer) in amd_clear_side_info_reg() argument
1022 mmio = ndev->peer_mmio; in amd_clear_side_info_reg()
1024 mmio = ndev->self_mmio; in amd_clear_side_info_reg()
1034 static void amd_init_side_info(struct amd_ntb_dev *ndev) in amd_init_side_info() argument
1036 void __iomem *mmio = ndev->self_mmio; in amd_init_side_info()
1039 amd_set_side_info_reg(ndev, false); in amd_init_side_info()
1046 static void amd_deinit_side_info(struct amd_ntb_dev *ndev) in amd_deinit_side_info() argument
1048 void __iomem *mmio = ndev->self_mmio; in amd_deinit_side_info()
1051 amd_clear_side_info_reg(ndev, false); in amd_deinit_side_info()
1058 static int amd_init_ntb(struct amd_ntb_dev *ndev) in amd_init_ntb() argument
1060 void __iomem *mmio = ndev->self_mmio; in amd_init_ntb()
1062 ndev->mw_count = ndev->dev_data->mw_count; in amd_init_ntb()
1063 ndev->spad_count = AMD_SPADS_CNT; in amd_init_ntb()
1064 ndev->db_count = AMD_DB_CNT; in amd_init_ntb()
1066 switch (ndev->ntb.topo) { in amd_init_ntb()
1069 ndev->spad_count >>= 1; in amd_init_ntb()
1070 if (ndev->ntb.topo == NTB_TOPO_PRI) { in amd_init_ntb()
1071 ndev->self_spad = 0; in amd_init_ntb()
1072 ndev->peer_spad = 0x20; in amd_init_ntb()
1074 ndev->self_spad = 0x20; in amd_init_ntb()
1075 ndev->peer_spad = 0; in amd_init_ntb()
1078 INIT_DELAYED_WORK(&ndev->hb_timer, amd_link_hb); in amd_init_ntb()
1079 schedule_delayed_work(&ndev->hb_timer, AMD_LINK_HB_TIMEOUT); in amd_init_ntb()
1083 dev_err(&ndev->ntb.pdev->dev, in amd_init_ntb()
1089 writel(ndev->int_mask, mmio + AMD_INTMASK_OFFSET); in amd_init_ntb()
1094 static enum ntb_topo amd_get_topo(struct amd_ntb_dev *ndev) in amd_get_topo() argument
1096 void __iomem *mmio = ndev->self_mmio; in amd_get_topo()
1106 static int amd_init_dev(struct amd_ntb_dev *ndev) in amd_init_dev() argument
1108 void __iomem *mmio = ndev->self_mmio; in amd_init_dev()
1112 pdev = ndev->ntb.pdev; in amd_init_dev()
1114 ndev->ntb.topo = amd_get_topo(ndev); in amd_init_dev()
1116 ntb_topo_string(ndev->ntb.topo)); in amd_init_dev()
1118 rc = amd_init_ntb(ndev); in amd_init_dev()
1122 rc = amd_init_isr(ndev); in amd_init_dev()
1128 ndev->db_valid_mask = BIT_ULL(ndev->db_count) - 1; in amd_init_dev()
1134 ndev->db_last_bit = in amd_init_dev()
1135 find_last_bit((unsigned long *)&ndev->db_valid_mask, in amd_init_dev()
1136 hweight64(ndev->db_valid_mask)); in amd_init_dev()
1137 writew((u16)~BIT(ndev->db_last_bit), mmio + AMD_DBMASK_OFFSET); in amd_init_dev()
1142 ndev->db_count -= 1; in amd_init_dev()
1143 ndev->db_valid_mask = BIT_ULL(ndev->db_count) - 1; in amd_init_dev()
1146 ndev->int_mask &= ~(AMD_LINK_UP_EVENT | AMD_LINK_DOWN_EVENT); in amd_init_dev()
1147 writel(ndev->int_mask, mmio + AMD_INTMASK_OFFSET); in amd_init_dev()
1152 static void amd_deinit_dev(struct amd_ntb_dev *ndev) in amd_deinit_dev() argument
1154 cancel_delayed_work_sync(&ndev->hb_timer); in amd_deinit_dev()
1156 ndev_deinit_isr(ndev); in amd_deinit_dev()
1159 static int amd_ntb_init_pci(struct amd_ntb_dev *ndev, in amd_ntb_init_pci() argument
1164 pci_set_drvdata(pdev, ndev); in amd_ntb_init_pci()
1184 ndev->self_mmio = pci_iomap(pdev, 0, 0); in amd_ntb_init_pci()
1185 if (!ndev->self_mmio) { in amd_ntb_init_pci()
1189 ndev->peer_mmio = ndev->self_mmio + AMD_PEER_OFFSET; in amd_ntb_init_pci()
1202 static void amd_ntb_deinit_pci(struct amd_ntb_dev *ndev) in amd_ntb_deinit_pci() argument
1204 struct pci_dev *pdev = ndev->ntb.pdev; in amd_ntb_deinit_pci()
1206 pci_iounmap(pdev, ndev->self_mmio); in amd_ntb_deinit_pci()
1216 struct amd_ntb_dev *ndev; in amd_ntb_pci_probe() local
1221 ndev = kzalloc_node(sizeof(*ndev), GFP_KERNEL, node); in amd_ntb_pci_probe()
1222 if (!ndev) { in amd_ntb_pci_probe()
1227 ndev->dev_data = (struct ntb_dev_data *)id->driver_data; in amd_ntb_pci_probe()
1229 ndev_init_struct(ndev, pdev); in amd_ntb_pci_probe()
1231 rc = amd_ntb_init_pci(ndev, pdev); in amd_ntb_pci_probe()
1235 rc = amd_init_dev(ndev); in amd_ntb_pci_probe()
1240 amd_init_side_info(ndev); in amd_ntb_pci_probe()
1242 amd_poll_link(ndev); in amd_ntb_pci_probe()
1244 ndev_init_debugfs(ndev); in amd_ntb_pci_probe()
1246 rc = ntb_register_device(&ndev->ntb); in amd_ntb_pci_probe()
1255 ndev_deinit_debugfs(ndev); in amd_ntb_pci_probe()
1256 amd_deinit_dev(ndev); in amd_ntb_pci_probe()
1258 amd_ntb_deinit_pci(ndev); in amd_ntb_pci_probe()
1260 kfree(ndev); in amd_ntb_pci_probe()
1267 struct amd_ntb_dev *ndev = pci_get_drvdata(pdev); in amd_ntb_pci_remove() local
1274 amd_deinit_side_info(ndev); in amd_ntb_pci_remove()
1275 ntb_peer_db_set(&ndev->ntb, BIT_ULL(ndev->db_last_bit)); in amd_ntb_pci_remove()
1276 ntb_unregister_device(&ndev->ntb); in amd_ntb_pci_remove()
1277 ndev_deinit_debugfs(ndev); in amd_ntb_pci_remove()
1278 amd_deinit_dev(ndev); in amd_ntb_pci_remove()
1279 amd_ntb_deinit_pci(ndev); in amd_ntb_pci_remove()
1280 kfree(ndev); in amd_ntb_pci_remove()
1285 struct amd_ntb_dev *ndev = pci_get_drvdata(pdev); in amd_ntb_pci_shutdown() local
1288 ntb_link_event(&ndev->ntb); in amd_ntb_pci_shutdown()
1290 amd_deinit_side_info(ndev); in amd_ntb_pci_shutdown()
1291 ntb_peer_db_set(&ndev->ntb, BIT_ULL(ndev->db_last_bit)); in amd_ntb_pci_shutdown()
1292 ntb_unregister_device(&ndev->ntb); in amd_ntb_pci_shutdown()
1293 ndev_deinit_debugfs(ndev); in amd_ntb_pci_shutdown()
1294 amd_deinit_dev(ndev); in amd_ntb_pci_shutdown()
1295 amd_ntb_deinit_pci(ndev); in amd_ntb_pci_shutdown()
1296 kfree(ndev); in amd_ntb_pci_shutdown()