diff options
author | non <non@FreeBSD.org> | 2001-09-02 07:18:29 +0000 |
---|---|---|
committer | non <non@FreeBSD.org> | 2001-09-02 07:18:29 +0000 |
commit | 673668265d30c69efc8be029a3d5f23c4968a7ec (patch) | |
tree | dddc0e69b48cc819771cba013af4beef231a3d77 /sys/dev/nsp | |
parent | bc9f0fd7e6feb5e8caf0743a247acb321d2d5fa2 (diff) | |
download | FreeBSD-src-673668265d30c69efc8be029a3d5f23c4968a7ec.zip FreeBSD-src-673668265d30c69efc8be029a3d5f23c4968a7ec.tar.gz |
Fix bus timeout bug which might happen when nsp do suspend I/O burst write.
A nsp chip does suspend I/O write by 512bytes burst write,
though the chip only has 48 bytes FIFO. The chip assert I/O WAIT
signal to PC-Card bus after the CPU writes more than 48 bytes to
the chip if the SCSI device does not respond immediately in supsend
I/O burst write. If the device does not respond for a while it might
cause PC-Card bus timeout.
The previous work around was to wait the request from SCSI device.
But there are some devices which request bytes for synchronous transfer
immediately. So current work aound is to fill 32bytes FIFO, wait for
FIFO empty and burst write 512-32 bytes for every 512 bytes block.
Submitted-by: Honda-san (the author of the driver)
Obtained-from: NetBSD/pc98
Diffstat (limited to 'sys/dev/nsp')
-rw-r--r-- | sys/dev/nsp/nsp.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/sys/dev/nsp/nsp.c b/sys/dev/nsp/nsp.c index a78dd34..61f4740 100644 --- a/sys/dev/nsp/nsp.c +++ b/sys/dev/nsp/nsp.c @@ -452,7 +452,7 @@ nsphw_start_selection(sc, cb) continue; } - SCSI_LOW_DELAY(1); + SCSI_LOW_DELAY(1); ph = nsp_cr_read_1(bst, bsh, NSPR_SCBUSMON); if ((ph & SCBUSMON_BSY) != 0) { @@ -1168,21 +1168,35 @@ WriteLoop: * is ready to recieve data without * heavy delays. */ - acount = nsp_fifo_count(sc); - rcount = nsp_request_count(sc); - if (rcount <= acount) + if ((slp->sl_scp.scp_datalen % suspendio) == 0) { + /* Step I: + * fill the nsp fifo, and waiting for + * the fifo empty. + */ nsp_write_fifo(sc, 0); -#ifdef NSP_STATICS - nsp_statics.device_busy ++; -#endif /* NSP_STATICS */ } else { - nsp_write_fifo(sc, suspendio); + /* Step II: + * check the request singals. + */ + acount = nsp_fifo_count(sc); + rcount = nsp_request_count(sc); + if (rcount <= acount) + { + nsp_write_fifo(sc, 0); +#ifdef NSP_STATICS + nsp_statics.device_busy ++; +#endif /* NSP_STATICS */ + } + else + { + nsp_write_fifo(sc, suspendio); #ifdef NSP_STATICS - nsp_statics.device_data_write ++; + nsp_statics.device_data_write ++; #endif /* NSP_STATICS */ + } } } else |