Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1967326imm; Thu, 24 May 2018 03:44:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr+ALHr3NK8KXhOgw00NnjmgvI8I8hH9V6o3T/v5Gq1C7pnqQxZpneQrjaFukMUefkbkZvQ X-Received: by 2002:a17:902:bb92:: with SMTP id m18-v6mr6915418pls.46.1527158696090; Thu, 24 May 2018 03:44:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527158696; cv=none; d=google.com; s=arc-20160816; b=zoPaH7PSd49Cl/3jRe1CTYDxLoL9sLR2NiVHHJZA5p7CJ8i6dOoJAzT1TsL8ZuXy5a fugLZdMfJpRzdmtRw4C4/RuKQ2dL1M67TQk6W/Lq0XB4UGCiAGNhVK9qWWhfS4UawAIU PU9d1YcdrJ8YTFkbOEVcyhRPSXgaXELkfh5Z2oS9c8E9nTYvY/9bzEVhLZ+RfoaxxSOx MJeNDqmEkymia8PZG/l6IoJp7Y2LrRRlLaLwPCCaZqlfpiWiOdSIvh9SYwguacKJkcpJ 4u3jUVMKSV2Bzx0oVnC/3Kk/MYf9PszEkOxoxzSLnpcnF0KpeDmxwDSb8QJN3uVP9O+m byGw== 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:dkim-signature :arc-authentication-results; bh=5t7vqtZ5kXZx6HQZk5N0Da7LW0mTxOIYc4ii26eVb8M=; b=oD4Eu7Kmzks3qpwKcFnM+TnzkXqDs+5eewx6MrXLT4Qw/fq69S1FOGd4nitz6Qy/0c Upm8ys5ht1LxsivAFS+jtjXmcKjVVrP/tAlIepupwSKwD02VPWq9DmRmJYZncQeNyGi+ sL60NfRVfgru8H61q3voR+lHQAHuYG9KA2QtslGVOM6gN4FOor/L4l+X0EZdQ33cY18A uu04Q8OYc41PrD8PMo5Sm+CBWO2ShMfr1er7cfR2g+SwwE/luXN9Y6uF2FDkZzHUjCR9 ZLPM7m5hwPrCGDoSL9hGv5loL/cU96dsUSlEXx2PqUBoMixucvpuxxs8Zp21eJu6E+ni b8fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QWv4RL/s; 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 g27-v6si9329576pgn.529.2018.05.24.03.44.41; Thu, 24 May 2018 03:44:56 -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; dkim=pass header.i=@kernel.org header.s=default header.b=QWv4RL/s; 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 S1030580AbeEXJ6N (ORCPT + 99 others); Thu, 24 May 2018 05:58:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:37902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030311AbeEXJ6I (ORCPT ); Thu, 24 May 2018 05:58:08 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 1B33820870; Thu, 24 May 2018 09:58:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155887; bh=0iSV+G1RBU7eUuuQePwwYLT0AwJ9Za62vQEKDUFip08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QWv4RL/sYzcvqF0i0WnM4cw1wg3sAzJd7bHLIwwxGhjVIZ7ghLy2/kVrYPSyoGehu 8i2VDM5LflzkY5VEqrQfYZlZMoRJ4bT3OXXK9PRS/OESyYVexygUaUpdh/7nz9MjDF KK890znsxTNTkDev0VvIzS6GVEoSpeBDJ4rCMyhg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dick Kennedy , James Smart , Hannes Reinecke , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 119/165] scsi: lpfc: Fix soft lockup in lpfc worker thread during LIP testing Date: Thu, 24 May 2018 11:38:45 +0200 Message-Id: <20180524093626.825384174@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@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: James Smart [ Upstream commit 161df4f09987ae2e9f0f97f0b38eee298b4a39ff ] During link bounce testing in a point-to-point topology, the host may enter a soft lockup on the lpfc_worker thread: Call Trace: lpfc_work_done+0x1f3/0x1390 [lpfc] lpfc_do_work+0x16f/0x180 [lpfc] kthread+0xc7/0xe0 ret_from_fork+0x3f/0x70 The driver was simultaneously setting a combination of flags that caused lpfc_do_work()to effectively spin between slow path work and new event data, causing the lockup. Ensure in the typical wq completions, that new event data flags are set if the slow path flag is running. The slow path will eventually reschedule the wq handling. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/lpfc/lpfc_hbadisc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -698,8 +698,9 @@ lpfc_work_done(struct lpfc_hba *phba) phba->hba_flag & HBA_SP_QUEUE_EVT)) { if (pring->flag & LPFC_STOP_IOCB_EVENT) { pring->flag |= LPFC_DEFERRED_RING_EVENT; - /* Set the lpfc data pending flag */ - set_bit(LPFC_DATA_READY, &phba->data_flags); + /* Preserve legacy behavior. */ + if (!(phba->hba_flag & HBA_SP_QUEUE_EVT)) + set_bit(LPFC_DATA_READY, &phba->data_flags); } else { if (phba->link_state >= LPFC_LINK_UP || phba->link_flag & LS_MDS_LOOPBACK) {