Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2435853imm; Mon, 28 May 2018 08:03:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrTtQsSAq2MC9V8Hkz4J2V1s+/Us1yg1/8q6k5iJEflM5Zn5yE72xp9744q3G6HZP3+Q+Te X-Received: by 2002:a17:902:bc4c:: with SMTP id t12-v6mr14088487plz.177.1527519834061; Mon, 28 May 2018 08:03:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527519834; cv=none; d=google.com; s=arc-20160816; b=d7evIp9c3mUxkR314t+RztPWAk+lMKY8fTF9sX4x85IAGYRz7pu8y4Yq1Ey4jM7NgS fUvul13pMTrjfp4CXCMn3lTBdMTgk1EujjSpuS6P/hzGEYLywKSFQEXXU4ntqbtkHFM9 Mhpq1hpxIvyjicZUlrS8nyGTr3rI6PdyVEU3IDRtfI4B+ZncZwc9ezGs57Q23Q2ZaKah TkF/rOm0PHB5cC20NIc0yhwYoWB39utQfY6wqT8hieU1pYrQn/hAlK7XC6rhBw6z93Ee wZOnAPmul1TS5jIMk3PuuxyMXqm55hhHdGp6b0sogQnBxWbmlfIX+v0HQw7A7vWmzGoL Y/7A== 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=JSRRHpiObGcd4Je/8DrW1rb/B32G5xDJi/vqwIqvIiw=; b=Yr3eIdixO5qEpy6ecNDrhNazEF+dfufdZNg1ifPcfupX9tbgXBSwCY1T+aO4LsmWO1 0Un3iN217EJc+nJ2qpbOxTwW9Uz2JDrh+hjD/k7cCpCZdxyWKx6EevpEIlTuS9mSFVpJ cQ2DYPbUhI5hiSKQMYmkP+HsSE+BDoOql1c+UHeW/S7wBWgK99yd6Tv+QxVrazEyZQ7M DMmANpBP5Lyf0RXZRYZ8RZMgdsFk8txLHU83U/3wFUWZ2ZIkcu5UHcmaLyKvx3cp6SCd 0x/6LhhiRChSSC1eW+2fpa8YQhjbRRwKnOMRwsVmk5Z5aKMENRHb7c1CXVbJwz/6yqs1 b1SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uVYkWssC; 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 s3-v6si30207792plb.394.2018.05.28.08.03.39; Mon, 28 May 2018 08:03:54 -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=uVYkWssC; 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 S937086AbeE1O7Y (ORCPT + 99 others); Mon, 28 May 2018 10:59:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:45180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034062AbeE1KZv (ORCPT ); Mon, 28 May 2018 06:25:51 -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 D4A0620843; Mon, 28 May 2018 10:25:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527503151; bh=+F05a2JP8hSzgsudkq4bHFMe8E87zaar5lP8LYq++eA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uVYkWssC+t3KI8qoNjdeLKKt2VSAogK39BpReRNhwcsgWQgYE3GCaXjgR/LmGGm1z C+05S5YwSn06SM9uETGTZdd57KgW2IXNKswBFtIvCghAE0ZNfNvVEd8PoGmMWIQ0Ng dGyGsW2iqzx3dVI2P4q+ogQAMxtyFDbUuU1kqVDQ= 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.4 262/268] scsi: lpfc: Fix soft lockup in lpfc worker thread during LIP testing Date: Mon, 28 May 2018 12:03:56 +0200 Message-Id: <20180528100232.539006557@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100202.045206534@linuxfoundation.org> References: <20180528100202.045206534@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.4-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 @@ -691,8 +691,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;