Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17933823ybl; Thu, 2 Jan 2020 15:06:00 -0800 (PST) X-Google-Smtp-Source: APXvYqz+Pyx5SY6vCQJ3vZZjWJqiEIiEPznCOca9QlyAQ/4IfO0FmoxEJkTbxDi6baAVvXV34aoN X-Received: by 2002:a9d:6f8f:: with SMTP id h15mr90451884otq.1.1578006360473; Thu, 02 Jan 2020 15:06:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578006360; cv=none; d=google.com; s=arc-20160816; b=CdaRqZ0VlLsF5REqRiY1kfrLyOKzG8zpkTPwGSqOXH+isjx7YZNNDycT8aMvZnd02x 3IyWW6KK/SKi25zD0IaBiiYhtywnDO7ZBZlyRW/COlwIGXw+H7lkBdMK6rYlXqv8Jg3a 8CNG/WCAwOqJiCxhbx2m1/miyrV5hx6JJBW7+NKjEnlfTGDdnzAkrQuWBfhUR3TPUa7O 1ZCeuhKxyh3tH05Sqwy1J6rpA/9R7Gs3jPuqd+AgDbBjrV0ckILBFHmVocdf485N0HZS jQxjkqs5uL6lqgxRWno4i8c8gkxLvhnx4kP7c4/sTKH3Tc+lwRd+K6emjVGjsDPCq7gE uWGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pOiJnXInA70s6Y/PojsSiXl62UCPyTsZULKenlDfMRM=; b=m+rnJzYrILDnlKNeIoDc4Hc3XAWCb7RUjVzWszIitE6govVc9asCHunRpOPoXHGr92 9DB2XhvbQTy87Dk0pDv+3sQz0rIkXvtORo3zDDWSep9QhS5hc2au6//jAE+UJdEpiOrY jqGUaftZ35M0Lvv+Kqp1s5jKd5JoPqCX44YF9JybM892BCJlbwMn+oLxIQ3a7LnenHVA UKIdSjttUsLt/0ffPACdzzydLrtTJEpmg0lCMaU2wiqJkmuD6TU06T3+6l0qOP7BeA+q JjW9t9+7GlgrsFwwtWzcv8izPXnzGaVSGMVymwLMhyD28qzTc7xkHQ63ridfmaHsdtRz Cleg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MNs+1GK2; 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 25si7574893oix.178.2020.01.02.15.05.47; Thu, 02 Jan 2020 15:06:00 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=MNs+1GK2; 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 S1727408AbgABWMK (ORCPT + 99 others); Thu, 2 Jan 2020 17:12:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:50888 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727374AbgABWME (ORCPT ); Thu, 2 Jan 2020 17:12:04 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CA90521835; Thu, 2 Jan 2020 22:12:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003124; bh=OiT+WmO8Wve8OpONx14Vr1EhdbL7GD6nrzUZul1vrqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MNs+1GK2nRusvrsf8pjcC1VFBMmQb3mY0Ms5dlXdQJFXBViTu9FUIJQxugKYatmah qiSiacvGUa8mizNkzgazgLgVKu7MetK+8zpKpeuBrVYwbB8JIwwFr81tsO9Xyno8XN LxNRDmnTUyYISxWyzkJ089955vhlrUhhkFe5oaiM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dick Kennedy , James Smart , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.4 003/191] scsi: lpfc: Fix spinlock_irq issues in lpfc_els_flush_cmd() Date: Thu, 2 Jan 2020 23:04:45 +0100 Message-Id: <20200102215830.223956798@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: James Smart [ Upstream commit d38b4a527fe898f859f74a3a43d4308f48ac7855 ] While reviewing the CT behavior, issues with spinlock_irq were seen. The driver should be using spinlock_irqsave/irqrestore in the els flush routine. Changed to spinlock_irqsave/irqrestore. Link: https://lore.kernel.org/r/20190922035906.10977-15-jsmart2021@gmail.com Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/lpfc/lpfc_els.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index d5303994bfd6..0052b341587d 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -7986,20 +7986,22 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport) struct lpfc_sli_ring *pring; struct lpfc_iocbq *tmp_iocb, *piocb; IOCB_t *cmd = NULL; + unsigned long iflags = 0; lpfc_fabric_abort_vport(vport); + /* * For SLI3, only the hbalock is required. But SLI4 needs to coordinate * with the ring insert operation. Because lpfc_sli_issue_abort_iotag * ultimately grabs the ring_lock, the driver must splice the list into * a working list and release the locks before calling the abort. */ - spin_lock_irq(&phba->hbalock); + spin_lock_irqsave(&phba->hbalock, iflags); pring = lpfc_phba_elsring(phba); /* Bail out if we've no ELS wq, like in PCI error recovery case. */ if (unlikely(!pring)) { - spin_unlock_irq(&phba->hbalock); + spin_unlock_irqrestore(&phba->hbalock, iflags); return; } @@ -8037,21 +8039,21 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport) if (phba->sli_rev == LPFC_SLI_REV4) spin_unlock(&pring->ring_lock); - spin_unlock_irq(&phba->hbalock); + spin_unlock_irqrestore(&phba->hbalock, iflags); /* Abort each txcmpl iocb on aborted list and remove the dlist links. */ list_for_each_entry_safe(piocb, tmp_iocb, &abort_list, dlist) { - spin_lock_irq(&phba->hbalock); + spin_lock_irqsave(&phba->hbalock, iflags); list_del_init(&piocb->dlist); lpfc_sli_issue_abort_iotag(phba, pring, piocb); - spin_unlock_irq(&phba->hbalock); + spin_unlock_irqrestore(&phba->hbalock, iflags); } if (!list_empty(&abort_list)) lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, "3387 abort list for txq not empty\n"); INIT_LIST_HEAD(&abort_list); - spin_lock_irq(&phba->hbalock); + spin_lock_irqsave(&phba->hbalock, iflags); if (phba->sli_rev == LPFC_SLI_REV4) spin_lock(&pring->ring_lock); @@ -8091,7 +8093,7 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport) if (phba->sli_rev == LPFC_SLI_REV4) spin_unlock(&pring->ring_lock); - spin_unlock_irq(&phba->hbalock); + spin_unlock_irqrestore(&phba->hbalock, iflags); /* Cancel all the IOCBs from the completions list */ lpfc_sli_cancel_iocbs(phba, &abort_list, -- 2.20.1