提交 98c6d8f8 编写于 作者: F Finn Thain 提交者: Greg Kroah-Hartman

scsi: NCR5380: Use DRIVER_SENSE to indicate valid sense data

[ Upstream commit 070356513963be6196142acff56acc8359069fa1 ]

When sense data is valid, call set_driver_byte(cmd, DRIVER_SENSE).  Otherwise
some callers of scsi_execute() will ignore sense data.  Don't set DID_ERROR or
DID_RESET just because sense data is missing.
Tested-by: NMichael Schmitz <schmitzmic@gmail.com>
Signed-off-by: NFinn Thain <fthain@telegraphics.com.au>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
上级 1a46e4d3
...@@ -513,11 +513,12 @@ static void complete_cmd(struct Scsi_Host *instance, ...@@ -513,11 +513,12 @@ static void complete_cmd(struct Scsi_Host *instance,
if (hostdata->sensing == cmd) { if (hostdata->sensing == cmd) {
/* Autosense processing ends here */ /* Autosense processing ends here */
if ((cmd->result & 0xff) != SAM_STAT_GOOD) { if (status_byte(cmd->result) != GOOD) {
scsi_eh_restore_cmnd(cmd, &hostdata->ses); scsi_eh_restore_cmnd(cmd, &hostdata->ses);
set_host_byte(cmd, DID_ERROR); } else {
} else
scsi_eh_restore_cmnd(cmd, &hostdata->ses); scsi_eh_restore_cmnd(cmd, &hostdata->ses);
set_driver_byte(cmd, DRIVER_SENSE);
}
hostdata->sensing = NULL; hostdata->sensing = NULL;
} }
...@@ -2265,7 +2266,6 @@ static int NCR5380_abort(struct scsi_cmnd *cmd) ...@@ -2265,7 +2266,6 @@ static int NCR5380_abort(struct scsi_cmnd *cmd)
if (list_del_cmd(&hostdata->autosense, cmd)) { if (list_del_cmd(&hostdata->autosense, cmd)) {
dsprintk(NDEBUG_ABORT, instance, dsprintk(NDEBUG_ABORT, instance,
"abort: removed %p from sense queue\n", cmd); "abort: removed %p from sense queue\n", cmd);
set_host_byte(cmd, DID_ERROR);
complete_cmd(instance, cmd); complete_cmd(instance, cmd);
} }
...@@ -2344,7 +2344,6 @@ static int NCR5380_host_reset(struct scsi_cmnd *cmd) ...@@ -2344,7 +2344,6 @@ static int NCR5380_host_reset(struct scsi_cmnd *cmd)
list_for_each_entry(ncmd, &hostdata->autosense, list) { list_for_each_entry(ncmd, &hostdata->autosense, list) {
struct scsi_cmnd *cmd = NCR5380_to_scmd(ncmd); struct scsi_cmnd *cmd = NCR5380_to_scmd(ncmd);
set_host_byte(cmd, DID_RESET);
cmd->scsi_done(cmd); cmd->scsi_done(cmd);
} }
INIT_LIST_HEAD(&hostdata->autosense); INIT_LIST_HEAD(&hostdata->autosense);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册