Subject: Re: Alas...
To: None <thorpej@nas.nasa.gov>
From: Paul Boven <e.p.boven@student.utwente.nl>
List: port-sparc
Date: 05/29/1996 11:51:09
Hi everyone,

Jason wrote:

> Interesting ... After a peek at the SunOS header file:
> 
> 	/usr/include/scsi/adapters/espreg.h
> 
> ...it looks like we treat the "TC" bit differently ... SunOS calls it:
> 
> #define ESP_STAT_XZERO  0x10    /* transfer counter zero */
> 
> ...where we call it:
> 
> #define  ESPSTAT_TC     0x10            /*      Terminal Count          */
> 
> I would guess from the SunOS name for the bit that they treat the 
> presence of that bit as "zero bytes transfered".  From looking at our 
> handling of this in dma.c (line 450), I'm not entirely certain that 
> setting resid to 64k is a wise idea ... it _seems_ like it should be set 
> to sc->sc_dmasize (the size of the request).

Well, I tried this, because I had some doubts at this part of the code too,
though I assumed it had to do with some 64k carry-condition on the dma-size
perhaps. Anyway, it does "cure" the dma0-message, but if the fix is ok I
don't know, because after this, I still get the esp0-errors....

What exactly is the "resid" for? Is that the residue, the amount that still
has to be transferred perhaps? That's what I read in it, anyway...
 
> Note that the chunk of code in espdmaintr() looks like this:
> 
>         if (resid == 0 && (sc->sc_esp->sc_rev <= ESP100A) &&
>             (sc->sc_esp->sc_espstat & ESPSTAT_TC) == 0)
>                 resid = 65536;
> 
>         trans = sc->sc_dmasize - resid;
>         if (trans < 0) {                        /* transferred < 0 ? */
>                 printf("%s: xfer (%d) > req (%d)\n",
>                     sc->sc_dev.dv_xname, trans, sc->sc_dmasize);
>                 trans = sc->sc_dmasize;
>         }
> 
> Now, if it is indeed an indication that nothing was actually transfered, 
> then that chunk of code "feels wrong"...

Yes, with that meaning for bit 0x10, it does even more. But that's not the
only problem, alas. Setting resid to sc->sc_dmasize makes only the message
about dma0: xfer (-x) > (x) go away, not the other messages.

>  > sd0 at scsibus0 targ 3 lun 0: <QUANTUM, TRB850S, 0404> SCSI2 0/direct fixed
>  > sd0: dma0: xfer (-65528) > req (8)
>  > esp0: !TC [intr 10, stat 83, step 4] prevphase 1, resid 8
>  > 810MB 3653 cyl, 4 head 113, sec, 512 bytes/sec
>  > dma0: xfer (-65492) > req (44)
>  > esp0: !TC [intr 10, stat 83, step 4] prevphase 1, resid 2c
>  > dma0: xfer (-65492) > req (44)
>  > esp0: !TC [intr 10, stat 83, step 4] prevphase 1, resid 2c

Hmm, there is a small difference betweek Kirstens (above) and my error-
messages: With his ELC, at least the name of the SCSI-device is found,
I never even get that on my console. (<QUANTUM, TRB850S, etc.)

Help...
-- 
----------------------------------------------------------------------
Paul Boven, <e.p.boven@student.utwente.nl>  PE1NUT  QRV 145.575 JO32KF
 "And  she  looked  like  she  had  sex,  with  a  tyranosaurus  rex"
Cannibal surf babe     --     Afraid of sunlight     --     Marillion
----------------------------------------------------------------------