From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754314AbcCWKR7 (ORCPT ); Wed, 23 Mar 2016 06:17:59 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:43693 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754812AbcCWKPY (ORCPT ); Wed, 23 Mar 2016 06:15:24 -0400 Message-Id: <20160323101015.181778613@telegraphics.com.au> User-Agent: quilt/0.50-1 Date: Wed, 23 Mar 2016 21:10:32 +1100 From: Finn Thain To: "James E.J. Bottomley" , "Martin K. Petersen" , Michael Schmitz , , , Cc: Ondrej Zary , Sam Creasey Subject: [PATCH v4 23/23] ncr5380: Call complete_cmd() for disconnected commands on bus reset References: <20160323101009.341929635@telegraphics.com.au> Content-Disposition: inline; filename=ncr5380-disconnected-autosense-fix Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/scsi/NCR5380.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux/drivers/scsi/NCR5380.c =================================================================== --- linux.orig/drivers/scsi/NCR5380.c 2016-03-23 21:10:00.000000000 +1100 +++ linux/drivers/scsi/NCR5380.c 2016-03-23 21:10:07.000000000 +1100 @@ -2437,7 +2437,7 @@ static int NCR5380_bus_reset(struct scsi 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);