DragonFly BSD
DragonFly commits List (threaded) for 2006-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/sys/amd64/amd64 genassym.c src/sys/bus/cam cam_periph.c src/sys/bus/cam/scsi scsi_cd.c scsi_da.c scsi_pt.c scsi_sa.c src/sys/bus/firewire fwmem.c src/sys/bus/isa isavar.h src/sys/bus/isa/i386 isa_device.h isa_dma.c isa_dma.h ...


From: YONETANI Tomokazu <qhwt+dfly@xxxxxxxxxx>
Date: Wed, 3 May 2006 14:01:42 +0900

On Sun, Apr 30, 2006 at 10:22:18AM -0700, Matthew Dillon wrote:
>   Log:
>   Replace the the buffer cache's B_READ, B_WRITE, B_FORMAT, and B_FREEBUF
>   b_flags with a separate b_cmd field.  Use b_cmd to test for I/O completion
>   as well (getting rid of B_DONE in the process).  This further simplifies
>   the setup required to issue a buffer cache I/O.

> http://www.dragonflybsd.org/cvsweb/src/sys/dev/disk/ata/ata-raid.c.diff?r1=1.18&r2=1.19&f=u

Not sure if this is a bug, but before this commit(or at least until 15th of
April), the boot message looked like this on my laptop (which doesn't have
RAID controller):
			:
  ad0: success setting UDMA4 on Acer chip
  ar: FreeBSD check1 failed
			:

now it looks slightly diffrent and, there's about 15 seconds delay before
the second line:
			:
  ad0: success setting UDMA4 on Acer chip
  ar: FreeBSD read conf failed
			:

I found where these diagnostic messages come from, so I added printf's
in ar_rw() to see what's happening:

    if (flags & AR_WAIT)
	bp->bio1.bio_done = (void *)wakeup;
    else
			:

    if (flags & AR_WAIT) {
	while ((retry++ < (15*hz/10)) &&
	    (error = !(bp->b_cmd == BUF_CMD_DONE))) {
	    error = tsleep(&bp->b_bio1, 0, "arrw", 10);
	    printf("arrw: bp->b_cmd=0x%x, error=%d\n", bp->b_cmd, error);
	}
	printf("arrw: error=%d, bp->b_error=%d\n", error, bp->b_error);
	if (!error && (bp->b_flags & B_ERROR))
	    error = bp->b_error;
	free(bp, M_AR);
    }
    return error;

and this showed the following messages on the console:
  ad0: success setting UDMA4 on Acer chip
  arrw: bp->b_cmd=0x1, error=0		<-- tsleep() returned successfully
  arrw: bp->b_cmd=0x1, error=35		<-- tsleep() timed out
	[repeats]
  arrw: bp->b_cmd=0x1, error=35
  arrw: error=35, bp->b_error=0
  ar: FreeBSD read conf failed

This appears to me that the pre-bufcmd01.patch code would set B_DONE
somewhare around biodone() (well, I can't find where bp->bio1.bio_done
is called, so I may be wrong), so the while() loop in above code
terminated after the first call to tsleep() returned.  But in the new code,
b_cmd remains BUF_CMD_READ until the retry expires.  I imagined adding back

  bp->b_cmd = BUF_CMD_DONE;

just above the call to runningbufwakeup(bp) (in biodone(), and again,
I may be wrong) would fix this issue, but that doesn't explain why
my laptop works without other problems :)

Cheers.



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]