From cch@cc.kmu.edu.tw  Sun Jul 29 19:33:09 2001
Return-Path: <cch@cc.kmu.edu.tw>
Received: from cc.kmu.edu.tw (cc.kmu.edu.tw [163.15.154.1])
	by hub.freebsd.org (Postfix) with ESMTP id DE32737B401
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 29 Jul 2001 19:33:07 -0700 (PDT)
	(envelope-from cch@cc.kmu.edu.tw)
Received: (from cch@localhost)
	by cc.kmu.edu.tw (8.11.4/8.11.4) id f6U2X5G32327;
	Mon, 30 Jul 2001 10:33:05 +0800 (CST)
	(envelope-from cch)
Message-Id: <200107300233.f6U2X5G32327@cc.kmu.edu.tw>
Date: Mon, 30 Jul 2001 10:33:05 +0800 (CST)
From: Chih-Chang Hsieh <cch@kmu.edu.tw>
Reply-To: Chih-Chang Hsieh <cch@kmu.edu.tw>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Promise ATA100 UDMA5 works incorrectly
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         29315
>Category:       i386
>Synopsis:       Promise ATA100 UDMA5 works incorrectly
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 29 19:40:01 PDT 2001
>Closed-Date:    Thu Nov 15 09:43:17 PST 2001
>Last-Modified:  Thu Nov 15 09:46:53 PST 2001
>Originator:     Chih-Chang Hsieh
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
KMU Computer Center
>Environment:
FreeBSD beta.kmu.edu.tw 4.3-STABLE FreeBSD 4.3-STABLE #1: Thu Jul 26 19:25:12 CST 2001     root@beta.kmu.edu.tw:/usr/src/sys/compile/SERVER  i386

machine: AMD Athlon 800MHz (no overclocking), 512 MB PC-100 SDRAM,
ASUS SocketA A7V motherboard (Promise PDC20265 ATA100 controller),
IBM-DTLA-307030 Hard Disk.

>Description:

	When I copy a lager file about 600MB from the HD which
ataches on ATA100 to itself under UDMA5, the new copied file
is different from the original one (checked by md5). But when I
use sysctl to switch the ATA driver from dma mode to pio mode,
the same cp command works correctly. Is this the problem of
ata driver?
	
>How-To-Repeat:

	Everytime when you copy a lager file about 600MB from the HD 
which ataches on ATA100 to itself under UDMA5 mode.

>Fix:
	Sorry, I am not able to fix it.
>Release-Note:
>Audit-Trail:

From: Chih-Chang Hsieh <cch@cc.kmu.edu.tw>
To: freebsd-gnats-submit@FreeBSD.org, cch@kmu.edu.tw
Cc:  
Subject: Re: i386/29315: Promise ATA100 UDMA5 works incorrectly
Date: Tue, 31 Jul 2001 09:09:50 +0800

 I'm very sorry!
 I have got another machine with the same hardware configuration
 only with different number of hardisks.
 It works correctly. Maybe it's a hardware problem.
 I will do more tests.
 Sorry for producing "noise".
 
 
 
State-Changed-From-To: open->feedback 
State-Changed-By: jon 
State-Changed-When: Thu Aug 2 13:00:03 PDT 2001 
State-Changed-Why:  
Pending results from originator's tests. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29315 

From: Chih-Chang Hsieh <cch@cc.kmu.edu.tw>
To: freebsd-gnats-submit@FreeBSD.org, cch@kmu.edu.tw
Cc:  
Subject: Re: i386/29315: Promise ATA100 UDMA5 works incorrectly
Date: Tue, 07 Aug 2001 09:34:28 +0800

 3o,O MIME .f&!*:&h$y,q6l%s!C
 --------------08D908B015FCF9827134B2E2
 Content-Type: text/plain; charset=big5
 Content-Transfer-Encoding: 7bit
 
 I have done several tests by the script in attachment.
 The results of these tests show that: (simply checked by "grep MD5
 chkcp.txt")
 
 1. Intel ICH2 ATA driver (UDMA5 mode) + Seagate-ST320413A -> OK
 please see:
 http://cc.kmu.edu.tw/~cch/FreeBSD/ata/intel-ich2-udma5-hd.txt
 
 2.Promise ATA100 driver (UDMA5 mode) + IBM-DTLA-307030 -> FAIL
 (It sometimes works correctly,  but incorrectly at most time.)
 please see: http://cc.kmu.edu.tw/~cch/FreeBSD/ata/promise-udma5-hd.txt
 
 3. Promise ATA100 driver (UDMA5 mode) + IBM-DTLA-307030 * 2 (vinum -
 raid0) -> FAIL
 please see:
 http://cc.kmu.edu.tw/~cch/FreeBSD/ata/promise-udma5-vinum0.txt
 
 4. Promise ATA100 driver (PIO mode) + IBM-DTLA-307030 *2 (vinum-raid0)
 -> OK
 (But it's too too slow!)
 please see: http://cc.kmu.edu.tw/~cch/FreeBSD/ata/promise-pio-vinum0.txt
 
 Test 1 has been done on machine PC-A.
 Test 2 has been done on machine PC-B.
 Test3 and Test4 has been done on PC-C.
 
 PC-B and PC-C have the same hardware configuration except
 different number of hard disks.
 
 --------------08D908B015FCF9827134B2E2
 Content-Type: application/x-sh;
  name="chkcp.sh"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="chkcp.sh"
 
 #!/bin/sh
 
 #
 # This script tests large file copying on FreeBSD/i386 with ATA hardisk
 #
 sample=/kernel.GENERIC
 nrun=10
 sleep_unit=0
 src=fsrc.tmp
 dst=fdst.tmp
 log=chkcp.txt
 
 echo "Large File Copy Testing begins (`date`)" > $log
 
 # get some of hardware and file system configuration
 #
 echo "" >> $log
 grep -i ata /var/run/dmesg.boot >> $log
 echo "" >> $log
 mount >> $log
 echo "" >> $log
 df >> $log
 echo "" >> $log
 sysctl -a | grep hw.ata >> $log
 
 # tests for file size: (sample file size) * {10,100,1000}
 #
 for count in 10 100 1000 
 do
 
 	# generate source file for copying
 	#
 	echo "" >> $log
 	cat $sample > $src
 	i=0
 	while [ $i -lt $count ]
 	do 
 		cat $sample >> $src
 		i=`expr $i + 1`
 	done
 	echo "src: `ls -l $src`" >> $log
 	md5 $src >> $log
 	echo "" >> $log
 	#sync;sleep 60;sync;sleep 30
 
 	# tests copying
 	#
 	i=0
 	while [ $i -lt $nrun ]
 	do
 		echo "-- Run $i begins (`date`)" >> $log
 		echo "	- cp begins (`date`)" >> $log
 		cp $src $dst
 		echo "	- cp ends (`date`)" >> $log
 		#sync
 		st=`expr $i \* $sleep_unit` 
 		#sync
 		echo "	sleep $st seconds" >> $log
 		sleep $st
 		echo "	dst: `ls -l $dst`" >> $log
 		echo "	- md5 begins (`date`)" >> $log
 		echo "	`md5 $dst`" >> $log
 		echo "	- md5 ends (`date`)" >> $log
 		#sync
 		echo "-- Run $i ends (`date`)" >> $log
 		echo "" >> $log
 		i=`expr $i + 1`
 	done
 done
 echo "Large File Copy Testing ends (`date`)" >> $log
 
 --------------08D908B015FCF9827134B2E2--
 

From: kachun@newsguy.com (Kachun Lee)
To: cch@cc.kmu.edu.tw
Cc: freebsd-gnats-submit@FreeBSD.ORG, iedowse@maths.tcd.ie
Subject: Re: i386/29315: Promise ATA100 UDMA5 works incorrectly
Date: Tue, 07 Aug 2001 16:35:47 -0700

 In article <9kni83$11oj$1@FreeBSD.csie.NCTU.edu.tw>, you say...
 > I have done several tests by the script in attachment.
 > The results of these tests show that: (simply checked by "grep MD5
 > chkcp.txt")
 > 
 > 1. Intel ICH2 ATA driver (UDMA5 mode) + Seagate-ST320413A -> OK
 > please see:
 > http://cc.kmu.edu.tw/~cch/FreeBSD/ata/intel-ich2-udma5-hd.txt
 > 
 > 2.Promise ATA100 driver (UDMA5 mode) + IBM-DTLA-307030 -> FAIL
 > (It sometimes works correctly,  but incorrectly at most time.)
 > please see: http://cc.kmu.edu.tw/~cch/FreeBSD/ata/promise-udma5-hd.txt
 > [snip]
 
 I believe this was the same problem described in:
 
   http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29045
 
 Plus, if the below article was correct...
 
 http://groups.google.com/groups?hl=en&safe=off&th=127674b89a58577c,7&seekm=PaV9
 7.311316%24XL1.5437943%40nlnews00.chello.com#p
 
 then the problem was with the IBM-DTLA drives. That was what I was afraid of... 
 we have quite a few of those drives.
 
 The google article stated the data was always corrupted at the end of a 0x1000 
 block. Will that offer some insight to the problem? It will be nice there is a 
 work around beside running the drives at U33. I send an email to IBM harddrive 
 support and see if they reply.
 
 Regards
 
State-Changed-From-To: feedback->closed 
State-Changed-By: asmodai 
State-Changed-When: Thu Nov 15 09:43:17 PST 2001 
State-Changed-Why:  
The DTLA-307030 is a Deskstar 75GXP.  You have tripped the electronics 
failing.  Contact IBM to get a replacement. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29315 
>Unformatted:
