From owner-freebsd-current@FreeBSD.ORG Thu May 28 18:34:21 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 675501065670 for ; Thu, 28 May 2009 18:34:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id E00838FC20 for ; Thu, 28 May 2009 18:34:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 244250225; Thu, 28 May 2009 21:34:17 +0300 Message-ID: <4A1ED927.5020203@FreeBSD.org> Date: Thu, 28 May 2009 21:34:15 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.21 (X11/20090405) MIME-Version: 1.0 To: triosoft@triosoft.com.ua References: <1243203786.00116459.1243193402@10.7.7.3> In-Reply-To: <1243203786.00116459.1243193402@10.7.7.3> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: ATA_STATIC_ID and AHCI bug or /dev/hands ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2009 18:34:21 -0000 triosoft@triosoft.com.ua wrote: > I found some odd behavior of ata device numbering. It seems, that there > is no effect of option ATA_STATIC_ID in CURRENT. > What I have: > supermicro server with 4 sata ports onto Intel ICH7 SATA300 controller > recent CURRENT > sata mode in BIOS is Enhanced > ahci support in BIOS in Enabled > option ATA_STATIC_ID in KERNCONF > > So, if I boot with 4 HDD connected to sata i found ad4,ad6,ad8,ad10 as > disks. but when I detach disk, which "was" ad8 in last case, and then > reboot - I see ad4,ad6,ad8! and not ad4,ad6,ad10! atacontrol list > doesn't show an empty ata channel. Only channels with HDDs connected. I > check 6.x 7.x on the same server with _the same configuration in bios_ - > and all works as suspected - there are empty ata channels, there are > really static device numbers. when I set AHCI to Disabled I have just > two ata channels (with AHCI - I have four, one for each sata disk) and > with or without HDDs connected I see empty channels and have really > static dev nums in the same CURRENT. > So my question is - is it my fault? does I miss something? Or it is a bug? > > Yes ;) I know about glabel, but my setup is complicated enough without > them ( gpart-ed disks with zfs-only setup) so I do not want to make it > more complicated. > And with such behavior I cannot add disks on the fly, if there is > no empty ata channels. This looks like odd behavior of Supermicro BIOS. It marks unconnected ports as unimplemented. I have also noticed such behavior on one of my Supermicro servers. It is not difficult to change ahci driver logic now, but I just not sure yet how we should better handle this situation. AHCI specification uses that register for reporting ports not implemented in hardware, not for unused. As quick hack, you can try to replace in ata-ahci.c line ctlr->ichannels = ATA_INL(ctlr->r_res2, ATA_AHCI_PI); with ctlr->ichannels = 0xFFFFFFFF; to just ignore what BIOS thinks about implemented ports. -- Alexander Motin