From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jul 2017 03:45:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,316,1496127600"; d="scan'208";a="107768139" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.91]) ([10.237.220.91]) by orsmga002.jf.intel.com with ESMTP; 06 Jul 2017 03:45:49 -0700 To: Stephen Hemminger Cc: dev@dpdk.org, Bruce Richardson , Anatoly Burakov 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> From: Ferruh Yigit Message-ID: Date: Thu, 6 Jul 2017 11:45:48 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170705120703.77efb263@xeon-e3> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v10 11/20] unci: add netlink exec X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jul 2017 10:45:52 -0000 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