Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5634952pxb; Thu, 20 Jan 2022 01:09:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTpHZviiwtfXUhKjndwq1hanx8iUXUh3xxtZ8BuAt8bm5OawiW68V/kEtGnukLYLhO7265 X-Received: by 2002:a63:f5a:: with SMTP id 26mr31753603pgp.613.1642669756763; Thu, 20 Jan 2022 01:09:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642669756; cv=none; d=google.com; s=arc-20160816; b=QXrrNkILZKq+VV2/zkWKiEjwElKUzIBMCRFFk0yjV2ITrABRL9ERg29cO6CFPhz98X yEe4Z7rdMRur1Apq7XDlWrYoDCpJpcxqTqB139GjRkrQMG8eo8MEnkniYPAy0faKVnNM xV4NrsxvbLwmGVK3LBG+vTXmoIcAXnlJ0yWe2+/VRDx/YQCzvrVptzGG4fhbmBOCKRSO uoQQ6lR56LgYY6fp0gq2HGuUho1vqYcxdamp/rYliyHltKJ6JJzOJRARsiXnJTQ/KYaE wNTU9MeDCE40l37Jwg3e/NpqUKia0J+QYG/Qe+C80uH3flf2iaS85TZeKh/p2ZZqh5c/ ZsVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=HcoTWNlZTBKv+LtZc9vbfRE+otmPHGebDnLv7d0Gx/g=; b=w5y51K8sX48cmi44UNcd5bDEr6o2YclriyN1tGFhnrUnAJR5QFOYa50ajbouJenNqA ew7ouTiX3d6uRLvjeUKDK4RBrZ+4rfhVPsz/iHMxDRN7+pPOtERY1Dj4tc+vtPGXR/jK Du7uxNppqiAYfxSlfk5FKAR5zcvzUAB++ZmYY/pr2wEQ22TyFY+Kr1Nqg+4eCInmn0TG mZ8k+0J6fKjvRba5FJNBpKMTvAJo+gYSPt0SJHtpF265NhtLKmVnuc4xUYv/gmlOmJ8k tw//yh+VWHEb85+/bnRXm3qrxnjnEG2zFAUm9ufuqOnncMrf0H9vZPzoD/qcvM6RitCb yuEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nu12si11064098pjb.24.2022.01.20.01.09.04; Thu, 20 Jan 2022 01:09:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241754AbiARMUZ (ORCPT + 99 others); Tue, 18 Jan 2022 07:20:25 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:4426 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239364AbiARMUZ (ORCPT ); Tue, 18 Jan 2022 07:20:25 -0500 Received: from fraeml742-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4JdSSs1NS0z67wFn; Tue, 18 Jan 2022 20:17:17 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml742-chm.china.huawei.com (10.206.15.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 18 Jan 2022 13:20:22 +0100 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 18 Jan 2022 12:20:18 +0000 From: John Garry To: , , , , CC: , , , , , , , John Garry Subject: [PATCH v2] scsi: pm8001: Fix bogus FW crash for maxcpus=1 Date: Tue, 18 Jan 2022 20:15:05 +0800 Message-ID: <1642508105-95432-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: John Garry Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal --- Changes from v1: - Improve coding style (Damien) - Add comment and commit message info about checking fatal vector (Damien) - Change patch subject to mention "bogus" - Add tags (thanks!) diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index 97750d0ebee9..8a0e5e30b23b 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -4148,10 +4148,22 @@ static int process_oq(struct pm8001_hba_info *pm8001_ha, u8 vec) u32 ret = MPI_IO_STATUS_FAIL; 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 c7e5d93bea92..c41ed039c92a 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.h +++ b/drivers/scsi/pm8001/pm80xx_hwi.h @@ -1405,8 +1405,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.26.2