Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2497241imm; Mon, 28 May 2018 09:11:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZosysEh592U/OZK8ElJFfeXieVJPhmq2bEtLsQcfcNp0iiu5M+iBKevkav/i1p4zXkUKz2x X-Received: by 2002:a63:7341:: with SMTP id d1-v6mr10890171pgn.404.1527523895773; Mon, 28 May 2018 09:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527523895; cv=none; d=google.com; s=arc-20160816; b=yw51vIMgqPLTyZvm6bJx5Mm+RQC0la3CouwnivfpDBw6zEh5NaWwoRfObRWmMNi+ks 5ZXN64PHMTaJZrq31XM8me9PXVDbFDqvlCPRvzFsA1M7iGo/P8OTGm4tY2hfCOg0BM63 Dj66SVi3gp+gE7R5/Crfp6KWlVjQVxCs7DmsoOp5DFLPmucgzVmHIIhu5BBLZZiOWMOE EoT1WgV0vatHPy3Xy+p44I/iOCXxvXZUjyBo2dXE1ZyixJIGg89yGTMAWRRNKYezioJw N3NjMoMhZdwZLSsMt504jt19vATeVph/H2mN2EK1V8wuwVsT6ir/p5qi2doA4vG5Ca0i unCQ== 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=WWQCCEW3Kf4cyF3n4Qx0l/EPbfHCvKFXFn/p317/DDE=; b=CRCXsorgnXArpAldWJZHqWqhKA8HW6qFfzQoQuVyEUwdXatebWnPtaXY8X2fQneox1 yR2nqqE4u4AFtRGe0qErP1lQ3YDHKBPJpV4FIjJpDbNpy5Vao4HmOLRsYAy0T0Y2VJBm AF7xwtJvXFNHHEB8Sotc9wCdzyB9e/56q+J3EGh5qmSgec6Q9+bJN2SwJGjKjNRrU+Qk WivSOCDWyZUARuNywp8Yew9JG+W9npTBr9c4z43gEWMP0MFm8xC89bW0V8IPUiOMg4m6 3jC13tR2DHxTExvGMbxG0ZHX4UVXBIPDQpfe+DAApeslhPVgqR9+zYver8KNzBLgZofJ G2dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aH0nXhFY; 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 o65-v6si15651653pfb.188.2018.05.28.09.11.21; Mon, 28 May 2018 09:11:35 -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=aH0nXhFY; 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 S936894AbeE1QKs (ORCPT + 99 others); Mon, 28 May 2018 12:10:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:33608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936814AbeE1KNq (ORCPT ); Mon, 28 May 2018 06:13:46 -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 9AB9620883; Mon, 28 May 2018 10:13:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502426; bh=TywDjJLiFvdq4Vw0JCSfisrF3e9vXS/zSIdKJunixzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aH0nXhFYsH7w+Df2r7LH6ubTotT8BqiQ1Ak6oD1Mis/kyTBZSkk6q0O0HBH9JGPAx LPJBsR9V6QCOZeQPzwm73UNmhCn4rV2CCpfZrnQVSPRALwhaVirlHGKrlsh3ejdCDl BFHuqFy/JxomZY5W/qCxydXTpWGbZegxNWmJMIgk= 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 3.18 182/185] scsi: lpfc: Fix soft lockup in lpfc worker thread during LIP testing Date: Mon, 28 May 2018 12:03:43 +0200 Message-Id: <20180528100116.679967759@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100050.700971285@linuxfoundation.org> References: <20180528100050.700971285@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 3.18-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 @@ -716,8 +716,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;