Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Aug 1996 22:23:15 +0200 (MET DST)
From:      Stefan Esser <se@zpr.uni-koeln.de>
To:        "Craig Shaver" <craig@progroup.com>
Cc:        se@zpr.uni-koeln.de (Stefan Esser), scsi@FreeBSD.org
Subject:   Re: NCR0+IBM DORS-32160 WA0A 2 gigs HD - assertion "cp" failed
Message-ID:  <199608302023.WAA07150@x14.mi.uni-koeln.de>
In-Reply-To: <199608301653.JAA03796@seabass.progroup.com>
References:  <199608301544.RAA02753@x14.mi.uni-koeln.de> <199608301653.JAA03796@seabass.progroup.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Craig Shaver writes:
 > > 
 > > 
 > > Brian Wang writes:
 > >  > Hi,
 > >  > 
 > >  > 	I have just put a new mail/dns server online, which has the
 > >  > following configuration: 
 > >  > 
 > >  > FreeBSD 2.1.5 Release
 > 2.1.0R
 > >  > P75 CPU + ASUSTPN4 MB (Triton I with 256k pipeline cache)
 > p133 + 512K
 > >  > 32 megs non-edo RAM
 > edo
 > >  > 3COM 509 ethernet card
 > >  > Trident PCI video card
 > >  > ASUS SC200 SCSI card (ncr)
 > I use this board as the first controller and use a tyan 825 board as
 > a second controller with a 
 > >  > IBM DORS-32160 2 gigs HD
 > single atlas xp34300wide drive on it.  That is where I am getting this same
 > error!
 >
 > I get the same problem with the tyan 825 and an atlas xp34300wide 4.3g drive.

Hmmm, an Atlas ???

I've tried with any number of tags (upto 32) and heavy load
from many processes accessing the disk at a time, and never
had a single such error (using a 2GB Atlas).

 > exact same message, big chunks of them, and most of the time the filesystem
 > on that disk gets io errors -- it is used for news mostly.  And then I have to
 > reboot to get the filesystem back.

The error recovery code has improved a lot after 2.1R. Try 
to upgrade to 2.1.5R and see whether that makes a difference.

 > > Please try with Tagged Command Queueing disabled:
 > > 
 > > # ncrcontrol -s tags=0
 > 
 > did that and other things, not sure, but looks like tags=0 helped.

Well, the message says the drive can't handle as many tags 
as the driver tries to use. But the default is 4, and that 
is by no means a large number of tags. 32 should work with
just about every current drive, though I did not actually 
test this with too many different brands ...

 > I'm getting a tekram 875 and a seagate uw drive and will be building
 > up a new system.  I will use 2.1.5R and the driver from the tekram site
 > that supports the tekram 390F.  They have patch kits there too.  Are you
 > going to use any of their stuff?  Are you going for just generic support
 > of the 875?  Is there any differences with the various 875 implementations
 > that might allow for optimizations?

The 875 allows for many optimizations, and I plan to have the
driver take advantage of them. But it is a HUGE effort to do 
it right. (And since I don't get paid for it, it would be a 
total waste of time if I did NOT try to do it right ;-)

I have received test results from somebody who did FreeBSD tests
for Tekram, and who tested my new code which calculates the pre-
scaler parameters for the Ultra-SCSI chips.

I asked him to post the results, since I consider them very 
interesting, but he did not do so, and I won't unless I get his
permission, since he sent them in private mail.

The Tekram driver comes out significantly slower than either 
the FreeBSD NCR driver, or an AH2940UW, which give quite similar
results. The NCR driver can easily be configured to use more or 
less tags at run-time, and the results with 4, 8 and 16 tags 
clearly show that 8 tags gives the optimum performance. (The 
default of 4 tags does make the driver consume less memory, 
since each tag (== outstanding command) needs some storage to 
keep the commands parameters.

Anyway, if you got the Tekram driver, just do some Bonnie tests
(or whatever your benchmark of choice is) and post the results.

 > Just curious, I was hoping the problems I was having would be cured in
 > 2.1.5R, but it looks like someone else is having the same problem there
 > too.

Those problems are caused by the drive not supproting as many tags 
as the driver assumed. Their is code to reduce the number of tags
whenever this situation occurs, but I never managed to trigger it
(well, I might just try with 256 tags, my Atlas must have some limit :)

Justin Gibbs is working on a major refurbishing of the generic SCSI
layer, and he is moving most of the tag support code there. This will
make it much easier to deal with the situation you are suffereing
from.

But under 2.1.5, there should be no disruption of service, as you 
suffer from under 2.1R, because of driver improvements. So just
give it a try ...

Regards, STefan

PS: If you are going to use the 53c875 under 2.1.5R, you'll need the
    following patch to /sys/pci/ncr.c to correctly set the clock 
    pre-scaler register:

Index: ncr.c
===================================================================
RCS file: /usr/cvs/src/sys/pci/ncr.c,v
retrieving revision 1.37.4.8
diff -C2 -r1.37.4.8 ncr.c
*** ncr.c	1996/04/01 00:25:28	1.37.4.8
--- ncr.c	1996/08/30 20:21:14
***************
*** 1195,1199 ****
  static	void	ncr_exception	(ncb_p np);
  static	void	ncr_free_ccb	(ncb_p np, ccb_p cp, int flags);
! static	void	ncr_getclock	(ncb_p np);
  static	ccb_p	ncr_get_ccb	(ncb_p np, u_long flags, u_long t,u_long l);
  static  u_int32_t ncr_info	(int unit);
--- 1195,1199 ----
  static	void	ncr_exception	(ncb_p np);
  static	void	ncr_free_ccb	(ncb_p np, ccb_p cp, int flags);
! static	void	ncr_getclock	(ncb_p np, u_char scntl3);
  static	ccb_p	ncr_get_ccb	(ncb_p np, u_long flags, u_long t,u_long l);
  static  u_int32_t ncr_info	(int unit);
***************
*** 3350,3354 ****
  	*/
  
! 	ncr_getclock (np);
  
  	/*
--- 3350,3354 ----
  	*/
  
! 	ncr_getclock (np, INB(nc_scntl3));
  
  	/*
***************
*** 6779,6785 ****
  
  
! static void ncr_getclock (ncb_p np)
  {
! 	u_char	tbl[5] = {6,2,3,4,6};
  	u_char	f;
  	u_char	ns_clock = (1000/NCR_CLOCK);
--- 6779,6785 ----
  
  
! static void ncr_getclock (ncb_p np, u_char scntl3)
  {
! 	u_char	tbl[6] = {6,2,3,4,6,8};
  	u_char	f;
  	u_char	ns_clock = (1000/NCR_CLOCK);
***************
*** 6788,6792 ****
  	**	Compute the best value for scntl3.
  	*/
! 
  	f = (2 * MIN_SYNC_PD - 1) / ns_clock;
  	if (!f ) f=1;
--- 6788,6792 ----
  	**	Compute the best value for scntl3.
  	*/
! /*
  	f = (2 * MIN_SYNC_PD - 1) / ns_clock;
  	if (!f ) f=1;
***************
*** 6803,6806 ****
--- 6803,6824 ----
  		printf ("%s: sclk=%d async=%d sync=%d (ns) scntl3=0x%x\n",
  		ncr_name (np), ns_clock, np->ns_async, np->ns_sync, np->rv_scntl3);
+ */
+ 
+ 	/*
+ 	 *	For now just preserve the BIOS setting ...
+ 	 */
+ 
+ 	if ((scntl3 & 7) == 0) {
+ 		scntl3 = 3; /* assume 40MHz if no value supplied by BIOS */
+ 	}
+ 
+ 	np->ns_sync   = 25;
+ 	np->ns_async  = 50;
+ 	np->rv_scntl3 = ((scntl3 & 0x7) << 4) -0x20 + (scntl3 & 0x7);
+ 
+ 	if (bootverbose) {
+ 		printf ("\tinitial value of SCNTL3 = %02x, final = %02x\n",
+ 			scntl3, np->rv_scntl3);
+ 	}
  }
  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199608302023.WAA07150>