Skip to content

Commit 76c0b6a

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: - one driver patch (qla2xxx) which fixes a problem caused by an existing regression fix (FCP discovery is failing) - one generic fix to a longstanding bug in libsas that causes I/O eventually to hang to the device in the face of ATA error recovery. * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: qla2xxx: Remove FC_NO_LOOP_ID for FCP and FC-NVMe Discovery scsi: libsas: defer ata device eh commands to libata
2 parents 645102e + 14bc1df commit 76c0b6a

File tree

2 files changed

+13
-21
lines changed

2 files changed

+13
-21
lines changed

drivers/scsi/libsas/sas_scsi_host.c

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ int sas_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
223223
static void sas_eh_finish_cmd(struct scsi_cmnd *cmd)
224224
{
225225
struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(cmd->device->host);
226+
struct domain_device *dev = cmd_to_domain_dev(cmd);
226227
struct sas_task *task = TO_SAS_TASK(cmd);
227228

228229
/* At this point, we only get called following an actual abort
@@ -231,37 +232,29 @@ static void sas_eh_finish_cmd(struct scsi_cmnd *cmd)
231232
*/
232233
sas_end_task(cmd, task);
233234

235+
if (dev_is_sata(dev)) {
236+
/* defer commands to libata so that libata EH can
237+
* handle ata qcs correctly
238+
*/
239+
list_move_tail(&cmd->eh_entry, &sas_ha->eh_ata_q);
240+
return;
241+
}
242+
234243
/* now finish the command and move it on to the error
235244
* handler done list, this also takes it off the
236245
* error handler pending list.
237246
*/
238247
scsi_eh_finish_cmd(cmd, &sas_ha->eh_done_q);
239248
}
240249

241-
static void sas_eh_defer_cmd(struct scsi_cmnd *cmd)
242-
{
243-
struct domain_device *dev = cmd_to_domain_dev(cmd);
244-
struct sas_ha_struct *ha = dev->port->ha;
245-
struct sas_task *task = TO_SAS_TASK(cmd);
246-
247-
if (!dev_is_sata(dev)) {
248-
sas_eh_finish_cmd(cmd);
249-
return;
250-
}
251-
252-
/* report the timeout to libata */
253-
sas_end_task(cmd, task);
254-
list_move_tail(&cmd->eh_entry, &ha->eh_ata_q);
255-
}
256-
257250
static void sas_scsi_clear_queue_lu(struct list_head *error_q, struct scsi_cmnd *my_cmd)
258251
{
259252
struct scsi_cmnd *cmd, *n;
260253

261254
list_for_each_entry_safe(cmd, n, error_q, eh_entry) {
262255
if (cmd->device->sdev_target == my_cmd->device->sdev_target &&
263256
cmd->device->lun == my_cmd->device->lun)
264-
sas_eh_defer_cmd(cmd);
257+
sas_eh_finish_cmd(cmd);
265258
}
266259
}
267260

@@ -631,12 +624,12 @@ static void sas_eh_handle_sas_errors(struct Scsi_Host *shost, struct list_head *
631624
case TASK_IS_DONE:
632625
SAS_DPRINTK("%s: task 0x%p is done\n", __func__,
633626
task);
634-
sas_eh_defer_cmd(cmd);
627+
sas_eh_finish_cmd(cmd);
635628
continue;
636629
case TASK_IS_ABORTED:
637630
SAS_DPRINTK("%s: task 0x%p is aborted\n",
638631
__func__, task);
639-
sas_eh_defer_cmd(cmd);
632+
sas_eh_finish_cmd(cmd);
640633
continue;
641634
case TASK_IS_AT_LU:
642635
SAS_DPRINTK("task 0x%p is at LU: lu recover\n", task);
@@ -647,7 +640,7 @@ static void sas_eh_handle_sas_errors(struct Scsi_Host *shost, struct list_head *
647640
"recovered\n",
648641
SAS_ADDR(task->dev),
649642
cmd->device->lun);
650-
sas_eh_defer_cmd(cmd);
643+
sas_eh_finish_cmd(cmd);
651644
sas_scsi_clear_queue_lu(work_q, cmd);
652645
goto Again;
653646
}

drivers/scsi/qla2xxx/qla_init.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1719,7 +1719,6 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea)
17191719

17201720
set_bit(ea->fcport->loop_id, vha->hw->loop_id_map);
17211721
spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags);
1722-
ea->fcport->loop_id = FC_NO_LOOP_ID;
17231722
ea->fcport->chip_reset = vha->hw->base_qpair->chip_reset;
17241723
ea->fcport->logout_on_delete = 1;
17251724
ea->fcport->send_els_logo = 0;

0 commit comments

Comments
 (0)