Fix possibly endless loop (mycroft) and add fix requested by Allen Briggs.
This commit is contained in:
parent
9460f18c9e
commit
7640742d5b
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ncr5380.c,v 1.6 1995/08/19 12:36:26 leo Exp $ */
|
||||
/* $NetBSD: ncr5380.c,v 1.7 1995/09/05 07:02:21 leo Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Leo Weppelman.
|
||||
|
@ -956,7 +956,8 @@ information_transfer()
|
|||
PID("info_transf3");
|
||||
len = reqp->xdata_len;
|
||||
#ifdef USE_PDMA
|
||||
transfer_pdma(&phase, reqp->xdata_ptr, &len);
|
||||
if (transfer_pdma(&phase, reqp->xdata_ptr, &len) == 0)
|
||||
return (0);
|
||||
#else
|
||||
transfer_pio(&phase, reqp->xdata_ptr, &len);
|
||||
#endif
|
||||
|
@ -1123,12 +1124,22 @@ struct ncr_softc *sc;
|
|||
* SEL is true and BSY was false for at least one bus settle
|
||||
* delay (400 ns.).
|
||||
* We must assert BSY ourselves, until the target drops the SEL signal.
|
||||
* This should happen within 2 deskew delays (2 * 45ns.)
|
||||
* This should happen within 2 deskew delays (2 * 45ns.) We wait too
|
||||
* long for this, but it's better to wait for slow targets than to
|
||||
* reset the bus too early...
|
||||
*/
|
||||
SET_5380_REG(NCR5380_ICOM, SC_A_BSY);
|
||||
while (GET_5380_REG(NCR5380_IDSTAT) & SC_S_SEL)
|
||||
;
|
||||
|
||||
len = 2;
|
||||
while ((GET_5380_REG(NCR5380_IDSTAT) & SC_S_SEL) && (len > 0)) {
|
||||
delay(1);
|
||||
len--;
|
||||
}
|
||||
if (GET_5380_REG(NCR5380_IDSTAT) & SC_S_SEL) {
|
||||
/* Damn SEL isn't dropping */
|
||||
scsi_reset(sc);
|
||||
return;
|
||||
}
|
||||
|
||||
SET_5380_REG(NCR5380_ICOM, 0);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue