Skip to content

Commit b9b12f7

Browse files
Seokmann Jujejb
authored andcommitted
[SCSI] qla2xxx: Correct several PCI-EEH issues.
In addition to checking for potentially unnecessary iomem readX()/writeX() operations, a pci_channel_io_perm_failure should not trigger a full internal removal. Found during additional testing with pSeries blade systems. Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
1 parent 6749ce3 commit b9b12f7

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

‎drivers/scsi/qla2xxx/qla_attr.c‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,10 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport)
12821282
if (!fcport)
12831283
return;
12841284

1285-
qla2x00_abort_fcport_cmds(fcport);
1285+
if (unlikely(pci_channel_offline(fcport->vha->hw->pdev)))
1286+
qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16);
1287+
else
1288+
qla2x00_abort_fcport_cmds(fcport);
12861289

12871290
/*
12881291
* Transport has effectively 'deleted' the rport, clear
@@ -1302,6 +1305,10 @@ qla2x00_terminate_rport_io(struct fc_rport *rport)
13021305
if (!fcport)
13031306
return;
13041307

1308+
if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) {
1309+
qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16);
1310+
return;
1311+
}
13051312
/*
13061313
* At this point all fcport's software-states are cleared. Perform any
13071314
* final cleanup of firmware resources (PCBs and XCBs).

‎drivers/scsi/qla2xxx/qla_mbx.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
4545
struct qla_hw_data *ha = vha->hw;
4646
scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev);
4747

48+
if (ha->pdev->error_state > pci_channel_io_frozen)
49+
return QLA_FUNCTION_TIMEOUT;
50+
4851
reg = ha->iobase;
4952
io_lock_on = base_vha->flags.init_done;
5053

‎drivers/scsi/qla2xxx/qla_os.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,10 @@ qla2xxx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
407407
int rval;
408408

409409
if (unlikely(pci_channel_offline(ha->pdev))) {
410-
cmd->result = DID_REQUEUE << 16;
410+
if (ha->pdev->error_state == pci_channel_io_frozen)
411+
cmd->result = DID_REQUEUE << 16;
412+
else
413+
cmd->result = DID_NO_CONNECT << 16;
411414
goto qc24_fail_command;
412415
}
413416

@@ -2990,14 +2993,16 @@ qla2x00_release_firmware(void)
29902993
static pci_ers_result_t
29912994
qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
29922995
{
2996+
scsi_qla_host_t *base_vha = pci_get_drvdata(pdev);
2997+
29932998
switch (state) {
29942999
case pci_channel_io_normal:
29953000
return PCI_ERS_RESULT_CAN_RECOVER;
29963001
case pci_channel_io_frozen:
29973002
pci_disable_device(pdev);
29983003
return PCI_ERS_RESULT_NEED_RESET;
29993004
case pci_channel_io_perm_failure:
3000-
qla2x00_remove_one(pdev);
3005+
qla2x00_abort_all_cmds(base_vha, DID_NO_CONNECT << 16);
30013006
return PCI_ERS_RESULT_DISCONNECT;
30023007
}
30033008
return PCI_ERS_RESULT_NEED_RESET;

0 commit comments

Comments
 (0)