Skip to contentSkip to conversation

sgiwd93 multiple disk problem

DISCUSSION Florian Lohoff 2 participants 6 messages Apr 3, 2001 – Apr 9, 2001 1 message not in the archive MIPS

lore
Share & tools
lore
#0 lore raw

Hi,
i guess Ryan Murray has stumbled over the multiple disk problem on one of my machines again - I would like to fix that bug if i am able to.

My first suspicion was garbled DMA transfers which might happen if starting a new DMA transfer when thge last is still running. So i tried to add this to

drivers/scsi/sgiwd93.c:dma_setup

    105 
    106         if (hregs->ctrl & HPC3_SCTRL_ACTIVE)
    107                 BUG();
    108 

This doesnt seem to get triggered.

Does anyone have another idea what happens ?

Flo

Signature · 2 lines
Florian Lohoff                  [email protected]             +49-5201-669912
     Why is it called "common sense" when nobody seems to have any?
#1 lore raw
Quoted 3 lines · Florian Lohoff

Hi,
i guess Ryan Murray has stumbled over the multiple disk problem on one of my machines again - I would like to fix that bug if i am able to.

While staring at it - Duplicate cache-inv in driver init

scsi/sgiwd93.c +0 -1
@@ -329,7 +333,6 @@
 			hdata1 = (struct WD33C93_hostdata *)sgiwd93_host1->hostdata;
 			hdata1->no_sync = 0;
 			hdata1->dma_bounce_buffer = (uchar *) (KSEG1ADDR(buf));
-			dma_cache_wback_inv((unsigned long) buf, PAGE_SIZE);
 	
 			if (request_irq(SGI_WD93_1_IRQ, sgiwd93_intr, 0, "SGI WD93", (void *) sgiwd93_host1)) {
 				printk(KERN_WARNING "sgiwd93: Could not allocate irq %d (for host1).\n", SGI_WD93_1_IRQ);

Flo

Signature · 2 lines
Florian Lohoff                  [email protected]             +49-5201-669912
     Why is it called "common sense" when nobody seems to have any?
#2 lore raw
Quoted 4 lines · Florian Lohoff
Quoted 3 lines · Florian Lohoff

Hi,
i guess Ryan Murray has stumbled over the multiple disk problem on one of my machines again - I would like to fix that bug if i am able to.

Another one - After speaking to a couple of people on IRC i got to the conclusion that we are possibly dealing with 3 different problems.

I/Ryan have/has seen data corruption. The files md5sum gets broken the fses Metadata stays intact what an fsck shows.

Spock and Ian see "I/O" errors when copying a sourcetree from a disk to a different one (even on the same bus) with "cp -dR". Afterwards the filesystems metadata is corrupt.

Karel sees complete hangs on copy

Flo

Signature · 2 lines
Florian Lohoff                  [email protected]             +49-5201-669912
     Why is it called "common sense" when nobody seems to have any?
#3 lore raw
Quoted 9 lines · Florian Lohoff
Quoted 4 lines · Florian Lohoff
Quoted 3 lines · Florian Lohoff

Hi,
i guess Ryan Murray has stumbled over the multiple disk problem on one of my machines again - I would like to fix that bug if i am able to.

Another one - After speaking to a couple of people on IRC i got to the conclusion that we are possibly dealing with 3 different problems.

Quoted 9 lines

I/Ryan have/has seen data corruption. The files md5sum gets broken the fses Metadata stays intact what an fsck shows.

Spock and Ian see "I/O" errors when copying a sourcetree from a disk to a different one (even on the same bus) with "cp -dR". Afterwards the filesystems metadata is corrupt.

Karel sees complete hangs on copy

Hi,

I saw cp hanged as I want copy the kernel-tree between two disks on resume(the indgio2 from flo, which is online).

Signature · 1 line
Henning

A message that is not in the archive (sent off-list or not yet received): 013801c0bc58$7abe2700$0deca8c0@Ulysses

#5 lore raw

From a test Ryan Murray has made we do have some interesting output:

Case 1
Data gets lost - From a diff on a large directory on ascii data i can see chunks to get lost e.g. 32K (31926 byte)

Case 2
Data gets lost and some additional bytes get inserted:

Example:
------------- schnipp ---------------------------------------

   tcl.h      found in  /build/buildd/blt-2.4u/debian/tcl8.0/include
-  tk.h       found in  /build/buildd/blt-2.4u/debian/tk8.0/include

[...]
-gcc -c -Wall -O6 -I. -I. -I/build/buildd/blt-2.4u/debian/tk8.0/include -I/build/buildd/blt-2.4u/debian/tcl8.0/include bltGrPs.c
+ tk.h found in /build/ltGrPs.c
gcc -c -Wall -O6 -I. -I. -I/build/buildd/blt-2.4u/debian/tk8.0/include -I/build/buildd/blt-2.4u/debian/tcl8.0/include bltGraph.c
------------- schnapp ---------------------------------------

Case 3
Zero bytes get inserted (2561 bytes and 3073 bytes)

Example:

------------- schnipp ---------------------------------------

 gcc -c -Wall -O6   -I. -I.  -I/build/buildd/blt-2.4u/debian/tk8.0/include -I/build/buildd/blt-2.4u/debian/tcl8.0/include tkFrame.c
-gcc -c -Wall -O6   -I. -I.  -I/build/buildd/blt-2.4u/debian/tk8.0/include -I/build/buildd/blt-2.4u/debian/tcl8.0/include tkScrollbar.c
+gcc -c -Wall -O6   -I. -I.  -I/build/buildd/blt-2.4u

/debian/tk8.0/include -I/build/buildd/blt-2.4u/debian/tcl8.0/include tkScrollbar.c
gcc -c -Wall -O6 -I. -I. -I/build/buildd/blt-2.4u/debian/tk8.0/include -I/build/buildd/blt-2.4u/debian/tcl8.0/include bltTed.c
------------- schnapp ---------------------------------------

Case 4
Garbage data gets inserted (Go and find the rootpw :) )

Example:

------------- schnipp ---------------------------------------

 455663    4 -rw-r--r--   1 root     root         2514 Oct  6  1998 ./usr/share/doc/fltk/examples/whiteking_3.xbm
-455664    4 -rw-r--r--   1 root     root         2514 Oct  6  1998 ./usr/share/doc/fltk/examples/whiteking_4.xbm
+455664    4 -rw-r--r--   1 roo\p.Zp..]pRoot^p
+RepositoryjpÈEntrieskp.Zp..lpCVSppMakefileqp	ipldump.Srp	ipleckd.Ssp¤iplfba.Slp.kp..mpRootnp
+RepositoryopÈEntriest     root         2514 Oct  6  1998 ./usr/share/doc/fltk/examples/whiteking_4.xbm
 455665    4 -rw-r--r--   1 root     root         2213 Apr  1 12:16 ./usr/share/doc/fltk/examples/makeinclude
 455666    0 lrwxrwxrwx   1 root     root           38 Apr  1 12:33 ./usr/share/doc/fltk/examples/CubeView -> ../../../../lib/fltk/examples/CubeView

------------- schnapp ---------------------------------------

I suspect there is DMA corruption going on.

Flo

Signature · 2 lines
Florian Lohoff                  [email protected]             +49-5201-669912
     Why is it called "common sense" when nobody seems to have any?
#6 lore raw

Ok - more info

1. The bug only happens when accessing 2 disks/devices on the SAME controller
2. The bug is in stopping the HPC DMA to early.
3. Stopping the DMA to early happens only on reads.

If applying this patch on the driver

Index: drivers/scsi/sgiwd93.c
===================================================================
RCS file: /cvs/linux/drivers/scsi/sgiwd93.c,v
retrieving revision 1.27

scsi/sgiwd93.c +4 -0
diff -u -r1.27 sgiwd93.c
@@ -183,6 +187,10 @@
 	printk("dma_stop: status<%d> ", status);
 #endif
 
+	if (hregs->ctrl & HPC3_SCTRL_ACTIVE)
+		printk("DMA still active dir %d bresid %d\n",
+			hdata->dma_dir,
+			SCpnt->SCp.buffers_residual);
 	/* First stop the HPC and flush it's FIFO. */
 	if(hdata->dma_dir) {
 		hregs->ctrl |= HPC3_SCTRL_FLUSH;

I get this output on the console which means files/data got corrupted.

---------------schnipp---------------------
DMA still active dir 1 bresid 6
DMA still active dir 1 bresid 1
DMA still active dir 1 bresid 3
DMA still active dir 1 bresid 1
DMA still active dir 1 bresid 0
DMA still active dir 1 bresid 0
DMA still active dir 1 bresid 0
DMA still active dir 1 bresid 2
DMA still active dir 1 bresid 0
DMA still active dir 1 bresid 2
---------------schnapp---------------------

This might also be the cause why metadata has never been corrupted. Metadata are mostly not read in large chunks which get unchecked dumped to disk again.

One suspicion i had was around the modification of the wd33 registers in the sgi driver (Its the only driver to do so) which based on the thesis that on the wd33 driver we act on the current scatter_gather item and subtract the total length - But this is simply wrong.

Flo

Signature · 2 lines
Florian Lohoff                  [email protected]             +49-5201-669912
     Why is it called "common sense" when nobody seems to have any?