From pan@sexus.npqr.net  Thu Apr  4 06:13:38 2002
Return-Path: <pan@sexus.npqr.net>
Received: from sexus.npqr.net (sexus.npqr.net [63.147.19.44])
	by hub.freebsd.org (Postfix) with ESMTP id 2569E37B419
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  4 Apr 2002 06:13:38 -0800 (PST)
Received: (from pan@localhost)
	by sexus.npqr.net (8.11.6/8.11.6) id g34EDW902408;
	Thu, 4 Apr 2002 06:13:32 -0800 (PST)
	(envelope-from pan)
Message-Id: <200204041413.g34EDW902408@sexus.npqr.net>
Date: Thu, 4 Apr 2002 06:13:32 -0800 (PST)
From: pan <pan@syix.com>
Reply-To: pan <pan@syix.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: pan@syix.com
Subject: ata breaks raid
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         36748
>Category:       kern
>Synopsis:       ata breaks raid
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 04 06:20:03 PST 2002
>Closed-Date:    Wed May 01 05:23:54 PDT 2002
>Last-Modified:  Wed May 01 05:23:54 PDT 2002
>Originator:     pan
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
>Environment:
System: FreeBSD sexus.npqr.net 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Mon Mar 25 14:07:06 PST 2002 proteus@sexus.npqr:/usr/src/sys/compile/SEXUS i386
uname -a  not possible for failed 4.45-STABLE kernel
mb Abit KR7A-R
chipset KT266  VT8366A VT8233
raid HPT372
	
>Description:
clean install of 4.5r mis-identifies hpt372 as ata 100 not atat 133
clean install of 4.5r detects non-existent via 82c686
cvsup to 4.5s == broken ar0, hpt372 ignored,
disks in array are dropped one ata a time,
panic, failed sync, gives up, no boot

booting to kernel.old (4.5-RELEASE)after 4.5-STABLE kenrel
fails == no problem, ar0 not really broken
	
>How-To-Repeat:
buy Abit KR7A-R
read in HARDWARE.TXT that hpt372 is supported
install FreeBSD 4.5 RELEASE
discover working system excpet as noted above
cvsup to 4.5-STABLE
fail boot
	
>Fix:
return 4.5-STABLE ata code back to what was working in 4.5-RELEASE???
	


>Release-Note:
>Audit-Trail:

From: Sren Schmidt <sos@freebsd.dk>
To: pan <pan@syix.com>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/36748: ata breaks raid
Date: Thu, 4 Apr 2002 16:26:13 +0200 (CEST)

 It seems pan wrote:
 > uname -a  not possible for failed 4.45-STABLE kernel
 > mb Abit KR7A-R
 > chipset KT266  VT8366A VT8233
 > raid HPT372
 > 	
 > >Description:
 > clean install of 4.5r mis-identifies hpt372 as ata 100 not atat 133
 > clean install of 4.5r detects non-existent via 82c686
 > cvsup to 4.5s == broken ar0, hpt372 ignored,
 > disks in array are dropped one ata a time,
 > panic, failed sync, gives up, no boot
 
 Hmm, when did you cvsup you -stable sources ?
 Anyhow mail me a pciconf -l from the system, maybe you have
 yet another version HPT chip :(
 
 -Sren
State-Changed-From-To: open->feedback 
State-Changed-By: johan 
State-Changed-When: Tue Apr 23 18:01:27 PDT 2002 
State-Changed-Why:  
sos asked for feedback. 


Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: johan 
Responsible-Changed-When: Tue Apr 23 18:01:27 PDT 2002 
Responsible-Changed-Why:  
sos asked for feedback. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36748 

From: "pan" <pan@syix.com>
To: <freebsd-gnats-submit@FreeBSD.org>, <pan@syix.com>
Cc:  
Subject: Re: kern/36748: ata breaks raid
Date: Tue, 23 Apr 2002 19:40:14 -0700

 kern/36748
 Apr-23-2002
 
 As previously indicated in emails to sos, the patch supplied
 by sos solves the problem of not being able to install
 FreeBSD 4.5-STABLE. (Patch not yet MFC'd).
 (patch appended below)
 
 Previously, questions had been asked about drop in disk
 performance after applying patch. Question arose from
 comparing bonnie++ results between 4.5-RELEASE and
 patched 4.5-STABLE.
 
 It is now clear that bonnie++ is an inadequate test so switched
 to iozone. Results still being analyzed, but for some combinations
 of record and file size in iozone testing, STABLE compares or
 exceeds RELEASE - some combinations still show performance
 loss under STABLE.
 
 (iozone results appended below)
 
 As far as status of this pr (kern/36748) I leave it to sos,
 with thanks, to keep open or close. Patch needs to be MFC'd
 and HPT needs to stop selling so many different varities of
 their RAID chips .... whetehr on separate cards or as part
 of motherboard chipsets.
 
 Since this problem arose with HPT372 RAID0 on new
 UDMA133 disks, there may be interest in the peformance
 results.
 
 Pan
 
 ************ appendages *************
 
 sos patch
 
 
 Index: ata-pci.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/dev/ata/ata-pci.c,v
 retrieving revision 1.36
 diff -u -r1.36 ata-pci.c
 --- ata-pci.c 2 Apr 2002 16:45:06 -0000 1.36
 +++ ata-pci.c 3 Apr 2002 11:49:13 -0000
 @@ -403,22 +403,28 @@
 break;
 
 case 0x00041103: /* HighPoint HPT366/368/370/372 default setup */
 - if (pci_get_revid(dev) < 2) { /* HPT 366 */
 + if (pci_get_revid(dev) < 2) { /* HPT366 */
 /* turn off interrupt prediction */
 pci_write_config(dev, 0x51,
 (pci_read_config(dev, 0x51, 1) & ~0x80), 1);
 break;
 }
 - /* turn off interrupt prediction */
 - pci_write_config(dev, 0x51, (pci_read_config(dev, 0x51, 1) & ~0x03),
 1);
 - pci_write_config(dev, 0x55, (pci_read_config(dev, 0x55, 1) & ~0x03),
 1);
 + if (pci_get_revid(dev) < 5) { /* HPT368/370 */
 + /* turn off interrupt prediction */
 + pci_write_config(dev, 0x51,
 + (pci_read_config(dev, 0x51, 1) & ~0x03), 1);
 + pci_write_config(dev, 0x55,
 + (pci_read_config(dev, 0x55, 1) & ~0x03), 1);
 
 - /* turn on interrupts */
 - pci_write_config(dev, 0x5a, (pci_read_config(dev, 0x5a, 1) & ~0x10),
 1);
 + /* turn on interrupts */
 + pci_write_config(dev, 0x5a,
 + (pci_read_config(dev, 0x5a, 1) & ~0x10), 1);
 
 - /* set clocks etc */
 - pci_write_config(dev, 0x5b, 0x22, 1);
 - break;
 + /* set clocks etc */
 + pci_write_config(dev, 0x5b, 0x22, 1);
 + break;
 + }
 + /* FALLTHROUGH */
 
 case 0x00051103: /* HighPoint HPT372 default setup */
 case 0x00081103: /* HighPoint HPT374 default setup */
 
 
 
 iozone results (line lengths no edited)
 
  Machine = FreeBSD sexus.npqr.net 4.5-STABLE FreeBSD 4.5-STABLE #1: Mon
 Apr  8 15:43:37 PDT 2002
 
                                                             random
 random    bkwd  record  stride
               KB  reclen   write rewrite    read    reread    read
 write    read rewrite    read   fwrite frewrite   fread  freread
               64       4  172482  537617  1207505  1279447 1033216
 32193 1066042  743988 1124074   284568   537617  799377   954248
               64       8  288390  639427  1562436  1728432 1484662
 390278 1452528  969761 1599680   400168   640190  719076  1124074
               64      16  340522  743988  1828508  2133730 1940885
 680780 1828508  865067 1940885   463774   727850  587635  1103284
              128       4  231879  401157  1175271  1254941 1066689
 36876 1076312  847727  776042   270014   393800  847059   941373
              128       8  277695  452366  1455701  1660567 1438153
 61806 1438153 1113134 1684006   311445   442851  941373  1152564
              128      16  302580  484844  1827299  2170879 1911894
 735635 1852520 1142750 2243452   347870   486602  870405  1163807
              256       4  222985  293227   458804   809878  807442
 48337  368881  930608  470566   194542   288927  387240   602445
              256       8  244043  301544   505931   917488  914363
 49080  576565 1224606  524593   274382   323678  403767   654598
              256      16  275296  340459   486669   907792 1127518
 587287  658008 1347557 2263818   274102   340837  365677   561343
              512       4  227143  278106   393542   413231  452692
 93619  396265  990168  385835   229179   281940  354557   380098
              512       8  259238  313533   416921   468851  495176
 83049  430633 1422357  456735   246389   300649  374824   420349
              512      16  283185  336844   434598   499031  493242
 398138  452310 1765578  511511   278557   336844  352375   416921
             1024       4  213289  272267   406496   426477  406516
 139642  400470 1010864  396130   225300   278870  368088   382376
             1024       8  247522  316345   448148   469944  459806
 296035  446378 1563337  453902   268413   304395  406670   422097
             1024      16  271398  335628   474068   494225  499280
 379403  474303 2015654  476276   273873   325689  386418   416934
             2048       4   31741   31767   418984   433346  386562
 181175  404664 1055623  398525    32018    32097  372296   383593
             2048       8   31933   32153   449916   468759  448729
 303678  445991 1581559  451892    31965    32108  409194   418474
             2048      16   23333   31883   480064   490298  495273
 364346  486122 2185563  494917    31827    32147  407728   415337
             4096       4   26123   22563   381517   428764  383237
 200587  409109 1052410  386561    25644    25796  378696   383986
             4096       8   25426   26102   463140   466675  442144
 302623  454249 1569897  445798    25599    25753  411742   418859
             4096      16   25538   25856   487672   492721  491185
 358479  487679 2256706  426047    25785    25878  411205   417490
             8192       4   21705   21745   424940   430048  380899
 253787  409579 1040122  374988    21684    21767  380758   384798
             8192       8   21396   21975   465192   470479  439980
 307137  456533 1614815  436697    21704    21757  417172   419114
             8192      16   21791   21695   490833   494866  486404
 356655  493257 2182221  482988    21831    21867  418023   422726
            16384       4   21596   21428   425724   429541  375005
 251091  411008 1049387  374251    21623    21641  384934   383618
            16384       8   21623   21588   465256   468568  438110
 309687  456697 1684205  435895    21598    21623  419500   419340
            16384      16   21506   21729   493048   494985  486792
 342260  493448 2259891  485019    21631    21622  419070   421930
 
 	Machine = FreeBSD sexus.npqr.net 4.5-RELEASE FreeBSD 4.5-RELEASE #0:
 Mon Mar 25 14:07:06 PST 2002
 
                                                             random
 random    bkwd  record  stride
               KB  reclen   write rewrite    read    reread    read
 write    read rewrite    read   fwrite frewrite   fread  freread
               64       4  174387  533344  1255511  1360505 1049372
 65844 1121726  954248 1186163   307730   576901  852702  1015624
               64       8  296186  703068  1685033  1998690 1599680
 410260 1599680 1049372 1728432   418250   680780  735831  1140794
               64      16  346008  753385  2006158  2288341 1886329
 727850 1879725  940869 1933893   460591   753385  598110  1085439
              128       4  239268  455436  1306873  1361560 1113134
 94389 1162547 1066689  955616   300464   455629  895074   992724
              128       8  276409  518312  1421023  1885042 1601138
 128382 1523878 1294270 1830414   345965   512132  954766  1133103
              128      16  302580  528777  1967960  2166499 1911894
 753179 1908496 1306873 2372326   373266   544601  864797  1083918
              256       4  232748  296629   505931   984356  886067
 144547  636930 1098675  494286   258869   290923  380920   715205
              256       8  238143  276181   468922  1163562 1163562
 145211  709299 1016025  581719   292907   318399  360037   588414
              256      16  285091  321594   450715   996229 1219045
 643226  783006 1384034 2327614   249980   286345  346893   530031
              512       4  207540  281165   384694   453504  452310
 245797  382093 1221684  428485   227757   279918  345932   395353
              512       8  246163  284291   408592   463338  511511
 200002  423165 1668200  489532   247811   305308  361601   425597
              512      16  259379  288939   425935   496607  537232
 392642  442524 1802630  527273   287469   294244  363899   420349
             1024       4  208855  253910   346415   443291  420712
 127377  403954 1214706  406843   194124   267086  375785   397192
             1024       8  220500  262027   454888   494680  478265
 294755  449132 1805893  473833   233952   268690  392026   410596
             1024      16  250372  275710   463353   503672  488797
 356183  465664 2265510  480297   247401   272994  392941   424726
             2048       4   53324   62843   429264   445321  409682
 242165  405629 1333363  414906    89847    46193  376474   395898
             2048       8   65521   26465   472212   487502  466823
 135270  466823 1884044  473188    63282    43046  402984   427024
             2048      16   64230   27349   483822   501095  497439
 338795  480184 2199554  493028    64744    39915  405227   416930
             4096       4   33619   55498   432526   444443  397205
 256256  417065 1321700  359710    23696    46076  388981   394528
             4096       8   41531   46370   480861   487907  460070
 297459  467691 1943027  465928    39059    48588  378033   422875
             4096      16   33044   55983   488608   495943  495821
 332252  489541 2262949  493556    35470    55275  411490   423668
             8192       4   38386   50650   441830   445678  395328
 250580  422113 1337901  392056    34428    52669  392300   397303
             8192       8   42346   51984   485452   492631  456275
 296844  469563 2022730  453274    29389    48499  417489   421050
             8192      16   42348   52826   493672   499753  495166
 329870  491479 2333855  490388    36543    47411  417662   421528
            16384       4   43792   49805   442847   443866  387337
 246443  417650 1366700  391755    50293    51334  393732   395356
            16384       8   43981   48834   485220   486100  451748
 294226  472270 2038046  455224    38777    49509  420577   422127
            16384      16   42932   49366   498191   500473  491908
 298276  493389 2583797  490612    43213    46174  419263   421756
 
 
State-Changed-From-To: feedback->closed 
State-Changed-By: sos 
State-Changed-When: Wed May 1 05:22:23 PDT 2002 
State-Changed-Why:  
Fixed in stable. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36748 
>Unformatted:
