Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Jun 1998 21:58:34 -0600 (MDT)
From:      "Kenneth D. Merry" <ken@plutotech.com>
To:        schwarz@cx25450-a.dt1.sdca.home.com (Steven Schwarz)
Cc:        freebsd-scsi@FreeBSD.ORG
Subject:   Re: 980513 CAM, /dev/(r)fd0, vnode pseudo-device
Message-ID:  <199806270358.VAA24473@panzer.plutotech.com>
In-Reply-To: <XFMail.980626091117.schwarz@cx25450-a.dt1.sdca.home.com> from Steven Schwarz at "Jun 26, 98 08:43:13 am"

next in thread | previous in thread | raw e-mail | index | archive | help

--ELM898919914-24390-0_
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Steven Schwarz wrote...
> I haven't reported in on my CAM experiences for awhile, but I just
> integrated the 980513 snapshot onto my machine and wanted to report
> on that.

[ ... ]

> [The patch applies to
> 
>                    /usr/src/sys/dev/ppbus/vpo.[ch]
> 
> and should be applied localy in
> 
>                        /usr/src/sys/dev/ppbus.
> 
> It would be real nice if the future CAM snapshots could preserve the
> ppbus stuff in working order, especially, as it would seem to require
> very little incremental effort to do so.]

	I'll try to take a look at it.  I guess it wouldn't hurt anything
to just apply it and leave it in the tree.  We don't have any parallel port
zip drives to test it with, though.

> Two things of note to report:
> 
> [1] This message
> 
>           devstat_end_transaction: HELP!! busy_count is < 0!
> 
> is spammed to syslog whenever any attempt is made to use the floppy
> device /dev/(r)fd0 (mounting, reading, writing).  (Operations do seem
> to succeed, you just get the space-filling message.)  Is this related
> to CAM?  

	This is sort-of related to CAM.  There is a new statistics tracking
system called "devstat" that replaces the old dkstat code.  The devstat
code in the floppy driver is broken -- I fixed it after the last snapshot.
I have attached a patch, hopefully it'll apply cleanly.  In any case, it
will be fixed in the next snapshot.

	The message is harmless -- basically it indicates that there were
more devstat_end_transaction() calls than devstat_start_transaction()
calls.  There should be a one to one correspondence between the two; the
busy count should be zero when there are no outstanding transactions.

> [2] In the process of using this machine to make a picoBSD kernel
> (for, needless to say, another box to run :->), I noticed that if I
> place the sources and do this build on my IBM hard drive, the scsi bus
> resets during the build at the point where the build wants to use the
> vnode pseudo-device ("treat any file like a disk") during the
> manufacture of the bootable floppy.  If I move the sources to my IDE
> drive, the whole thing works just fine.  Again, does vnode need work
> to play with CAM?

	Hmm, I believe there were some bugfixes to the Adaptec driver
between the May 13th and May 20th snapshot that had to do with IBM drives.
You may be running into one of those problems.  I think that the folks who
were having problems actually got a panic, though, not a bus reset.


Ken
-- 
Kenneth Merry
ken@plutotech.com

--ELM898919914-24390-0_
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: attachment; filename=fd.devstat.diffs
Content-Description: fd.devstat.diffs
Content-Transfer-Encoding: 7bit

*** src/sys/i386/isa/fd.c.orig
--- src/sys/i386/isa/fd.c
***************
*** 1284,1289 ****
--- 1284,1293 ----
  	s = splbio();
  	bufqdisksort(&fdc->head, bp);
  	untimeout(fd_turnoff, (caddr_t)fdu, fd->toffhandle); /* a good idea */
+ 
+ 	/* Tell devstat we are starting on the transaction */
+ 	devstat_start_transaction(&fd->device_stats);
+ 
  	fdstart(fdcu);
  	splx(s);
  	return;
***************
*** 1766,1772 ****
  			devstat_end_transaction(&fd->device_stats,
  						bp->b_bcount - bp->b_resid,
  						DEVSTAT_TAG_NONE,
! 						(bp->b_flags & B_READ) ? DEVSTAT_READ : DEVSTAT_WRITE);
  			biodone(bp);
  			fdc->fd = (fd_p) 0;
  			fdc->fdu = -1;
--- 1770,1777 ----
  			devstat_end_transaction(&fd->device_stats,
  						bp->b_bcount - bp->b_resid,
  						DEVSTAT_TAG_NONE,
! 						(bp->b_flags & B_READ) ?
! 						DEVSTAT_READ : DEVSTAT_WRITE);
  			biodone(bp);
  			fdc->fd = (fd_p) 0;
  			fdc->fdu = -1;
***************
*** 1876,1885 ****
  	struct subdev *sd;
  	fdc_p fdc = fdc_data + fdcu;
  	register struct buf *bp;
- #ifdef	SLICE
  	struct fd_data *fd;
  	int fdu;
- #endif
  
  	bp = bufq_first(&fdc->head);
  
--- 1881,1888 ----
***************
*** 1890,1896 ****
  	if(fd->options & FDOPT_NORETRY)
  		goto fail;
  #else
! 	if(fd_data[FDUNIT(minor(bp->b_dev))].options & FDOPT_NORETRY)
  		goto fail;
  #endif
  	switch(fdc->retry)
--- 1893,1902 ----
  	if(fd->options & FDOPT_NORETRY)
  		goto fail;
  #else
! 	fdu = FDUNIT(minor(bp->b_dev));
! 	fd = fd_data + fdu;
! 
! 	if(fd_data[fdu].options & FDOPT_NORETRY)
  		goto fail;
  #endif
  	switch(fdc->retry)
***************
*** 1939,1944 ****
--- 1945,1957 ----
  		bp->b_error = EIO;
  		bp->b_resid += bp->b_bcount - fdc->fd->skip;
  		bufq_remove(&fdc->head, bp);
+ 	
+ 		/* Tell devstat we have finished with the transaction */
+ 		devstat_end_transaction(&fd->device_stats,
+ 					bp->b_bcount - bp->b_resid,
+ 					DEVSTAT_TAG_NONE,
+ 					(bp->b_flags & B_READ) ? DEVSTAT_READ :
+ 								 DEVSTAT_WRITE);
  		fdc->fd->skip = 0;
  		biodone(bp);
  		fdc->state = FINDWORK;

--ELM898919914-24390-0_--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message



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