From owner-freebsd-current@FreeBSD.ORG Mon Mar 9 08:47:00 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 412AB106566C for ; Mon, 9 Mar 2009 08:47:00 +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 BBABC8FC14 for ; Mon, 9 Mar 2009 08:46:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 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 236941806; Mon, 09 Mar 2009 10:46:58 +0200 Message-ID: <49B4D781.4040009@FreeBSD.org> Date: Mon, 09 Mar 2009 10:46:57 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.19 (X11/20090118) MIME-Version: 1.0 To: hartzell@alerce.com References: <1236482586.00083946.1236470402@10.7.7.3> In-Reply-To: <1236482586.00083946.1236470402@10.7.7.3> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: Am I using atacontrol attach properly? (sata hotplug issue). 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: Mon, 09 Mar 2009 08:47:00 -0000 Hi. George Hartzell wrote: > I have a Gigabyte GA-6KIEH-RH motherboard. It has 5 SATA ports, 4 > attached to a Sil 3114 controller and 1 attach to an ICH8m. The > system is running -CURRENT from yesterday. > > I have two disks attaching as ad4 and ad6 to ata2 and ata3 resp. > > I can set ACHI mode for ICH8m in the BIOS. When I do not enable it, > the 5th SATA conector shows up as slave on ata6. When I do enable it > the 5th connector shows up as master on ata8. > > If I boot without anything connected to the fifth port, then connect a > drive I thought that the following should work to get the drive > recognized: > > sudo atacontrol detach ata8 > sudo atacontrol attach ata8 > > (or a similar dance with ata6 if AHCI isn't enabled). It is ICH8M port, right? > When I set boot_verbose in loader.conf I see the following when I > attach (two separate attempts with different SATA drives): > > ata8: AHCI reset... > ata8: SATA connect status=00000004 > ata8: AHCI reset done: phy reset found no device > ata8: [MPSAFE] > ata8: [ITHREAD] > ata8: Identifying devices: 00000000 > ata8: New devices: 00000000 > ata8: AHCI reset... > ata8: SATA connect status=00000004 > ata8: AHCI reset done: phy reset found no device > ata8: [MPSAFE] > ata8: [ITHREAD] > ata8: Identifying devices: 00000000 > ata8: New devices: 00000000 There is very little part of AHCI driver takes part on this stage. Mostly it is done by common ata_sata_phy_reset() routine. Try to comment if ((ATA_IDX_INL(ch, ATA_SCONTROL) & ATA_SC_DET_MASK) == ATA_SC_DET_IDLE) return ata_sata_connect(ch); lines in there. It will force full hardware reset to the drive. > If the drive's attached at boot time then it's recognized. > > Am I doing something wrong, or is my hardware balky? Every hardware has some specifics. I have successfully tested hot-plug working with AHCI on ICH8, ICH8M and JMB363. -- Alexander Motin