From nobody@FreeBSD.org  Mon Apr  3 12:10:59 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5ACE616A401
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Apr 2006 12:10:59 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A314743D66
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Apr 2006 12:10:56 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k33CAtds022726
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 3 Apr 2006 12:10:55 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k33CAsSE022723;
	Mon, 3 Apr 2006 12:10:54 GMT
	(envelope-from nobody)
Message-Id: <200604031210.k33CAsSE022723@www.freebsd.org>
Date: Mon, 3 Apr 2006 12:10:54 GMT
From: "Roman V. Palagin" <romanp@unshadow.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Wrong array detection for LSI v3 SATA MegaRAID
X-Send-Pr-Version: www-2.3

>Number:         95260
>Category:       kern
>Synopsis:       [ata] Wrong array detection for LSI v3 SATA MegaRAID
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 03 12:20:12 GMT 2006
>Closed-Date:    Thu Apr 19 06:57:13 GMT 2007
>Last-Modified:  Mon Dec 13 05:20:05 UTC 2010
>Originator:     Roman V. Palagin
>Release:        6.1-PRERELEASE
>Organization:
>Environment:
FreeBSD xxx.in-tel.ru 6.1-BETA4 FreeBSD 6.1-BETA4 #1: Tue Mar 28 12:52:58 MSD 2006     romanp@kreator6:/u01/obj/u01/src/sys/SMP  i386

Don't look at -BETA4 - this system was build from sources of March, 28
>Description:
I've two RAID1 arrays configured on on-board LSI SATA controller. Four HDD
(2x80Gb and 2x250Gb) attached to ports 0,1,2,3 (according to LSI BIOS terms)
and RAID build from ports 0,1 (80Gb mirror) and ports 2,3 (250Gb mirror).
Both logical volumes initialized in BIOS and have status OK. LSI BIOS
version 5.4.11more_numbers_follows if it's matter.

When FreeBSD boots, it's see the following configuration:

%grep ^ad dmesg.boot
adv0: not probed (disabled)
ad4: 76319MB <Seagate ST3808110AS 3.AAD> at ata2-master SATA150
ad4: 156301488 sectors [155061C/16H/63S] 16 sectors/interrupt 1 depth queue
ad4: Intel check1 failed
ad4: Adaptec check1 failed
ad5: 238475MB <Seagate ST3250623NS 5.01> at ata2-slave SATA150
ad5: 488397168 sectors [484521C/16H/63S] 16 sectors/interrupt 1 depth queue
ad5: Intel check1 failed
ad5: Adaptec check1 failed
ad6: 76319MB <Seagate ST3808110AS 3.AAD> at ata3-master SATA150
ad6: 156301488 sectors [155061C/16H/63S] 16 sectors/interrupt 1 depth queue
ad6: Intel check1 failed
ad6: Adaptec check1 failed
ad7: 238475MB <Seagate ST3250623NS 5.01> at ata3-slave SATA150
ad7: 488397168 sectors [484521C/16H/63S] 16 sectors/interrupt 1 depth queue
ad7: Intel check1 failed
ad7: Adaptec check1 failed
%grep ^ar dmesg.boot
ar0: 76228MB <LSILogic v3 MegaRAID RAID1> status: READY
ar0: 156114944 sectors [9717C/255H/63S] <> subdisks defined as:
ar0: disk0 READY (master) using ad4 at ata2-master
ar0: disk1 READY (mirror) using ad7 at ata3-slave
ar1: 238352MB <LSILogic v3 MegaRAID RAID1> status: READY
ar1: 488144896 sectors [30385C/255H/63S] <> subdisks defined as:
ar1: disk0 READY (master) using ad4 at ata2-master
ar1: disk1 READY (mirror) using ad7 at ata3-slave
%

Size of ar0 and ar1 is rignt, but disks are totaly wrong. Kernel thinks
that both arrays constructed from same disks. As result when I wrote smth.
in ar0 I can see this in ar1. i.e. I can mount /usr FS via /dev/ar0s1d and
via /dev/ar1s1d.

Bellow is related part of 'boot -v' dmesg:

ad4: 76319MB <Seagate ST3808110AS 3.AAD> at ata2-master SATA150
ad4: 156301488 sectors [155061C/16H/63S] 16 sectors/interrupt 1 depth queue
ad4: Intel check1 failed
ad4: Adaptec check1 failed
******* ATA LSILogic V3 MegaRAID Metadata *******
lsi_id              <$_IDE$>
dummy_0             0xe000002
version             0x0231
dummy_0             0xe000002
RAID configs:
00  stripe_pages       32
00  type               RAID1
00  total_disks        2
00  array_width        1
00  sectors            156114944
00  offset             0
00  device             0x00
01  stripe_pages       32
01  type               RAID1
01  total_disks        2
01  array_width        1
01  sectors            488144896
01  offset             0
01  device             0x01
DISK configs:
00  disk_sectors       156114944
00  flags              0x00
01  disk_sectors       156114944
01  flags              0x00
device              0x00
timestamp           0x1a3ad180
checksum_1          0x71
=================================================
ad5: 238475MB <Seagate ST3250623NS 5.01> at ata2-slave SATA150
ad5: 488397168 sectors [484521C/16H/63S] 16 sectors/interrupt 1 depth queue
ad5: Intel check1 failed
ad5: Adaptec check1 failed
******* ATA LSILogic V3 MegaRAID Metadata *******
lsi_id              <$_IDE$>
dummy_0             0xe000002
version             0x0231
dummy_0             0xe000002
RAID configs:
00  stripe_pages       32
00  type               RAID1
00  total_disks        2
00  array_width        1
00  sectors            156114944
00  offset             0
00  device             0x00
01  stripe_pages       32
01  type               RAID1
01  total_disks        2
01  array_width        1
01  sectors            488144896
01  offset             0
01  device             0x01
DISK configs:
00  disk_sectors       156114944
00  flags              0x00
01  disk_sectors       156114944
01  flags              0x00
device              0x01
timestamp           0x1a3ad180
checksum_1          0x70
=================================================
ata3-slave: pio=PIO4 wdma=WDMA2 udma=UDMA133 cable=40 wire
ata3-master: pio=PIO4 wdma=WDMA2 udma=UDMA133 cable=40 wire
ad6: 76319MB <Seagate ST3808110AS 3.AAD> at ata3-master SATA150
ad6: 156301488 sectors [155061C/16H/63S] 16 sectors/interrupt 1 depth queue
ad6: Intel check1 failed
ad6: Adaptec check1 failed
******* ATA LSILogic V3 MegaRAID Metadata *******
lsi_id              <$_IDE$>
dummy_0             0xe000002
version             0x0231
dummy_0             0xe000002
RAID configs:
00  stripe_pages       32
00  type               RAID1
00  total_disks        2
00  array_width        1
00  sectors            156114944
00  offset             0
00  device             0x00
01  stripe_pages       32
01  type               RAID1
01  total_disks        2
01  array_width        1
01  sectors            488144896
01  offset             0
01  device             0x01
DISK configs:
00  disk_sectors       156114944
00  flags              0x00
01  disk_sectors       156114944
01  flags              0x00
device              0x10
timestamp           0x1a3ad180
checksum_1          0x61
=================================================
ad7: 238475MB <Seagate ST3250623NS 5.01> at ata3-slave SATA150
ad7: 488397168 sectors [484521C/16H/63S] 16 sectors/interrupt 1 depth queue
ad7: Intel check1 failed
ad7: Adaptec check1 failed
******* ATA LSILogic V3 MegaRAID Metadata *******
lsi_id              <$_IDE$>
dummy_0             0xe000002
version             0x0231
dummy_0             0xe000002
RAID configs:
00  stripe_pages       32
00  type               RAID1
00  total_disks        2
00  array_width        1
00  sectors            156114944
00  offset             0
00  device             0x00
01  stripe_pages       32
01  type               RAID1
01  total_disks        2
01  array_width        1
01  sectors            488144896
01  offset             0
01  device             0x01
DISK configs:
00  disk_sectors       156114944
00  flags              0x00
01  disk_sectors       156114944
01  flags              0x00
device              0x11
timestamp           0x1a3ad180
checksum_1          0x60
=================================================
ATA PseudoRAID loaded
********** ATA PseudoRAID ar0 Metadata **********
=================================================
format              LSILogic v3 MegaRAID
type                RAID1
flags               0x00 0
magic_0             0x000000001a3ad180
magic_1             0x0000000000000000
generation          0
total_sectors       156114944
offset_sectors      0
heads               255
sectors             63
cylinders           9717
width               1
interleave          256
total_disks         2
    disk 0:      flags = 0x0b b<ONLINE,ASSIGNED,PRESENT>
        ad4:  sectors 156114944
    disk 1:      flags = 0x0b b<ONLINE,ASSIGNED,PRESENT>
        ad7:  sectors 156114944
=================================================
ar0: 76228MB <LSILogic v3 MegaRAID RAID1> status: READY
ar0: 156114944 sectors [9717C/255H/63S] <> subdisks defined as:
ar0: disk0 READY (master) using ad4 at ata2-master
ar0: disk1 READY (mirror) using ad7 at ata3-slave
********** ATA PseudoRAID ar1 Metadata **********
=================================================
format              LSILogic v3 MegaRAID
type                RAID1
flags               0x00 0
magic_0             0x000000001a3ad180
magic_1             0x0000000000000000
generation          0
total_sectors       488144896
offset_sectors      0
heads               255
sectors             63
cylinders           30385
width               1
interleave          256
total_disks         2
    disk 0:      flags = 0x0b b<ONLINE,ASSIGNED,PRESENT>
        ad4:  sectors 488144896
    disk 1:      flags = 0x0b b<ONLINE,ASSIGNED,PRESENT>
        ad7:  sectors 488144896
=================================================
ar1: 238352MB <LSILogic v3 MegaRAID RAID1> status: READY
ar1: 488144896 sectors [30385C/255H/63S] <> subdisks defined as:
ar1: disk0 READY (master) using ad4 at ata2-master
ar1: disk1 READY (mirror) using ad7 at ata3-slave

>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: remko 
State-Changed-When: Mon Dec 25 17:40:17 UTC 2006 
State-Changed-Why:  
Put the PR into feedback mode, is the current behaviour still 
seen on recent FreeBSD versions? 



Responsible-Changed-From-To: freebsd-bugs->mjacob 
Responsible-Changed-By: remko 
Responsible-Changed-When: Mon Dec 25 17:40:17 UTC 2006 
Responsible-Changed-Why:  
Assign to mjacob, he does a lot in this area and might help out here 
(hopefully). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=95260 
Responsible-Changed-From-To: mjacob->sos 
Responsible-Changed-By: mjacob 
Responsible-Changed-When: Mon Feb 5 16:56:34 UTC 2007 
Responsible-Changed-Why:  
Redirecting to somebody who will know more about onboard SATA. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=95260 
State-Changed-From-To: feedback->closed 
State-Changed-By: linimon 
State-Changed-When: Thu Apr 19 06:56:04 UTC 2007 
State-Changed-Why:  
Feedback timeout (several months). 

To submitter: if this is still a problem, let me know so that I can 
reopen it. 

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

From: "Andrey V. Elsukov" <bu7cher@yandex.ru>
To: bug-followup@FreeBSD.org, romanp@unshadow.net,
        =?KOI8-R?Q?S=3Fren_S?= =?KOI8-R?Q?chmidt?= <sos@FreeBSD.org>
Cc:  
Subject: Re: kern/95260: [ata] Wrong array detection for LSI v3 SATA MegaRAID
Date: Tue, 05 Feb 2008 09:22:17 +0300

 Hi, All.
 
 The problem is still here. I know several people, who have
 these problems.
 
 -- 
 WBR, Andrey V. Elsukov

From: =?UTF-8?B?0KHQtdGA0LPQtdC5INCY0LHRgNCw0LPQuNC80L7Qsg==?=
 <ibragimov@gpb.ural.ru>
To: bug-followup@FreeBSD.org, romanp@unshadow.net
Cc:  
Subject: Re: kern/95260: [ata] Wrong array detection for LSI v3 SATA MegaRAID
Date: Mon, 13 Dec 2010 10:05:50 +0500

 Same problem on FreeBSD 8.1-RELEASE-p2.
 
 Patch from http://butcher.heavennet.ru/patches/kernel/ata/LSIv3/ 
 successfully applied. Both raids work fine.
>Unformatted:
