Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5968919pxb; Mon, 14 Feb 2022 11:58:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9B299PAsuGob4laP33bDxa/JCuq4rs76bfMUJPpz0wd1NFi8HjEbmJpUEFGNqcX4YOfw2 X-Received: by 2002:a17:902:f60c:: with SMTP id n12mr401542plg.155.1644868704356; Mon, 14 Feb 2022 11:58:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644868704; cv=none; d=google.com; s=arc-20160816; b=vm5QcCNGJcuUQlykFAOeiGm97XyiqdCmkt9mC0heRdLNjixjnwCdqIDfNUxqPBnsVP Y8hCGJTi77wvJ2GulgDTkCba9cV5jODXl+bJ7dHJ+Su+SnOKHyyId005rOphA9WLFRfD GHnJMtfVrLmG8JumPKlrClgdEghHPwlkT8rEASvFgb+f7wV6qrmc9hbMnBmSXdHOY3Pa /jhWApUsrnvq5mIUILOGVugnPrjU8Dd5HDnEPLDJxBDzAg9cLN8VlzqFJbRUkzXm2psp UCDx0TJOQ5K1oPIEQsvf5hRr+rCWHr/v6DJwRQ8+OLxxDrdi5j9oqD17gYWtFm8MQfmV H/eg== 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=bnYm0m47liidUCqbt4qY9mdusBNmBvflqKrT3cvs3Tg=; b=gR5jeKJk58tkutFKR63Iel9iOah76+nXn5psm7uzxQhlZWyWQHL0KrJdgsfJ4a8z5P xvI/xM7IAYdllmpPXclfpbhd1DrrgmNxMJ7EaYj5PObJBJgPFDxmmyJNRTJbFFkayLdU HqRJgQwkBdO5Gwh6pPhmoxUbNoccBNpitf91fyG5/xzI/EAmLlipoagfc1SAhYpr3FkS GykWhgfgNIK3Hwb/3ek6wpvxBwI0xNeZlaLYhr51Vb864Zs9T60CcTJhptOfKjYdhFPD Axwoea0xtOSVGf/S14ryZ4SBgdCEWLMsHX2w8Voa6rCda5iatulZ74ohFYPC+n+IoCUK Qs5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=M4cb2aFo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d128si587057pgc.347.2022.02.14.11.58.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 11:58:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=M4cb2aFo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 98C0B13C3A7; Mon, 14 Feb 2022 11:39:42 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343554AbiBNJuv (ORCPT + 99 others); Mon, 14 Feb 2022 04:50:51 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343678AbiBNJqY (ORCPT ); Mon, 14 Feb 2022 04:46:24 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DA6C25C4D; Mon, 14 Feb 2022 01:39:48 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id DBB9FB80DA9; Mon, 14 Feb 2022 09:39:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5952C340E9; Mon, 14 Feb 2022 09:39:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831585; bh=DliUIAbOhT7PflrHsH2KMRlmp6VOx0lJtRmJdkFXJXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M4cb2aFoH1IFGQhQ37GrstAaOvIJF8zO5lMJ9qTO6o2O3jmz/gGBc+wcYgVW9LniQ SDDxNCAUxsAZvLut9upX45Y8Ssm8qyIvzHmhtynA+I1S6SOu0vy9VpFmCBbVZFLS2q d1iTdGzsJXKpxbJV0gTTYb9tqxL+JgRz8Ochqr1U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Damien Le Moal , John Garry , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.10 029/116] scsi: pm8001: Fix bogus FW crash for maxcpus=1 Date: Mon, 14 Feb 2022 10:25:28 +0100 Message-Id: <20220214092459.689498513@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092458.668376521@linuxfoundation.org> References: <20220214092458.668376521@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: John Garry [ Upstream commit 62afb379a0fee7e9c2f9f68e1abeb85ceddf51b9 ] According to the comment in check_fw_ready() we should not check the IOP1_READY field in register SCRATCH_PAD_1 for 8008 or 8009 controllers. However we check this very field in process_oq() for processing the highest index interrupt vector. The highest interrupt vector is checked as the FW is programmed to signal fatal errors through this irq. Change that function to not check IOP1_READY for those mentioned controllers, but do check ILA_READY in both cases. The reason I assume that this was not hit earlier was because we always allocated 64 MSI(X), and just did not pass the vector index check in process_oq(), i.e. the handler never ran for vector index 63. Link: https://lore.kernel.org/r/1642508105-95432-1-git-send-email-john.garry@huawei.com Tested-by: Damien Le Moal Reviewed-by: Damien Le Moal Signed-off-by: John Garry Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/pm8001/pm80xx_hwi.c | 16 ++++++++++++++-- drivers/scsi/pm8001/pm80xx_hwi.h | 6 +++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index a203a4fc2674a..b22a8ab754faa 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -4057,10 +4057,22 @@ static int process_oq(struct pm8001_hba_info *pm8001_ha, u8 vec) unsigned long flags; u32 regval; + /* + * Fatal errors are programmed to be signalled in irq vector + * pm8001_ha->max_q_num - 1 through pm8001_ha->main_cfg_tbl.pm80xx_tbl. + * fatal_err_interrupt + */ if (vec == (pm8001_ha->max_q_num - 1)) { + u32 mipsall_ready; + + if (pm8001_ha->chip_id == chip_8008 || + pm8001_ha->chip_id == chip_8009) + mipsall_ready = SCRATCH_PAD_MIPSALL_READY_8PORT; + else + mipsall_ready = SCRATCH_PAD_MIPSALL_READY_16PORT; + regval = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_1); - if ((regval & SCRATCH_PAD_MIPSALL_READY) != - SCRATCH_PAD_MIPSALL_READY) { + if ((regval & mipsall_ready) != mipsall_ready) { pm8001_ha->controller_fatal_error = true; pm8001_dbg(pm8001_ha, FAIL, "Firmware Fatal error! Regval:0x%x\n", diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h index 701951a0f715b..0dfe9034f7e7f 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.h +++ b/drivers/scsi/pm8001/pm80xx_hwi.h @@ -1391,8 +1391,12 @@ typedef struct SASProtocolTimerConfig SASProtocolTimerConfig_t; #define SCRATCH_PAD_BOOT_LOAD_SUCCESS 0x0 #define SCRATCH_PAD_IOP0_READY 0xC00 #define SCRATCH_PAD_IOP1_READY 0x3000 -#define SCRATCH_PAD_MIPSALL_READY (SCRATCH_PAD_IOP1_READY | \ +#define SCRATCH_PAD_MIPSALL_READY_16PORT (SCRATCH_PAD_IOP1_READY | \ SCRATCH_PAD_IOP0_READY | \ + SCRATCH_PAD_ILA_READY | \ + SCRATCH_PAD_RAAE_READY) +#define SCRATCH_PAD_MIPSALL_READY_8PORT (SCRATCH_PAD_IOP0_READY | \ + SCRATCH_PAD_ILA_READY | \ SCRATCH_PAD_RAAE_READY) /* boot loader state */ -- 2.34.1