From patchwork Tue Mar 22 21:25:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 64214 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2321433lbc; Tue, 22 Mar 2016 14:25:44 -0700 (PDT) X-Received: by 10.98.72.218 with SMTP id q87mr57814803pfi.117.1458681944790; Tue, 22 Mar 2016 14:25:44 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s63si26805410pfs.86.2016.03.22.14.25.44; Tue, 22 Mar 2016 14:25:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751510AbcCVVZo (ORCPT + 3 others); Tue, 22 Mar 2016 17:25:44 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59819 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751388AbcCVVZn (ORCPT ); Tue, 22 Mar 2016 17:25:43 -0400 Received: from t61p (c-71-198-47-131.hsd1.ca.comcast.net [71.198.47.131]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DF6FB9A; Tue, 22 Mar 2016 21:25:42 +0000 (UTC) Date: Tue, 22 Mar 2016 14:25:42 -0700 From: akpm@linux-foundation.org To: torvalds@linux-foundation.org, akpm@linux-foundation.org, a-jacquiot@ti.com, alexandre.bounine@idt.com, andre.van.herk@prodrive-technologies.com, mporter@kernel.crashing.org, stable@vger.kernel.org Subject: [patch 28/81] rapidio/rionet: fix deadlock on SMP Message-ID: <56f1b856.XHFOKhdGSeAPabdz%akpm@linux-foundation.org> User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Aurelien Jacquiot Subject: rapidio/rionet: fix deadlock on SMP Fix deadlocking during concurrent receive and transmit operations on SMP platforms caused by the use of incorrect lock: on transmit 'tx_lock' spinlock should be used instead of 'lock' which is used for receive operation. This fix is applicable to kernel versions starting from v2.15. Signed-off-by: Aurelien Jacquiot Signed-off-by: Alexandre Bounine Cc: Matt Porter Cc: Andre van Herk Cc: Signed-off-by: Andrew Morton --- drivers/net/rionet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) _ -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -puN drivers/net/rionet.c~rapidio-rionet-fix-deadlock-on-smp drivers/net/rionet.c --- a/drivers/net/rionet.c~rapidio-rionet-fix-deadlock-on-smp +++ a/drivers/net/rionet.c @@ -280,7 +280,7 @@ static void rionet_outb_msg_event(struct struct net_device *ndev = dev_id; struct rionet_private *rnet = netdev_priv(ndev); - spin_lock(&rnet->lock); + spin_lock(&rnet->tx_lock); if (netif_msg_intr(rnet)) printk(KERN_INFO @@ -299,7 +299,7 @@ static void rionet_outb_msg_event(struct if (rnet->tx_cnt < RIONET_TX_RING_SIZE) netif_wake_queue(ndev); - spin_unlock(&rnet->lock); + spin_unlock(&rnet->tx_lock); } static int rionet_open(struct net_device *ndev)