Received: by 10.213.65.68 with SMTP id h4csp451479imn; Tue, 13 Mar 2018 09:28:14 -0700 (PDT) X-Google-Smtp-Source: AG47ELupGEm1/r5kd8reDCVqNwgYQelJSfRTwtKMNYjzG/LnzS0fXPTTBoF8wmfQrPe5n327mm6J X-Received: by 2002:a17:902:aa83:: with SMTP id d3-v6mr1096766plr.36.1520958494635; Tue, 13 Mar 2018 09:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520958494; cv=none; d=google.com; s=arc-20160816; b=JBAKbjlz5XTPJHGASPSCQEYrVEC/ijICKyVBdBSSTqYO6diuDAWlUlCr+PpquUSYKZ iP3qdS45tZ8stdZATrSrkduytGGBcr2FHJtKIv68NIYj1mgzCJr+v6mxFEKE6T/864W0 HFJW6AGfi73akBbVnLI6AAXvA7uD4+w06uMo0vwtkhO/wHhPjTXwBk4UnI95Y6Pg/SSz dmB7YFvAc5v21eS/shhRp3jcIVSju1WT+p0fCR37Puns2yI1NtJ83xv4Vd/GOXjouS5u Xh9VsfzB/eNajEJcYl3Y+SM3/40L8528OpzBWiAEY/F73fEWhumLkBYW/GZtOJbkQPx9 q6sQ== 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=+lJnF7hjEEzgC9z1MvAxKEuRmxtMvWOIlZzqsEDGllQ=; b=j5CbnnpaVXG1PfAxjVTvTiysZd3Clg2Wmi1dDETFOTVm5T0iC7/L5e+k2u+4R5Wke3 O7WZtWPHl7Ud1RFtrlDLFARAiVK/KO4e4ybUJI6Fgo746lguq9a9u3iEVORAXFxCeI1S lFxdwza6nOqDt5PURIfqhmiYLwtZ0qPDEfeMFcEjVzaccg5wSArv80HmjGa/lJcGgCP4 7SgXrKJvf0IzOmhfiA8tAkrgS1WC0qG3HiUcH2i6RCeBFUjqZ/pcsLrl9CDkly5Da127 UBLgkh0T3ex0oXwcxTydxiYLrpi1ZN7HL7fvpYfQu0qV31m1CaRzPW5JROoHMCmgJ/KP tmgg== 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 d81si323644pfj.222.2018.03.13.09.28.00; Tue, 13 Mar 2018 09:28:14 -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 S933744AbeCMQ0T (ORCPT + 99 others); Tue, 13 Mar 2018 12:26:19 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60888 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933646AbeCMPd5 (ORCPT ); Tue, 13 Mar 2018 11:33:57 -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 2CE7C49D; Tue, 13 Mar 2018 15:33:57 +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.15 136/146] scsi: qla2xxx: Fix abort command deadlock due to spinlock Date: Tue, 13 Mar 2018 16:25:03 +0100 Message-Id: <20180313152330.597726883@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152320.439085687@linuxfoundation.org> References: <20180313152320.439085687@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.15-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); }