Port-atari archive

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

Re: Booting /NetBSD-daily/netbsd-4/200807120002Z on my TT030



dross00%hotmail.com@localhost wrote:

> I managed to catch the ncrscsi bug that's been plaguing my setup.  Usually 
> when I find the machine it's in a state where these messages are just 
> scrolling by and I can't read them, but this time it landed in the kernel 
> debugger.  I think the crash was just an indirect result of the scsi bug and 
> not the ncrscsi driver itself crashing.
> 
> The messages all look like this (although with different hex digits):
> sd0(ncrscsi0:0:0:0):    Check Condition on CDB: 0x08 00 00 c2 10 00
>     SENSE KEY:    Illegal Request
>     ASC/ASCQ:    Invalid Command Operation Code
> 
> I didn't catch the very beginning of the messages -- I seem to remember 
> seeing this scroll by once and it was a different message.  (Maybe something 
> about the device holding the bus for too long?)  If there's a place where 
> these messages are logged I can go and check that out.

Hmm.

There are very few changes against atari's ncrscsi driver since 1.6 ages,
so we have to investigate which version was the lastest working one
including -current. (maybe some API mismach between MI and MD SCSI layer?)

Anyway, could you please try this one?
http://www.ceres.dti.ne.jp/~tsutsui/netbsd/netbsd-atari-BOOT-netbsd-3-20080721.gz
This is a netbsd-3 based kernel which includes some recent
fixes (mostly for newer gcc) in -current.
(atari5380.c rev 1.37, 1.41, 1.43, 1.44, 1.45)

If it works, I'll send pullup requests both netbsd-3 and netbsd-4 first
since maybe we have to go step by step..

---
Index: dev/atari5380.c
===================================================================
RCS file: /cvsroot/src/sys/arch/atari/dev/atari5380.c,v
retrieving revision 1.36
diff -u -r1.36 atari5380.c
--- dev/atari5380.c     15 Jul 2003 01:19:47 -0000      1.36
+++ dev/atari5380.c     21 Jul 2008 04:48:18 -0000
@@ -138,14 +138,14 @@
 
 #define        set_scsi_dma(addr, val) (void)(                                 
\
        {                                                               \
-       u_char  *address = (u_char*)addr+1;                             \
+       volatile u_char *address = (volatile u_char *)addr+1;           \
        u_long  nval     = (u_long)val;                                 \
        __asm("movepl   %0, %1@(0)": :"d" (nval), "a" (address));       \
        })
 
 #define        get_scsi_dma(addr, res) (                                       
\
        {                                                               \
-       u_char  *address = (u_char*)addr+1;                             \
+       volatile u_char *address = (volatile u_char *)addr+1;           \
        u_long  nval;                                                   \
        __asm("movepl   %1@(0), %0": "=d" (nval) : "a" (address));      \
        res = (u_long)nval;                                             \
@@ -342,8 +342,8 @@
                SCSI_DMA->s_dma_ctrl = SD_IN;
                if (machineid & ATARI_HADES)
                    SCSI_DMA->s_hdma_ctrl &= ~(SDH_BUSERR|SDH_EOP);
-               set_scsi_dma(&(SCSI_DMA->s_dma_ptr), reqp->dm_cur->dm_addr);
-               set_scsi_dma(&(SCSI_DMA->s_dma_cnt), reqp->dm_cur->dm_count);
+               set_scsi_dma(SCSI_DMA->s_dma_ptr, reqp->dm_cur->dm_addr);
+               set_scsi_dma(SCSI_DMA->s_dma_cnt, reqp->dm_cur->dm_count);
                SET_TT_REG(NCR5380_ICOM, 0);
                SET_TT_REG(NCR5380_MODE, mode);
                SCSI_DMA->s_dma_ctrl = SD_ENABLE;
@@ -353,8 +353,8 @@
                SCSI_DMA->s_dma_ctrl = SD_OUT;
                if (machineid & ATARI_HADES)
                    SCSI_DMA->s_hdma_ctrl &= ~(SDH_BUSERR|SDH_EOP);
-               set_scsi_dma(&(SCSI_DMA->s_dma_ptr), reqp->dm_cur->dm_addr);
-               set_scsi_dma(&(SCSI_DMA->s_dma_cnt), reqp->dm_cur->dm_count);
+               set_scsi_dma(SCSI_DMA->s_dma_ptr, reqp->dm_cur->dm_addr);
+               set_scsi_dma(SCSI_DMA->s_dma_cnt, reqp->dm_cur->dm_count);
                SET_TT_REG(NCR5380_MODE, mode);
                SET_TT_REG(NCR5380_ICOM, SC_ADTB);
                SET_TT_REG(NCR5380_DMSTAT, 0);
@@ -432,12 +432,13 @@
 {
        int     dmastat, dmstat;
        u_char  *byte_p;
-       u_long  leftover;
+       u_long  leftover, ptr;
 
        dmastat = SCSI_DMA->s_dma_ctrl;
        dmstat  = GET_TT_REG(NCR5380_DMSTAT);
        get_scsi_dma(SCSI_DMA->s_dma_cnt, leftover);
-       get_scsi_dma(SCSI_DMA->s_dma_ptr, (u_long)byte_p);
+       get_scsi_dma(SCSI_DMA->s_dma_ptr, ptr);
+       byte_p = (u_char *)ptr;
 
        if (dmastat & SD_BUSERR) {
                /*
@@ -471,10 +472,11 @@
         */
        if ((machineid & ATARI_TT) && ((u_long)byte_p & 3)
            && PH_IN(reqp->phase)) {
-               u_char  *p, *q;
+               u_char  *p;
+               volatile u_char *q;
 
                p = ptov(reqp, (u_long *)((u_long)byte_p & ~3));
-               q = (u_char*)&(SCSI_DMA->s_dma_res);
+               q = SCSI_DMA->s_dma_res;
                switch ((u_long)byte_p & 3) {
                        case 3: *p++ = *q++;
                        case 2: *p++ = *q++;
@@ -493,8 +495,8 @@
 extern int                     *nofault;
        label_t                 faultbuf;
        int                     write;
-       u_long                  count;
-       u_char                  *data_p = (u_char*)(stio_addr+0x741);
+       u_long                  count, t;
+       volatile u_char         *data_p = (volatile u_char *)(stio_addr+0x741);
 
        /*
         * Block SCSI interrupts while emulating DMA. They come
@@ -519,7 +521,8 @@
                /*
                 * Determine number of bytes transferred
                 */
-               get_scsi_dma(SCSI_DMA->s_dma_ptr, (u_long)ptr);
+               get_scsi_dma(SCSI_DMA->s_dma_ptr, tmp);
+               ptr = (u_char *)tmp;
                cnt = dma_ptr - ptr;
 
                if (cnt != 0) {
@@ -588,7 +591,8 @@
 #endif
 
        get_scsi_dma(SCSI_DMA->s_dma_cnt, count);
-       get_scsi_dma(SCSI_DMA->s_dma_ptr, (u_long)dma_ptr);
+       get_scsi_dma(SCSI_DMA->s_dma_ptr, t);
+       dma_ptr = (u_char *)t;
 
        /*
         * Keep pushing bytes until we're done or a bus-error
---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index