From patchwork Fri Jan 1 12:17:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 7938961 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C7296BEEE5 for ; Fri, 1 Jan 2016 12:19:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC8CF2054B for ; Fri, 1 Jan 2016 12:19:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 432EA20547 for ; Fri, 1 Jan 2016 12:19:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751893AbcAAMTY (ORCPT ); Fri, 1 Jan 2016 07:19:24 -0500 Received: from mail-by2on0062.outbound.protection.outlook.com ([207.46.100.62]:29623 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751845AbcAAMTV (ORCPT ); Fri, 1 Jan 2016 07:19:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=7nwGQ9cDkrYj8n4fr4Gi6VnJMFChiI5t15SUj+YCzfU=; b=Flse7EYFZUVd7hH5HGClZnB2pXki/0wnbFTQm2epYOavHSze1/AnPMiu6+rO0pMz5/wMnB/5ND+vkaLqOMVqDb3/83tegfyz8X9mArrawP8nC33pM/KHE5IhaiKfhd4c5C1uPTPWZNnSCr3vlbKV7lGU7G/wVrPjc+Ot4+dOpCY= Received: from BY2PR02CA0081.namprd02.prod.outlook.com (10.242.32.39) by CY1PR0201MB0825.namprd02.prod.outlook.com (10.160.141.26) with Microsoft SMTP Server (TLS) id 15.1.361.13; Fri, 1 Jan 2016 12:19:18 +0000 Received: from BL2FFO11FD040.protection.gbl (2a01:111:f400:7c09::131) by BY2PR02CA0081.outlook.office365.com (2a01:111:e400:2c2a::39) with Microsoft SMTP Server (TLS) id 15.1.361.13 via Frontend Transport; Fri, 1 Jan 2016 12:19:17 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.172) smtp.mailfrom=sandisk.com; mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.172 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.172; helo=milsmgep11.sandisk.com; Received: from milsmgep11.sandisk.com (63.163.107.172) by BL2FFO11FD040.mail.protection.outlook.com (10.173.161.136) with Microsoft SMTP Server id 15.1.355.15 via Frontend Transport; Fri, 1 Jan 2016 12:19:16 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep11.sandisk.com (Symantec Messaging Gateway) with SMTP id E0.26.04667.4CE66865; Fri, 1 Jan 2016 04:19:16 -0800 (PST) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.248.2; Fri, 1 Jan 2016 04:17:48 -0800 X-AuditID: ac160a68-f790b6d00000123b-83-56866ec47fee Received: from [10.50.231.76] ( [10.177.8.100]) by milsmgip12.sandisk.com (Symantec Messaging Gateway) with SMTP id 12.FB.17166.B6E66865; Fri, 1 Jan 2016 04:17:48 -0800 (PST) To: Doug Ledford CC: Erez Shitrit , "linux-rdma@vger.kernel.org" From: Bart Van Assche Subject: [PATCH] IB/cm: Fix a recently introduced deadlock Message-ID: <56866E6A.8040503@sandisk.com> Date: Fri, 1 Jan 2016 13:17:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMLMWRmVeSWpSXmKPExsWyRoxnke6RvLYwgwf/VCxenv/AanFg8SVG i2eHelkcmD2eTT/M5PF+31U2j8+b5AKYo7hsUlJzMstSi/TtErgyfk26xVSwQq1i7ze2BsYj il2MnBwSAiYSJ5Y9Y4WwxSQu3FvPBmILCZxglHi0VreLkQvI3s4osWzPeXaYhh9TfrNAJDYz Srw92ALWLSKgJrHp1SKgIg4OZoFkidvn/EHCbAJGEt/ez2QBsYUFrCQmf54LNodXQEvi1MJX TCA2i4CKxNHjj1lAWkUFIiQW7ciEKBGUODnzCQvERE2J9bv0QcLMAvIS29/OYQa5QEKgi1Xi /LS7LBA3q0ucXDKfaQKj0Cwk7bMQ2mchaV/AyLyKUSw3M6c4Nz21wNBQrzgxLyWzOFsvOT93 EyM4qLkydjBunWR+iFGAg1GJh3dGd2uYEGtiWXFl7iFGCQ5mJRHeCG+gEG9KYmVValF+fFFp TmrxIUZpDhYlcV7rFrUwIYH0xJLU7NTUgtQimCwTB6dUA6PFRKE9sd5+dl2FL8780f7s++zr xoU8tw5WLnz0RovDs1CF7YnQsZvrZI7oMeus/BK3/cikQzPeW6xuTRR/N/fUgT1Lbom8use9 6Nc0dWdJyaX7Dza/+fNbaH3wJNNFLl/lzZUO+YRcyPCO4nOUntabKrNaoD7whtfse267mBmL FU+kf+J6ur9PiaU4I9FQi7moOBEAWT9tBmYCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDJMWRmVeSWpSXmKPExsXCtZEjRTcnry3MoHWegsXL8x9YLQ4svsRo 8exQL4sDs8ez6YeZPN7vu8rm8XmTXABzFJdNSmpOZllqkb5dAlfGr0m3mApWqFXs/cbWwHhE sYuRk0NCwETix5TfLBC2mMSFe+vZuhi5OIQENjJKbLh8lAkkISKgJrHp1SJ2EJtZIFniwt93 rCA2m4CRxLf3M8GahQWsJCZ/ngtWwyugJXFq4SuwXhYBFYmjxx8D1XBwiApESCzakQlRIihx cuYTFoiR6hJ/5l1ihrDlJba/ncM8gZF3FpKyWUjKZiEpW8DIvIpRLDczpzg3PbPA0EivODEv JbM4Wy85P3cTIzi8OKN2MF6faH6IkYmDU6qB0f9C4PKcByplehoWoSca/h64I1r6/eSHv3tv z82+k/c+7k/Wog/aXdeDqtu/cL6cv/CJumyHbb2sjzxnTZ6Kp5BF6aPrLzKn97Js5P08rYZD 62UOX2f0LRk7HtUZjmw5MnHHRDcKF1uIhgQuZXPK+qB3hmfTos3X/l9X2Oz21elNYMPqqi3V SizFGYmGWsxFxYkA8PYPXN8BAAA= X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD040; 1:Tx69AfFCUoArUEamscqzAjfJ05sBjn2NoJtiTjAAS8O+0zeZcM7nIvg4vMYhpE80hLCGO9nmdHRwe8ftUqp93Bh3WFwb38JuWRbvg0YSZpoEo0wDysCNXoxlqLwrjUxeWhX8v9Kud5jsZf9gcHMhf+ALHJEzT31dYDOJueCiOUXI/8gbVZ3TaPRYxuZYIy0emiCqodZPq0Kcquc/bq8eGGY3mrWKcYUBvXoCn0S/xQaqh6sc+kwKZqPRFPdcEqvsfVnw7cQMzwVEgjrUqY9DTFhWy5nhps6h+1g8/80wnGlmOZ5ELWYPE/kgzG0bsdkm4vuLIjUN7EaHCS3OcO8x5m2S9tU/yqSU60YBFjpybwaHdDvzMkaxE6QVJ8kchQm6O/GlZjOhrgEuZUCvDvCqoQ== X-Forefront-Antispam-Report: CIP:63.163.107.172; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(479174004)(199003)(189002)(47776003)(19580395003)(77096005)(189998001)(110136002)(80316001)(5001960100002)(69596002)(65956001)(87266999)(86362001)(1220700001)(87936001)(54356999)(19580405001)(59896002)(230700001)(5008740100001)(65816999)(50466002)(83506001)(92566002)(4001350100001)(106466001)(50986999)(65806001)(97736004)(33656002)(4326007)(1096002)(36756003)(64126003)(23676002)(586003)(81156007)(99136001)(229853001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB0825; H:milsmgep11.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0825; 2:dptXWyyuj8uppVR2u7e1K8MuUz3BfTtlzwOQzreTCbMQw2iATQAdf4FskVKF0H9av/g7zPdyYwvxwV6qwN67LfRqPgiAh4t4Tc/H1XQuog+sTlZOfl8+rjOla5sY9wVY+WmiCyXlq7XiUGhrknfhNA==; 3:6WFlmHBhcVq9HPbW/fBegCZdbViKRPod7IBBqjyIu34qPsM+w2lg66k6UoeOcT2x37qy+hQKOmCRAwEuKfBgUKo+mmQv6vGSQWA/1+sUDNwRQOcc+1yb0yB7+k/AjRjCfoXq96itgFo8PLim8O4lxChxZdF2brEocRqc+Nb1aymQb6b4niCTcA7k7iTV3DQFlvh6F2bTBd0W3L0hDAik7YSbjjy7U+nojPzbS3AyC6a4JNVdrJvCmWBEPGVjh/ljDZVOASsY3LxyWYHUhvdSUg==; 25:byC3IKvquxtSalyBD80sRxxRgKeSXh+p+/foVSQRzp2YLUiLmkgrcYinfEsUArqn/KoT/9XlYhUNvjB4jekpB/aORHbDKgnKqBfh+lJDaKcSS8FPFmjJJEGftriUaf7T82LsqxflZBLY26x9ARxoovUyI0Z6E0m5bBHxplRykK301PmtZ1ZuYUd3iEq0vV20qv3xYC+kDw9BmrPb1BLqUKvPwyFlEYrp46QcBP15EM6KCsYxOYtNKi44gxuiv0pxzl5qOdxAdgX/vHBg45T54g== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:CY1PR0201MB0825; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0825; 20:xZ9R/k8PYgKOUaEDfinjwTh+5rLnRqwNiOYp+dSCBuoVB9LF4UOHHAjqSD1WUY+Wdrd4jC4wXGgVBgv/w3PgdnfqUE//cp5+/V8L/Qwc1toHnaEICDUJrUl4M7NRPAijMHYJf44ZVqrpnRqfVXmEdJc9nEz1kM9q1G5cMhfy4KKEHs34+V6i9IFkXT8BdkBo3nMxAuSdxZwiBxt/2zvEQhCJGwljjMkMfXGzlbbNm+WxaB0sTHcHCG0/5mkD+Y16XMUNcRc4P7TIpkerrm0ZWnZr+rWG3++hjMQZR7R08jK2GuuXy06K0RvdXiiCf5h7KRRm+p8v/ERAPpuN8Oq1uWvBTuP2dh9QKer964YKWZssGLBtfmSNy4YHPXt1sdFhi+bt/UN6nmZGJ2TPMulbEIXS3TACjheS+Fkr5LktBVD7mT2aAACb+eVADB4qgT2zGjSHb7aJ5haatAuE5rD+MTRQJkYohhtGo+1U3fPA4kE0elG5gT1uBeK9aCw/dCbB X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(34787635062028)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001)(10201501046); SRVR:CY1PR0201MB0825; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB0825; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0825; 4:e2oXqqmWOKeWYlbkqa8hSEGPQMxwKgOzWosvn5s7aL6qziWqCYMVyC1DDQzK7RSd4UeBi5/ReSEfj77MTGVQnnBmhn25aVhVGcIxEAwMJeZj2LXBtNCmdwEl4eU249JhiWd9huJiuFhjM6Cl+V+tV2WakiclRrRFmoMWLj2D9gRHvApdZUd2BuV5a7ST8o13i0XfYDNxlbIAKNkvTsimKxfl/2zCRdjK4Y/QGovS7IF0+LIVw4PobAJTQHnKPg/BHnnCIiLbw5BXa6SmJ44TIcuZx4ocqGaXV4klWjVMRtDtldUXCTLCQxxtcRzq50zH+REEYq9eEsuPc5Mi0bFv33HZbjFwmUY5WsDmHAPPu9cRrPngnC0LZNm5gm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fRQfbKfWBJ54vw0KSoybtDHYfWkTQf32JOhC326I6Vk0gJg0ypkMXI4kgoxEw==; 24:ePdEKN5DlD4Bt/gczKRd6rsML/ZdcNlFQCn6a460pHC/bhePneGlFzvrt7skHyLMiR0jg7sJL7SIC6nmMam+oWvqIqEXhtDC89j5RkF6b04=; 20:xb4/eFvOSk8bC8O205sseFbI/2TOMpNG3uL5maknVJMI43U78qv5qsDONcBFnCHLhNWQ/Mmj2jtf3vAxpN3oPIM9eekx7M+S2QHyvMrkfPTog8J2hGRd6ayvbiuWYT2NLpBZLGvkR711yHb3zfMyiF6zKe2t5jB0ZHYqO5P1wMxjDTBXS8TlOkOT8Tw4BatU57fMtt3aMEAXYqPZXkBvH62mxp30caI6NeCEer9tOCddpdkgUod40xJZopPPyrEL SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2016 12:19:16.6270 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.172]; Helo=[milsmgep11.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB0825 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ib_send_cm_drep() calls cm_enter_timewait() while holding a spinlock that can be locked from inside an interrupt handler. Hence do not enable interrupts inside cm_enter_timewait() if called with interrupts disabled. This patch fixes e.g. the following deadlock: Acked-by: Erez Shitrit ================================= [ INFO: inconsistent lock state ] 4.4.0-rc7+ #1 Tainted: G E --------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. swapper/8/0 [HC1[1]:SC0[0]:HE0:SE1] takes: (&(&cm_id_priv->lock)->rlock){?.+...}, at: [] cm_establish+0x 74/0x1b0 [ib_cm] {HARDIRQ-ON-W} state was registered at: [] mark_held_locks+0x71/0x90 [] trace_hardirqs_on_caller+0xa7/0x1c0 [] trace_hardirqs_on+0xd/0x10 [] _raw_spin_unlock_irq+0x2b/0x40 [] cm_enter_timewait+0xae/0x100 [ib_cm] [] ib_send_cm_drep+0xb6/0x190 [ib_cm] [] srp_cm_handler+0x128/0x1a0 [ib_srp] [] cm_process_work+0x20/0xf0 [ib_cm] [] cm_dreq_handler+0x135/0x2c0 [ib_cm] [] cm_work_handler+0x75/0xd0 [ib_cm] [] process_one_work+0x1bd/0x460 [] worker_thread+0x118/0x420 [] kthread+0xe4/0x100 [] ret_from_fork+0x3f/0x70 irq event stamp: 1672286 hardirqs last enabled at (1672283): [] poll_idle+0x10/0x80 hardirqs last disabled at (1672284): [] common_interrupt+0x84/0x89 softirqs last enabled at (1672286): [] _local_bh_enable+0x1c/0x50 softirqs last disabled at (1672285): [] irq_enter+0x47/0x70 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&(&cm_id_priv->lock)->rlock); lock(&(&cm_id_priv->lock)->rlock); *** DEADLOCK *** no locks held by swapper/8/0. stack backtrace: CPU: 8 PID: 0 Comm: swapper/8 Tainted: G E 4.4.0-rc7+ #1 Hardware name: Dell Inc. PowerEdge R430/03XKDV, BIOS 1.0.2 11/17/2014 ffff88045af5e950 ffff88046e503a88 ffffffff81251c1b 0000000000000007 0000000000000006 0000000000000003 ffff88045af5ddc0 ffff88046e503ad8 ffffffff810a32f4 0000000000000000 0000000000000000 0000000000000001 Call Trace: [] dump_stack+0x4f/0x74 [] print_usage_bug+0x184/0x190 [] mark_lock_irq+0xf2/0x290 [] mark_lock+0x115/0x1b0 [] mark_irqflags+0x15c/0x170 [] __lock_acquire+0x1ef/0x560 [] lock_acquire+0x62/0x80 [] _raw_spin_lock_irqsave+0x43/0x60 [] cm_establish+0x74/0x1b0 [ib_cm] [] ib_cm_notify+0x31/0x100 [ib_cm] [] srpt_qp_event+0x54/0xd0 [ib_srpt] [] mlx4_ib_qp_event+0x72/0xc0 [mlx4_ib] [] mlx4_qp_event+0x69/0xd0 [mlx4_core] [] mlx4_eq_int+0x51e/0xd50 [mlx4_core] [] mlx4_msi_x_interrupt+0xf/0x20 [mlx4_core] [] handle_irq_event_percpu+0x40/0x110 [] handle_irq_event+0x3f/0x70 [] handle_edge_irq+0x79/0x120 [] handle_irq+0x5d/0x130 [] do_IRQ+0x6d/0x130 [] common_interrupt+0x89/0x89 [] cpuidle_enter_state+0xcf/0x200 [] cpuidle_enter+0x12/0x20 [] call_cpuidle+0x36/0x60 [] cpuidle_idle_call+0x63/0x110 [] cpu_idle_loop+0xfa/0x130 [] cpu_startup_entry+0xe/0x10 [] start_secondary+0x83/0x90 Fixes: commit be4b499323bf ("IB/cm: Do not queue work to a device that's going away") Signed-off-by: Bart Van Assche Cc: Erez Shitrit Cc: stable --- drivers/infiniband/core/cm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 0a26dd6..d6d2b35 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -782,11 +782,11 @@ static void cm_enter_timewait(struct cm_id_private *cm_id_priv) wait_time = cm_convert_to_ms(cm_id_priv->av.timeout); /* Check if the device started its remove_one */ - spin_lock_irq(&cm.lock); + spin_lock_irqsave(&cm.lock, flags); if (!cm_dev->going_down) queue_delayed_work(cm.wq, &cm_id_priv->timewait_info->work.work, msecs_to_jiffies(wait_time)); - spin_unlock_irq(&cm.lock); + spin_unlock_irqrestore(&cm.lock, flags); cm_id_priv->timewait_info = NULL; }