Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2009588imm; Thu, 24 May 2018 04:27:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq7MvksWAsIm44ySqEw7JUiqnvIYb1bI44/rar2YC2L0zCyPgGjuZlxMorJNY9BsEBX//rz X-Received: by 2002:a62:8785:: with SMTP id i127-v6mr6926278pfe.201.1527161273546; Thu, 24 May 2018 04:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527161273; cv=none; d=google.com; s=arc-20160816; b=v1T8Dxb31kXBvkOE6Jb0vcpnQQIinh7tBsBzKGqEDWzZeN2eJHQyAp5ZyLrpzTHPX6 RmdQqK9x7mSqtjH5pjLqtrWNxXrakkL/nuEG/Xh0gPNHPGpo0CNrh6k/K4O9ETfSgFZ+ fzUyyqi7E4Bp9eqj4yS5mYuCxoLza1jh60uVJQNa0QIlYJkvwQBmLzE5ShDjIeGr4Pcs m0OFU8E4i1TV4d6n2W4UDx0zprXePyEbevRxM85UFJzaBsyiqOqSalUNaytXeZwWWSED 3xaOw0wu1d13cv7PHPd3D0Np/hA2aWdVNOrh+dYst11qaCxY0S3MSR42QfTJqDOe2KyM W2aw== 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=GftC1dQCiIBzWcjQd5IrrrpksY0cJyZqcQZK1to5w6s=; b=MNmXWpjIeKzFSwXQJKEA0LWWuXUHbw95eqhwjIMthin4kYT4Q7sKJBZKPZj3v20H7v jcxwnR2Qo4dtTYpWvaFhhICWVSWcrBEdqnN/Bn6cUJkZVzIBCbH0IiKGXUN3Jws4zy+M gFFp+vVo6Eb+Y107cbBS1k6cvJ0rEEGradAsKks2Di+n3t2kzV1ibGfjUkCGnIyoyXfZ PUH5x58wDp4O0RnXJGQ/RoxToeJa0GY59EbOIXzfvdUVmG6O1t+16DKJt0vnDBCPnyZa ntoCBSWwRmG/MKcm/tKmA3j7vF0qRkvZAwwkezhTq9TDu8gjEYnqtXqcjBgPYqbBVCb+ MsQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XF4zNPD7; 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 g9-v6si20532915plt.232.2018.05.24.04.27.38; Thu, 24 May 2018 04:27:53 -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=XF4zNPD7; 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 S967714AbeEXJv3 (ORCPT + 99 others); Thu, 24 May 2018 05:51:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:46154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967312AbeEXJvT (ORCPT ); Thu, 24 May 2018 05:51:19 -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 4C63120891; Thu, 24 May 2018 09:51:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155478; bh=2ABZEeBcKlztO3Zm8WmosQZ8lRIZ7iIBsa3YllEv+KM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XF4zNPD7B8Ma3S2dQzWiYAe8aFaEGqTnUGcAbhTSTk+yv73FCIq0lWPVCD7AqFAOR TB14cLKQqGzxGeiwxNYiYSPGkRkKHgGIUm3TfVzZcwM16oX60je6MfJkl8gDvanbwB WRYqrEgwfnO1OTSQqL9wk8R4MennaGvhqz7zvMSU= 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.9 65/96] scsi: lpfc: Fix soft lockup in lpfc worker thread during LIP testing Date: Thu, 24 May 2018 11:38:48 +0200 Message-Id: <20180524093609.181789504@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093605.602125311@linuxfoundation.org> References: <20180524093605.602125311@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.9-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 @@ -690,8 +690,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) { pring->flag &= ~LPFC_DEFERRED_RING_EVENT;