Subject: RE: Help w/strange SCSI error
To: Douglas R. MacKintosh <doug@doug.net>
From: Graham, James <James.Graham@Schwab.COM>
List: netbsd-users
Date: 05/15/1997 14:53:49
Doug,

You need to build a new kernel with disconnect/reselect disabled
in the upper devices.

The bits are laid out as follows in the esp flags (that part that
says "esp0 at <wherever> flags 0xff0f"):
	Bits for disabling sync negotiation
	f e d c b a 9 8
Target:	7 6 5 4 3 2 1 0
	* * * * * * * *	<- By default these bits are set
	8+4+2+1#8+4+2+1	0xff00....
	Bits for disabling disconnect/reselect
	7 6 5 4 3 2 1 0
Target:	7 6 5 4 3 2 1 0
	        * * * *	<- By default these bits are set
	0+0+0+0#8+4+2+1	[AND 0xf]

As you see, by default, targets 0 thru 7 have sync negotiation disabled
by default, and targets 0 thru 3 have disconnect/reselect disabled
by default.

If this disk is target 4, for example, you will need to disable
disconnect/
reselect on target 4 by setting bit 4 (0x0010) in the flags, producing
a value of 0xff1f.
Target 5 would require 0x0020 to be ORed with 0xff0f, giving 0xff2f
Target 6 would require 0x0040 to be ORed, giving 0xff4f.
Target 7 would require 0x0080 to be ORed if it weren't for
the fact that Target 7 is the SCSI host adapter itself and probably
doesn't need to have the bit set.

If you attach any more disks, you will need to go back and tweak the
appropriate bit.

If this was a bit too low of a reading level for you (i.e. it comes
across
as condescending), I apologise, but I know how frustrating it was for
me to try and get NetBSD to even run on a SLC or SS1 (until someone
said "check the flags on esp0 in the kernel"), so while the possibility
may be obvious, bit-masking and twiddling doesn't quite click
with a few people.  Better to over-explain than to under-explain
and make the person ask for a more complete answer later on.

Happy hacking!

				--*greywolf;


> ----------
> From: 	David Brownlee[SMTP:abs@anim.dreamworks.com]
> Sent: 	Thursday, May 15, 1997 2:17 PM
> To: 	Douglas R. MacKintosh
> Cc: 	netbsd-users@NetBSD.ORG
> Subject: 	Re: Help w/strange SCSI error
> 
> On Wed, 14 May 1997, Douglas R. MacKintosh wrote:
> 
> > Greetings all,
> > 
> > I posted this to netbsd-help and didn't get any replies so I will
> > try netbsd-users.
> 	
> 	Probably the best place to email messages like this is
> port-sparc,
> 	as its likely to be sparc specific.
> > 
> > I have a Sun SPARCstation SLC running NetBSD 1.2. All is well.
> > 
> > I added a fifth disk to the SCSI chain the other day and now get the
> > following squawkage when reading or writing heavily with the disk:
> > 
> > May 12 17:57:56 sputnik /netbsd: esp0: RESELECT: 7 bytes in FIFO!
> > 
> > Of the 5 drives on the machine only the one gives this error. This 
> > drive is an older Quantum LPS240S but two of the other drives are
> > also older Quantums (LPS540S and LPS120S). 
> > 
> > The drive in question has been in steady service since new in other
> > machines and has never burped even once so I am fairly confident
> > that the drive is OK.
> > 
> > Everything seems fine after the error so I assume the SCSI code 
> > does The Right Thing and recovers properly. The file system
> > fsck's OK after erroring during a write.
> > 
> > My questions are:
> > 
> > 1) What exactly does this error mean?
> > 2) What are the possible causes of the error?
> > 
> 	I'm no SCSI expert, but you mightr want to try booting with a
> 	1.2.1 kernel, or even a kernel from the latest snapshot
> 	(ftp.netbsd.org/pub/NetBSD/arch/sparc/...).
> 
> 	Bear in mind using a 1.2 userland with a snapshot kernel is
> 	likely to cause ps & friends to break, but it should be fine for
> 	test8ing if the problem has been fixed.
> 
> 	If these fix the scsi errors then you might want to upgrade to
> 	1.2.1, or the snaphot.
> 
> 	Alternatively if you have a specific kernel config feel free to
> 	mail it to me & I'll build a kernel from the latest -current
> 	source.
> 
>                 David/abs               abs@anim.dreamworks.com
> 
> .---- I've been too drunk to love ----.-- I've been too drunk to
> remember -.
> |          too drunk to care          |    the hell of the night
> before    |
> |  looked like death, felt like hell  |   I've been drinking myself
> blind  |
> `------ been the worse for wear ------'-- and still I'll drink some
> more --'
> 		
> 
> 
>