Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2928802rwb; Mon, 15 Aug 2022 14:14:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR61f+/d3OObg9DZhbTVXjcO+qeY0I0UKdBkljmKD0pDf6zaB5D4B6Nm4IKPuYWKT3WtjjlD X-Received: by 2002:a05:6a00:816:b0:52f:43f9:b644 with SMTP id m22-20020a056a00081600b0052f43f9b644mr17925290pfk.57.1660597941889; Mon, 15 Aug 2022 14:12:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597941; cv=none; d=google.com; s=arc-20160816; b=baHt9vQwomolBUC+S73xpyD6EHtLnHqJY2o+RMHrObmK+C1Sdr49SNh0aDwD51zlQa 8ynTnQE8/jHDybriRCQz5TU7/kGQovIAH+vcv3Cv8yvyrD7lLpyI1hpCn+IP0BsAXK9T YEvGejBasaSTlC7ZfpMkIT1axxzEULHMLMxrsBVbofE6wOwKBPUPDuk6J3rM5QctIYIf UMDInS0sNGXSXO//WQ36EjiTIg8tmYX9t+IoiJ09Qoxx1OG4mFRLPl293qxfsUIgBgRm GOExPAn0Kzr7fbaPBABoHPFAKgEc0eVv3DFAMHatw56M7v49qYOzP+iRpU2yAIhOGVOI h/Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DW3pCnAG4/CuqkYfi810PD+Me8Ho89wfWrm2gV+F4gQ=; b=e2bGZJXRzfA+SOiEpqqXQc++IStNpzZqECthM0CL+9Hfbgcuwo8x/1YlBodNsr6b5C kQb5csZ21/e67TD0bghvhdid+W9iCCUHMDS6cg6B0l5/o7CdiiezYaH7tzf7prQmO/uU XwuSja+uQ63K/ZporQdLqH6BxAv09fLCT72gYC2oYp0UILbIRTKKkOFK/7ZsSwRnZ5YI W8/gQ4vA/LQIUF826PexvhHI+vPF//vNrUSwfCBbaw5i2IMPY0/BZlj0euBPmT+sSlew aDkxFiA2O4+0VBPSe7sNhCv3O0d6A/Y8NhPbq4CL2fEwPuRkHwf0XlUQXp2bIqXj8QSD k6NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ec1jM+0z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r24-20020a6560d8000000b0041cfc9ef388si12240824pgv.159.2022.08.15.14.12.10; Mon, 15 Aug 2022 14:12:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ec1jM+0z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345105AbiHOTqI (ORCPT + 99 others); Mon, 15 Aug 2022 15:46:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345251AbiHOTmm (ORCPT ); Mon, 15 Aug 2022 15:42:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D2616C104; Mon, 15 Aug 2022 11:48:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 89311611EC; Mon, 15 Aug 2022 18:48:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FD0FC433D7; Mon, 15 Aug 2022 18:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589300; bh=BWkT5Y8yauvayeEYP3032GkgL1q2sJJNLjErP6LavCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ec1jM+0zu4BYGCslZtrXUUsiojiyvA5mPVzDQrlEvEKBq/7p/AIRU7LTwX7nLRe1x kugJXadSK71UcHRVLsTqiti1j3ylqNk1DtzN2D0mGNJd/V3xxDtSxuZETUiCucxeqc wKGv3553CTUNIQVBFG5I2NKmE8uOcsr3iDoSt4Bk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Naresh Bannoth , Kyle Mahlkuch , Quinn Tran , Nilesh Javali , "Martin K. Petersen" Subject: [PATCH 5.15 676/779] scsi: qla2xxx: Fix erroneous mailbox timeout after PCI error injection Date: Mon, 15 Aug 2022 20:05:20 +0200 Message-Id: <20220815180406.248729432@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Quinn Tran commit f260694e6463b63ae550aad25ddefe94cb1904da upstream. Clear wait for mailbox interrupt flag to prevent stale mailbox: Feb 22 05:22:56 ltcden4-lp7 kernel: qla2xxx [0135:90:00.1]-500a:4: LOOP UP detected (16 Gbps). Feb 22 05:22:59 ltcden4-lp7 kernel: qla2xxx [0135:90:00.1]-d04c:4: MBX Command timeout for cmd 69, ... To fix the issue, driver needs to clear the MBX_INTR_WAIT flag on purging the mailbox. When the stale mailbox completion does arrive, it will be dropped. Link: https://lore.kernel.org/r/20220616053508.27186-11-njavali@marvell.com Fixes: b6faaaf796d7 ("scsi: qla2xxx: Serialize mailbox request") Cc: Naresh Bannoth Cc: Kyle Mahlkuch Cc: stable@vger.kernel.org Reported-by: Naresh Bannoth Tested-by: Naresh Bannoth Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_mbx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -276,6 +276,12 @@ qla2x00_mailbox_command(scsi_qla_host_t atomic_inc(&ha->num_pend_mbx_stage3); if (!wait_for_completion_timeout(&ha->mbx_intr_comp, mcp->tov * HZ)) { + ql_dbg(ql_dbg_mbx, vha, 0x117a, + "cmd=%x Timeout.\n", command); + spin_lock_irqsave(&ha->hardware_lock, flags); + clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); + spin_unlock_irqrestore(&ha->hardware_lock, flags); + if (chip_reset != ha->chip_reset) { eeh_delay = ha->flags.eeh_busy ? 1 : 0; @@ -288,12 +294,6 @@ qla2x00_mailbox_command(scsi_qla_host_t rval = QLA_ABORTED; goto premature_exit; } - ql_dbg(ql_dbg_mbx, vha, 0x117a, - "cmd=%x Timeout.\n", command); - spin_lock_irqsave(&ha->hardware_lock, flags); - clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); - spin_unlock_irqrestore(&ha->hardware_lock, flags); - } else if (ha->flags.purge_mbox || chip_reset != ha->chip_reset) { eeh_delay = ha->flags.eeh_busy ? 1 : 0;