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
This commit is contained in:
Noriaki Mitsunaga 2001-09-02 07:18:29 +00:00
parent daee21d1b4
commit 9d92f16230

View File

@ -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 @@ nsp_pio_write(sc, suspendio)
* 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_data_write ++;
nsp_statics.device_busy ++;
#endif /* NSP_STATICS */
}
else
{
nsp_write_fifo(sc, suspendio);
#ifdef NSP_STATICS
nsp_statics.device_data_write ++;
#endif /* NSP_STATICS */
}
}
}
else