Skip to content

Commit 62afb37

Browse files
John Garrymartinkpetersen
authored andcommitted
scsi: pm8001: Fix bogus FW crash for maxcpus=1
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/[email protected] Tested-by: Damien Le Moal <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 64fd4af commit 62afb37

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

drivers/scsi/pm8001/pm80xx_hwi.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4151,10 +4151,22 @@ static int process_oq(struct pm8001_hba_info *pm8001_ha, u8 vec)
41514151
u32 ret = MPI_IO_STATUS_FAIL;
41524152
u32 regval;
41534153

4154+
/*
4155+
* Fatal errors are programmed to be signalled in irq vector
4156+
* pm8001_ha->max_q_num - 1 through pm8001_ha->main_cfg_tbl.pm80xx_tbl.
4157+
* fatal_err_interrupt
4158+
*/
41544159
if (vec == (pm8001_ha->max_q_num - 1)) {
4160+
u32 mipsall_ready;
4161+
4162+
if (pm8001_ha->chip_id == chip_8008 ||
4163+
pm8001_ha->chip_id == chip_8009)
4164+
mipsall_ready = SCRATCH_PAD_MIPSALL_READY_8PORT;
4165+
else
4166+
mipsall_ready = SCRATCH_PAD_MIPSALL_READY_16PORT;
4167+
41554168
regval = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_1);
4156-
if ((regval & SCRATCH_PAD_MIPSALL_READY) !=
4157-
SCRATCH_PAD_MIPSALL_READY) {
4169+
if ((regval & mipsall_ready) != mipsall_ready) {
41584170
pm8001_ha->controller_fatal_error = true;
41594171
pm8001_dbg(pm8001_ha, FAIL,
41604172
"Firmware Fatal error! Regval:0x%x\n",

drivers/scsi/pm8001/pm80xx_hwi.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,8 +1405,12 @@ typedef struct SASProtocolTimerConfig SASProtocolTimerConfig_t;
14051405
#define SCRATCH_PAD_BOOT_LOAD_SUCCESS 0x0
14061406
#define SCRATCH_PAD_IOP0_READY 0xC00
14071407
#define SCRATCH_PAD_IOP1_READY 0x3000
1408-
#define SCRATCH_PAD_MIPSALL_READY (SCRATCH_PAD_IOP1_READY | \
1408+
#define SCRATCH_PAD_MIPSALL_READY_16PORT (SCRATCH_PAD_IOP1_READY | \
14091409
SCRATCH_PAD_IOP0_READY | \
1410+
SCRATCH_PAD_ILA_READY | \
1411+
SCRATCH_PAD_RAAE_READY)
1412+
#define SCRATCH_PAD_MIPSALL_READY_8PORT (SCRATCH_PAD_IOP0_READY | \
1413+
SCRATCH_PAD_ILA_READY | \
14101414
SCRATCH_PAD_RAAE_READY)
14111415

14121416
/* boot loader state */

0 commit comments

Comments
 (0)