static void perf_remove(struct ntb_client *client, struct ntb_dev *ntb) { struct perf_ctx *perf = ntb->ctx; int i; dev_dbg(&perf->ntb->dev, "%s called\n", __func__); mutex_lock(&perf->run_mutex); cancel_delayed_work_sync(&perf->link_work); ntb_clear_ctx(ntb); ntb_link_disable(ntb); debugfs_remove_recursive(perf_debugfs_dir); perf_debugfs_dir = NULL; if (use_dma) { for (i = 0; i < MAX_THREADS; i++) { struct pthr_ctx *pctx = &perf->pthr_ctx[i]; if (pctx->dma_chan) dma_release_channel(pctx->dma_chan); } } kfree(perf); }
static void ntb_transport_free(struct ntb_transport_ctx *nt) { struct ntb_softc *ntb = nt->ntb; struct _qpset qp_bitmap_alloc; uint8_t i; ntb_transport_link_cleanup(nt); taskqueue_drain(taskqueue_swi, &nt->link_cleanup); callout_drain(&nt->link_work); callout_drain(&nt->link_watchdog); BIT_COPY(QP_SETSIZE, &nt->qp_bitmap, &qp_bitmap_alloc); BIT_NAND(QP_SETSIZE, &qp_bitmap_alloc, &nt->qp_bitmap_free); /* Verify that all the QPs are freed */ for (i = 0; i < nt->qp_count; i++) if (test_bit(i, &qp_bitmap_alloc)) ntb_transport_free_queue(&nt->qp_vec[i]); ntb_link_disable(ntb); ntb_clear_ctx(ntb); for (i = 0; i < nt->mw_count; i++) ntb_free_mw(nt, i); free(nt->qp_vec, M_NTB_IF); }
static void tool_remove(struct ntb_client *self, struct ntb_dev *ntb) { struct tool_ctx *tc = ntb->ctx; tool_free_mws(tc); ntb_clear_ctx(ntb); ntb_link_disable(ntb); debugfs_remove_recursive(tc->dbgfs); kfree(tc); }
static void pp_clear_ctx(struct pp_ctx *pp) { ntb_link_disable(pp->ntb); ntb_clear_ctx(pp->ntb); }