Received: by 10.213.65.68 with SMTP id h4csp441453imn; Tue, 13 Mar 2018 09:09:06 -0700 (PDT) X-Google-Smtp-Source: AG47ELvkW2cCGdz+QbOXnUF4fRK3IIThc79mW23Mj6XE9laG6iIus9MPIsSyJr17Or3mkTU3wKcq X-Received: by 10.99.110.133 with SMTP id j127mr927639pgc.79.1520957346504; Tue, 13 Mar 2018 09:09:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520957346; cv=none; d=google.com; s=arc-20160816; b=mwlcDsOnmv6UXS9xYQjdP3lEuVc9qo859tdyyP4AmPJ/5kvGsPGvQHLeGbLgRz7wYS ojWXmGs20P+kuD5/MXRGY3KjbLMl1rFOj8sKjfE59t14yA0F+2X/GInDwbe31qiL1DnD MwVq659e1SrHuQI0tmLMgkWZKq9lsS4gRAhpIAooBNiEYAvxRIMlNAYqVBP24FjaVc1i cCwIOxKH9Tr5n4XP2wJ8TghlRYN+XcKSnjKRkRTyvnVN6Qbrmauxha1S0c9Zq3TqTAAs a29ONLZKJCIeLSFdp5iqJUm+wGMw2qY2alRllMthSEAl8zAGInVltzX56/eMlkeKx2vy oEtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=18isc3DHP5tf/ToO+eLXV/InokEKttd86HsOWnfmop8=; b=TR4qEcqvX5yyK5wJyssxfFH1woKHZAEGNgyI5qfiOK/Chk3IDj20vahtiO8/pudNtl 1xa8ryRdkov2FSPfoux8pFCgVgSDb/RbUxqqU2+/1dlIxF76009hXlCVwfwxN6/B0tNd WTpQuRuKfwK2K7wCnHpQtGTW3sdzwdsOOVb3mFdUQaR/9MgFAnPdp134thIXD+JtQ6fx mNjL9O5J8H0DSU9Hnbugc6TNLK3D+ZoY0Ap0vTCfYkFg7auvk2qvDvsIYQahlX2+rx2f W51VCgEzIIOg2erGqShw5Mm47IPck/ttjLffRMR180XAVEFcyVlAlX6mU80uAjVaBh3C Zj3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m11-v6si321003pln.350.2018.03.13.09.08.52; Tue, 13 Mar 2018 09:09:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753127AbeCMPgt (ORCPT + 99 others); Tue, 13 Mar 2018 11:36:49 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33664 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752158AbeCMPgp (ORCPT ); Tue, 13 Mar 2018 11:36:45 -0400 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9C6FC10DF; Tue, 13 Mar 2018 15:36:44 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quinn Tran , Himanshu Madhani , Hannes Reinecke , "Martin K. Petersen" Subject: [PATCH 4.14 035/140] scsi: qla2xxx: Fix abort command deadlock due to spinlock Date: Tue, 13 Mar 2018 16:23:58 +0100 Message-Id: <20180313152500.479425073@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152458.201155692@linuxfoundation.org> References: <20180313152458.201155692@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Quinn Tran commit b0dcce746b32ac573343ad39cb3dc485030de95e upstream. Original code acquires hardware_lock to add Abort IOCB onto driver request queue for processing. However, abort_command() will also acquire hardware lock to look up sp pointer before issuing abort IOCB command resulting into a deadlock. This patch safely removes the possible deadlock scenario by removing extra spinlock. Fixes: 6eb54715b54bb ("qla2xxx: Added interface to send explicit LOGO.") Cc: # 4.10+ Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_iocb.c | 3 --- 1 file changed, 3 deletions(-) --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -2394,7 +2394,6 @@ qla2x00_els_dcmd_iocb_timeout(void *data struct scsi_qla_host *vha = sp->vha; struct qla_hw_data *ha = vha->hw; struct srb_iocb *lio = &sp->u.iocb_cmd; - unsigned long flags = 0; ql_dbg(ql_dbg_io, vha, 0x3069, "%s Timeout, hdl=%x, portid=%02x%02x%02x\n", @@ -2402,7 +2401,6 @@ qla2x00_els_dcmd_iocb_timeout(void *data fcport->d_id.b.al_pa); /* Abort the exchange */ - spin_lock_irqsave(&ha->hardware_lock, flags); if (ha->isp_ops->abort_command(sp)) { ql_dbg(ql_dbg_io, vha, 0x3070, "mbx abort_command failed.\n"); @@ -2410,7 +2408,6 @@ qla2x00_els_dcmd_iocb_timeout(void *data ql_dbg(ql_dbg_io, vha, 0x3071, "mbx abort_command success.\n"); } - spin_unlock_irqrestore(&ha->hardware_lock, flags); complete(&lio->u.els_logo.comp); }