Subject: Re: CVS commit: src/sys/dev/scsipi
To: Bill Studenmund <>
From: Manuel Bouyer <>
List: tech-kern
Date: 05/03/2004 20:20:06
On Sat, May 01, 2004 at 10:04:16PM -0700, Bill Studenmund wrote:
> > Log Message:
> > Revert part of 1.102:
> > Don't decrease/check xs_retries when the device report "Power On, Reset, or
> > Bus Device Reset" sense condition, just retry the command. The initial bus
> > reset would cause the first TEST_UNIT_READY to report this condition,
> > and as xs_retries is set to 0 when XS_CTL_DISCOVERY is set, it would report an
> > error instead of being retried, causing the disk probe to report "drive
> > offline" instead of the geometry and capacity. Checking/decreasing
> > xs_retries on the bus reset reported by the adapter is enouth to avoid the
> > problem reported by rev 1.102.
> > 
> > Problem analysed by Paul Kranenburg, fix confirmed by Anders Hjalmars,
> > and explaination as to why the INQUIRY wasn't affected by this provided by
> > Bill Studenmund.
> I think we need to do more with this code. I think we should change the 
> test to do the same thing for all ascq <= 0x07, not just == 0x00. The 
> prefered behavior on reset now is to return either 0x29/0x01 (device 
> reset) or 0x29/0x07 (I_T Nexus Loss) for the first command. The difference 
> is if you know you lost the I_T Nexus, you do 0x29/0x07, otherwise you do 
> 0x29/0x01.

I had the same though when I looked at this code, but as I've yet to see
a disk behaving this way, I didn't to the change yet, to not bloat the
pullup request.

Also I'm not sure what to do with 0x29/0x04 (Internal Device Reset).
I have the feeling this one should be logged, but it's not clear what this
is really for.

Manuel Bouyer <>
     NetBSD: 26 ans d'experience feront toujours la difference