stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: John Garry <john.garry@huawei.com>,
	Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Sasha Levin <sashal@kernel.org>,
	jinpu.wang@cloud.ionos.com, jejb@linux.ibm.com,
	linux-scsi@vger.kernel.org
Subject: [PATCH AUTOSEL 5.16 31/52] scsi: pm8001: Fix bogus FW crash for maxcpus=1
Date: Thu,  3 Feb 2022 15:29:25 -0500	[thread overview]
Message-ID: <20220203202947.2304-31-sashal@kernel.org> (raw)
In-Reply-To: <20220203202947.2304-1-sashal@kernel.org>

From: John Garry <john.garry@huawei.com>

[ 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 <damien.lemoal@opensource.wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 2101fc5761c3c..4c5b945bf3187 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -4161,10 +4161,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 c7e5d93bea924..c41ed039c92ac 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.34.1


  parent reply	other threads:[~2022-02-03 20:31 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 20:28 [PATCH AUTOSEL 5.16 01/52] NFS: change nfs_access_get_cached to only report the mask Sasha Levin
2022-02-03 20:28 ` [PATCH AUTOSEL 5.16 02/52] NFSv4 only print the label when its queried Sasha Levin
2022-02-03 20:28 ` [PATCH AUTOSEL 5.16 03/52] nfs: nfs4clinet: check the return value of kstrdup() Sasha Levin
2022-02-03 20:28 ` [PATCH AUTOSEL 5.16 04/52] NFSv4.1: Fix uninitialised variable in devicenotify Sasha Levin
2022-02-03 20:28 ` [PATCH AUTOSEL 5.16 05/52] netfilter: nf_conntrack_netbios_ns: fix helper module alias Sasha Levin
2022-02-03 21:46   ` Jakub Kicinski
2022-02-03 22:23     ` Florian Westphal
2022-02-11 14:41       ` Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 06/52] NFSv4 remove zero number of fs_locations entries error check Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 07/52] NFSv4 store server support for fs_location attribute Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 08/52] NFSv4.1 query for fs_location attr on a new file system Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 09/52] NFSv4 expose nfs_parse_server_name function Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 10/52] NFSv4 handle port presence in fs_location server string Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 11/52] SUNRPC allow for unspecified transport time in rpc_clnt_add_xprt Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 12/52] net/sunrpc: fix reference count leaks in rpc_sysfs_xprt_state_change Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 13/52] sunrpc: Fix potential race conditions in rpc_sysfs_xprt_state_change() Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 14/52] irqchip/realtek-rtl: Service all pending interrupts Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 15/52] perf/x86/rapl: fix AMD event handling Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 16/52] x86/perf: Avoid warning for Arch LBR without XSAVE Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 17/52] sched/pelt: Relax the sync of runnable_sum with runnable_avg Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 18/52] sched: Avoid double preemption in __cond_resched_*lock*() Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 19/52] drm/vc4: Fix deadlock on DSI device attach error Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 20/52] drm: panel-orientation-quirks: Add quirk for the 1Netbook OneXPlayer Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 21/52] net: sched: Clarify error message when qdisc kind is unknown Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 22/52] powerpc/fixmap: Fix VM debug warning on unmap Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 23/52] s390/module: test loading modules with a lot of relocations Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 24/52] arm64: Add Cortex-X2 CPU part definition Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 25/52] arm64: errata: Update ARM64_ERRATUM_[2119858|2224489] with Cortex-X2 ranges Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 26/52] scsi: target: iscsi: Make sure the np under each tpg is unique Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 27/52] scsi: ufs: ufshcd-pltfrm: Check the return value of devm_kstrdup() Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 28/52] scsi: qedf: Add stag_work to all the vports Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 29/52] scsi: qedf: Fix refcount issue when LOGO is received during TMF Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 30/52] scsi: qedf: Change context reset messages to ratelimited Sasha Levin
2022-02-03 20:29 ` Sasha Levin [this message]
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 32/52] scsi: ufs: Use generic error code in ufshcd_set_dev_pwr_mode() Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 33/52] scsi: ufs: Treat link loss as fatal error Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 34/52] scsi: myrs: Fix crash in error case Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 35/52] net: stmmac: reduce unnecessary wakeups from eee sw timer Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 36/52] PM: wakeup: simplify the output logic of pm_show_wakelocks() Sasha Levin
2022-02-04  8:29   ` Greg Kroah-Hartman
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 37/52] PM: hibernate: Remove register_nosave_region_late() Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 38/52] drm/amd/display: Correct MPC split policy for DCN301 Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 39/52] drm/amdgpu/display: adjust msleep limit in dp_wait_for_training_aux_rd_interval Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 40/52] drm/amdgpu/display: use msleep rather than udelay for long delays Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 41/52] usb: dwc2: gadget: don't try to disable ep0 in dwc2_hsotg_suspend Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 42/52] perf: Always wake the parent event Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 43/52] nvme-pci: add the IGNORE_DEV_SUBNQN quirk for Intel P4500/P4600 SSDs Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 44/52] MIPS: Fix build error due to PTR used in more places Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 45/52] net: stmmac: dwmac-sun8i: use return val of readl_poll_timeout() Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 46/52] arm64: Add Cortex-A510 CPU part definition Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 47/52] arm64: errata: Add detection for TRBE ignored system register writes Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 48/52] arm64: errata: Add detection for TRBE invalid prohibited states Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 49/52] arm64: errata: Add detection for TRBE trace data corruption Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 50/52] arm64: cpufeature: List early Cortex-A510 parts as having broken dbm Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 51/52] block: add bio_start_io_acct_time() to control start_time Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 52/52] kasan: test: fix compatibility with FORTIFY_SOURCE Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220203202947.2304-31-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=jejb@linux.ibm.com \
    --cc=jinpu.wang@cloud.ionos.com \
    --cc=john.garry@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).