bool link_is_up;
struct work_struct link_cleanup;
struct delayed_work link_work;
+ wait_queue_head_t link_wq;
struct dentry *debugfs_node_dir;
struct dentry *debugfs_run;
struct dentry *debugfs_threads;
goto out1;
perf->link_is_up = true;
+ wake_up(&perf->link_wq);
return;
int node, i;
DECLARE_WAIT_QUEUE_HEAD(wq);
- if (!perf->link_is_up)
+ if (wait_event_interruptible(perf->link_wq, perf->link_is_up))
return -ENOLINK;
if (perf->perf_threads == 0)
mutex_init(&perf->run_mutex);
spin_lock_init(&perf->db_lock);
perf_setup_mw(ntb, perf);
+ init_waitqueue_head(&perf->link_wq);
INIT_DELAYED_WORK(&perf->link_work, perf_link_work);
INIT_WORK(&perf->link_cleanup, perf_link_cleanup);