Skip to content

Commit 330c4e1

Browse files
Mahesh Rajashekharagregkh
authored andcommitted
scsi: smartpqi: Fix kdump issue when controller is locked up
[ Upstream commit 3ada501 ] Avoid dropping into shell if the controller is in locked up state. Driver issues SIS soft reset to bring back the controller to SIS mode while OS boots into kdump mode. If the controller is in lockup state, SIS soft reset does not work. Since the controller lockup code has not been cleared, driver considers the firmware is no longer up and running. Driver returns back an error code to OS and the kdump fails. Link: https://lore.kernel.org/r/164375212337.440833.11955356190354940369.stgit@brunhilda.pdev.net Reviewed-by: Kevin Barnett <[email protected]> Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Signed-off-by: Mahesh Rajashekhara <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 0a92236 commit 330c4e1

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

drivers/scsi/smartpqi/smartpqi_init.c

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7653,6 +7653,21 @@ static int pqi_force_sis_mode(struct pqi_ctrl_info *ctrl_info)
76537653
return pqi_revert_to_sis_mode(ctrl_info);
76547654
}
76557655

7656+
static void pqi_perform_lockup_action(void)
7657+
{
7658+
switch (pqi_lockup_action) {
7659+
case PANIC:
7660+
panic("FATAL: Smart Family Controller lockup detected");
7661+
break;
7662+
case REBOOT:
7663+
emergency_restart();
7664+
break;
7665+
case NONE:
7666+
default:
7667+
break;
7668+
}
7669+
}
7670+
76567671
static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info)
76577672
{
76587673
int rc;
@@ -7677,8 +7692,15 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info)
76777692
* commands.
76787693
*/
76797694
rc = sis_wait_for_ctrl_ready(ctrl_info);
7680-
if (rc)
7695+
if (rc) {
7696+
if (reset_devices) {
7697+
dev_err(&ctrl_info->pci_dev->dev,
7698+
"kdump init failed with error %d\n", rc);
7699+
pqi_lockup_action = REBOOT;
7700+
pqi_perform_lockup_action();
7701+
}
76817702
return rc;
7703+
}
76827704

76837705
/*
76847706
* Get the controller properties. This allows us to determine
@@ -8402,21 +8424,6 @@ static int pqi_ofa_ctrl_restart(struct pqi_ctrl_info *ctrl_info, unsigned int de
84028424
return pqi_ctrl_init_resume(ctrl_info);
84038425
}
84048426

8405-
static void pqi_perform_lockup_action(void)
8406-
{
8407-
switch (pqi_lockup_action) {
8408-
case PANIC:
8409-
panic("FATAL: Smart Family Controller lockup detected");
8410-
break;
8411-
case REBOOT:
8412-
emergency_restart();
8413-
break;
8414-
case NONE:
8415-
default:
8416-
break;
8417-
}
8418-
}
8419-
84208427
static struct pqi_raid_error_info pqi_ctrl_offline_raid_error_info = {
84218428
.data_out_result = PQI_DATA_IN_OUT_HARDWARE_ERROR,
84228429
.status = SAM_STAT_CHECK_CONDITION,

0 commit comments

Comments
 (0)