From: Finn Thain Date: Wed, 23 Mar 2016 10:10:32 +0000 (+1100) Subject: ncr5380: Call complete_cmd() for disconnected commands on bus reset X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=216fad91387aab7c9e69fe0854d843f012968748;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ncr5380: Call complete_cmd() for disconnected commands on bus reset I'm told that some targets are liable to disconnect a REQUEST SENSE command. Theoretically this would cause a command undergoing autosense to be moved onto the disconnected list. The bus reset handler must call complete_cmd() for these commands, otherwise the hostdata->sensing pointer will not get cleared. That would cause autosense processing to stall and a timeout or an incorrect scsi_eh_restore_cmnd() would eventually follow. Signed-off-by: Finn Thain Reported-by: Michael Schmitz Tested-by: Ondrej Zary Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index 52e7d2b57902..43908bbb3b23 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c @@ -2437,7 +2437,7 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd) struct scsi_cmnd *cmd = NCR5380_to_scmd(ncmd); set_host_byte(cmd, DID_RESET); - cmd->scsi_done(cmd); + complete_cmd(instance, cmd); } INIT_LIST_HEAD(&hostdata->disconnected);