@@ -1244,8 +1244,6 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
1244
1244
* is in same phase.
1245
1245
*
1246
1246
* Also, *phase, *count, *data are modified in place.
1247
- *
1248
- * XXX Note : handling for bus free may be useful.
1249
1247
*/
1250
1248
1251
1249
/*
@@ -1277,8 +1275,8 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance,
1277
1275
* valid
1278
1276
*/
1279
1277
1280
- if (NCR5380_poll_politely (hostdata , STATUS_REG , SR_REQ , SR_REQ ,
1281
- HZ * can_sleep ) < 0 )
1278
+ if (NCR5380_poll_politely (hostdata , STATUS_REG , SR_REQ | SR_BSY ,
1279
+ SR_REQ | SR_BSY , HZ * can_sleep ) < 0 )
1282
1280
break ;
1283
1281
1284
1282
dsprintk (NDEBUG_HANDSHAKE , instance , "REQ asserted\n" );
@@ -1666,9 +1664,6 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance,
1666
1664
* Side effects : SCSI things happen, the disconnected queue will be
1667
1665
* modified if a command disconnects, *instance->connected will
1668
1666
* change.
1669
- *
1670
- * XXX Note : we need to watch for bus free or a reset condition here
1671
- * to recover from an unexpected bus free condition.
1672
1667
*/
1673
1668
1674
1669
static void NCR5380_information_transfer (struct Scsi_Host * instance )
@@ -2009,9 +2004,20 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
2009
2004
NCR5380_dprint (NDEBUG_ANY , instance );
2010
2005
} /* switch(phase) */
2011
2006
} else {
2007
+ int err ;
2008
+
2012
2009
spin_unlock_irq (& hostdata -> lock );
2013
- NCR5380_poll_politely (hostdata , STATUS_REG , SR_REQ , SR_REQ , HZ );
2010
+ err = NCR5380_poll_politely (hostdata , STATUS_REG ,
2011
+ SR_REQ , SR_REQ , HZ );
2014
2012
spin_lock_irq (& hostdata -> lock );
2013
+
2014
+ if (err < 0 && hostdata -> connected &&
2015
+ !(NCR5380_read (STATUS_REG ) & SR_BSY )) {
2016
+ scmd_printk (KERN_ERR , hostdata -> connected ,
2017
+ "BSY signal lost\n" );
2018
+ do_reset (instance );
2019
+ bus_reset_cleanup (instance );
2020
+ }
2015
2021
}
2016
2022
}
2017
2023
}
0 commit comments