From owner-freebsd-drivers@FreeBSD.ORG Tue Sep 23 02:40:45 2008 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54E08106567D for ; Tue, 23 Sep 2008 02:40:45 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id 20ECA8FC13 for ; Tue, 23 Sep 2008 02:40:45 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 4D080890014; Mon, 22 Sep 2008 19:36:25 -0700 (PDT) X-Virus-Scanned: amavisd-new at X-Spam-Flag: NO X-Spam-Score: -4.399 X-Spam-Level: X-Spam-Status: No, score=-4.399 tagged_above=-10 required=6.6 tests=[ALL_TRUSTED=-1.8, BAYES_00=-2.599] Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fdMKc5mW19-z; Mon, 22 Sep 2008 19:36:24 -0700 (PDT) Received: from [10.47.1.6] (vpn.office.miralink.com [10.0.0.5]) by plato.miralink.com (Postfix) with ESMTP id 773B4890001; Mon, 22 Sep 2008 19:36:24 -0700 (PDT) Message-ID: <48D8572B.3060204@miralink.com> Date: Mon, 22 Sep 2008 19:40:43 -0700 From: Sean Bruno User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: freebsd-drivers@freebsd.org References: <200809222203.WAA20882@sopwith.solgatos.com> <48D82921.3010904@miralink.com> In-Reply-To: <48D82921.3010904@miralink.com> Content-Type: multipart/mixed; boundary="------------000300030402010901040205" Cc: =?ISO-8859-1?Q?dt?= , =?ISO-8859-1?Q?S=F8ren_Schmi?= Subject: Re: [RELENG_6] ATARAID oddity X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2008 02:40:45 -0000 This is a multi-part message in MIME format. --------------000300030402010901040205 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sean Bruno wrote: > Dieter wrote: >>> I.e. if you insert a drive that was part of a volume from an Adaptec >>> RAID controller into another system, the new system will attempt to >>> treat that disk as though it were associated with a HOST Raid >>> controller. >>> >>> I don't think that this is the desired behavior. Even if the host >>> raid meta-data is detected, the system shouldn't attempt to treat >>> the disk as part of a HOST raid set without the appropriate >>> controller in the system. >>> >> >> Even if there *is* an appropriate controller in the system, >> presumably it >> isn't going to work unless the disk is connected to that controller. >> >> We want the ability to migrate a disk from Adaptec to some other >> controller without screwy things happening. >> _______________________________________________ > Looking over the ata-raid.c code that controls the detection, it's > pretty obvious > that it doesn't check to see if the disk belongs to a controller. > Moreover it > blindly tries to use ANY drive in the system(LSI will do this as well) > if it detects > meta data. > > I'm working on a simple patch for this, but I need to figure out > which cards are > using the Adaptec metadata format. Any ideas where I should look? I > seem to have > 1 card available(3010S) that I can validate against. > > Well, I tried out this little patch for my system. This probably breaks a lot of stuff, but it's the beginning of what I think is more correct behavior for Adaptec Host-RAID. If anyone has Adaptec Host-RAID systems out there, please send me the PCI-IDs of your boards before your try this patch. I would assume that there are some Host RAID adapters out there that don't conform to the pci-ids I have put in this patch. If you have one, let me know. -- Sean Bruno MiraLink Corporation 6015 NE 80th Ave, Ste 100 Portland, OR 97218 Cell 503-358-6832 Phone 503-621-5143 Fax 503-621-5199 MSN: sbruno@miralink.com Google: seanwbruno@gmail.com --------------000300030402010901040205 Content-Type: text/x-patch; name="ata_adaptec.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ata_adaptec.diff" Index: ata-pci.c =================================================================== --- ata-pci.c (revision 5956) +++ ata-pci.c (working copy) @@ -532,6 +532,7 @@ switch (pci_get_vendor(dev)) { case ATA_ACARD_ID: return "Acard"; case ATA_ACER_LABS_ID: return "AcerLabs"; + case ATA_ADAPTEC_ID: return "Adaptec"; case ATA_AMD_ID: return "AMD"; case ATA_ATI_ID: return "ATI"; case ATA_CYRIX_ID: return "Cyrix"; Index: ata-raid.c =================================================================== --- ata-raid.c (revision 5956) +++ ata-raid.c (working copy) @@ -1304,6 +1304,12 @@ /* prioritize vendor native metadata layout if possible */ if (devclass == pci_devclass) { switch (pci_get_vendor(GRANDPARENT(device_get_parent(subdisk)))) { + /* Adaptec HostRAID */ + case ATA_ADAPTEC_ID: + if (ata_raid_adaptec_read_meta(subdisk, ata_raid_arrays)) + return 0; + break; + case ATA_HIGHPOINT_ID: if (ata_raid_hptv3_read_meta(subdisk, ata_raid_arrays)) return 0; @@ -1358,10 +1364,6 @@ /* handle controllers that have multiple layout possibilities */ /* NOTE: the order of these are not insignificant */ - /* Adaptec HostRAID */ - if (ata_raid_adaptec_read_meta(subdisk, ata_raid_arrays)) - return 0; - /* LSILogic v3 and v2 */ if (ata_raid_lsiv3_read_meta(subdisk, ata_raid_arrays)) return 0; Index: ata-pci.h =================================================================== --- ata-pci.h (revision 5956) +++ ata-pci.h (working copy) @@ -71,6 +71,8 @@ }; /* defines for known chipset PCI id's */ +#define ATA_ADAPTEC_ID 0x1044 + #define ATA_ACARD_ID 0x1191 #define ATA_ATP850 0x00021191 #define ATA_ATP850A 0x00041191 --------------000300030402010901040205--