kern/75603: 5.3 kernel crash
Phil Oleson
oz at nixil.net
Tue Apr 5 17:50:08 PDT 2005
The following reply was made to PR kern/75603; it has been noted by GNATS.
From: Phil Oleson <oz at nixil.net>
To: DJ Gregor <dgregor at interhack.com>
Cc: freebsd-gnats-submit at FreeBSD.org
Subject: Re: kern/75603: 5.3 kernel crash
Date: Tue, 05 Apr 2005 18:40:20 -0600
I did try to debug this some, though I got distracted by work related
tasks. In my opinion,
scsi_calc_syncsrate() has a div by 0 possibility, where the old ifdef'd
code explicitly avoided
this prossibility. something about this code in bt.c which sets
sync_period. The 4.x tree
called scsi_calc_syncparam() which is safer in this regard, but it's
ifdef'd out of the 5.x+ tree.
and I dont think it's doing the right thing. But this is as far as I got.
Phil.
bt.c:
<snip>
#ifdef CAM_NEW_TRAN_CODE
cts->protocol = PROTO_SCSI;
cts->protocol_version = SCSI_REV_2;
cts->transport = XPORT_SPI;
cts->transport_version = 2;
spi->sync_period = sync_period;
spi->valid |= CTS_SPI_VALID_SYNC_RATE;
spi->sync_offset = sync_offset;
spi->valid |= CTS_SPI_VALID_SYNC_OFFSET;
spi->valid |= CTS_SPI_VALID_BUS_WIDTH;
spi->bus_width = bus_width;
if (cts->ccb_h.target_lun != CAM_LUN_WILDCARD) {
scsi->valid = CTS_SCSI_VALID_TQ;
spi->valid |= CTS_SPI_VALID_DISC;
} else
scsi->valid = 0;
#else
/* Convert ns value to standard SCSI sync rate */
if (cts->sync_offset != 0)
cts->sync_period = scsi_calc_syncparam(sync_period);
else
cts->sync_period = 0;
cts->sync_offset = sync_offset;
cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
cts->valid = CCB_TRANS_SYNC_RATE_VALID
| CCB_TRANS_SYNC_OFFSET_VALID
| CCB_TRANS_BUS_WIDTH_VALID;
#endif
</snip>
More information about the freebsd-scsi
mailing list