From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v10 11/20] unci: add netlink exec Date: Wed, 5 Jul 2017 12:07:03 -0700 Message-ID: <20170705120703.77efb263@xeon-e3> References: <20170630165140.59594-1-ferruh.yigit@intel.com> <20170704161337.45926-1-ferruh.yigit@intel.com> <20170704161337.45926-12-ferruh.yigit@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, Bruce Richardson , Anatoly Burakov To: Ferruh Yigit Return-path: Received: from mail-pf0-f175.google.com (mail-pf0-f175.google.com [209.85.192.175]) by dpdk.org (Postfix) with ESMTP id 0BC612A58 for ; Wed, 5 Jul 2017 21:07:10 +0200 (CEST) Received: by mail-pf0-f175.google.com with SMTP id c73so134073749pfk.2 for ; Wed, 05 Jul 2017 12:07:10 -0700 (PDT) In-Reply-To: <20170704161337.45926-12-ferruh.yigit@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, 4 Jul 2017 17:13:28 +0100 Ferruh Yigit wrote: > +int unci_nl_exec(u32 cmd, struct net_device *dev, void *in_data, > + size_t in_data_len, void *out_data, size_t out_data_len) > +{ > + struct unci_dev *unci = netdev_priv(dev); > + int err = -EINVAL; > + int ret; > + > + if (out_data_len > UNCI_NL_MSG_LEN) { > + pr_err("Message is too big to receive:%zu\n", out_data_len); > + return err; > + } > + > + mutex_lock(&sync_lock); > + ret = unci_response_buffer_register(cmd, out_data, out_data_len, > + &unci->msg_received, &err); > + if (ret) { > + mutex_unlock(&sync_lock); > + return -EINVAL; > + } > + > + ret = unci_nl_send(cmd, unci->port_id, unci->pid, in_data, in_data_len); > + if (ret) { > + unci_response_buffer_unregister(response_buffer.magic); > + mutex_unlock(&sync_lock); > + return ret; > + } > + > + ret = wait_for_completion_interruptible_timeout(&unci->msg_received, > + msecs_to_jiffies(UNCI_CMD_TIMEOUT)); Blocking for completion with mutex held? Sleeping with mutex held is not allowed in Linux. You will see this if you run with lockdep and all the other kernel debug config options.