From patchwork Wed Jan 24 22:45:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10183219 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3311260233 for ; Wed, 24 Jan 2018 22:46:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AC6928794 for ; Wed, 24 Jan 2018 22:46:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F5DB2877B; Wed, 24 Jan 2018 22:46:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9223D2877B for ; Wed, 24 Jan 2018 22:46:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933163AbeAXWq1 (ORCPT ); Wed, 24 Jan 2018 17:46:27 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:45264 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933045AbeAXWqM (ORCPT ); Wed, 24 Jan 2018 17:46:12 -0500 Received: by mail-qt0-f194.google.com with SMTP id x27so14634390qtm.12 for ; Wed, 24 Jan 2018 14:46:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=usk3lAzzmpIKOP6oGDMRV7fhtMtX/DcaGtX8ZWqbiXs=; b=A9N0h5+rrpKXiPR1ssuKI2wQEBAd1H5zJf0NQuLqGl0hViD3fulV59AjZMAEEjZ3BJ Ksn6VRlbrKeED+TKHa9Kba3Uy/mFqeexk6tFjDXvob0dUNsbzLq1DqKB9Zmrbb7Mqj74 Yf/6ePg/svkkrORhzQNveDdpn9VqIUwqHXgvR2QRMB3/NS3zGnnpfLaYmgCiEsokEyE9 VhBJjszbgzuWLiZvGcUy7kuJjCpuI4+xVnr1+QB8U5Ikd8Eu3GbF4f+EENH4XBui2vup ovAVnb9JNhYjLIBNWu+5QS6hAEnM3LM+nrIPQEF7d+E4306u7LtqziR1EylsmkkJX3RP pXuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=usk3lAzzmpIKOP6oGDMRV7fhtMtX/DcaGtX8ZWqbiXs=; b=htU8eGNh97clOABDFj/Rs4EMCMU59AAAEXElmTQq4DfcveQ4mnjuULQaP9KLiKVk23 zWIkxQSXUVqDq40+B3uAIkXOzH/LyDa7KSwsXypRjjvT1L5iK2adT3IyNClgyORUdl05 6bPNBJBEoYhJc4hzH9SLtQWF6jLxx4SO+qqO1ZRHy3irChtg9SRF5V53Z/+BH+rM3njz /622Ge9v9OPrI7pwJa+dDH/XXMk4835g7a6m5/5O9rEHYPJjlQdyG77/liIJzuaIn61K XV2JTeaUGu+7JsddqEATMO8R0nlBgC3IGJAMR7ku6dh5M18VSHZsomOE8dZJuPpE+ctQ ReYw== X-Gm-Message-State: AKwxytfZiVqgbnW6YnVvEjywRce5lu8MkGSAhFmLaULdzv8fVpggPk1K gYsvYHfKNUfK1Df4UcOg3aIUcg== X-Google-Smtp-Source: AH8x224FWf4z1hbi0R0oD34NkR1A7i2FQM2pk7T6y8PcXVxbcx0Mcbxf+JrhXS5I0IlnZ3GwfZkyrg== X-Received: by 10.233.221.197 with SMTP id r188mr12387923qkf.107.1516833971191; Wed, 24 Jan 2018 14:46:11 -0800 (PST) Received: from pallmd1.broadcom.com ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id e5sm977713qkj.87.2018.01.24.14.46.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Jan 2018 14:46:10 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH 10/19] lpfc: Fix soft lockup in lpfc worker thread during LIP testing Date: Wed, 24 Jan 2018 14:45:39 -0800 Message-Id: <20180124224548.9530-11-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20180124224548.9530-1-jsmart2021@gmail.com> References: <20180124224548.9530-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/scsi/lpfc/lpfc_hbadisc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index b159a5c4e388..9265906d956e 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -696,8 +696,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) {