From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v10 11/20] unci: add netlink exec Date: Thu, 6 Jul 2017 11:45:48 +0100 Message-ID: References: <20170630165140.59594-1-ferruh.yigit@intel.com> <20170704161337.45926-1-ferruh.yigit@intel.com> <20170704161337.45926-12-ferruh.yigit@intel.com> <20170705120703.77efb263@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, Bruce Richardson , Anatoly Burakov To: Stephen Hemminger Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id D10C4271 for ; Thu, 6 Jul 2017 12:45:51 +0200 (CEST) In-Reply-To: <20170705120703.77efb263@xeon-e3> Content-Language: en-US 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 7/5/2017 8:07 PM, Stephen Hemminger wrote: > 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. Thank you for the review, I will send a new version addressing all comments. Thanks, ferruh