From owner-freebsd-stable@FreeBSD.ORG Fri Mar 2 17:51:27 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F373D16A400 for ; Fri, 2 Mar 2007 17:51:26 +0000 (UTC) (envelope-from hadara@bsd.ee) Received: from smtp-gw1.starman.ee (smtp-out5.starman.ee [85.253.0.7]) by mx1.freebsd.org (Postfix) with ESMTP id 86BE413C442 for ; Fri, 2 Mar 2007 17:51:26 +0000 (UTC) (envelope-from hadara@bsd.ee) Received: from mx2.starman.ee (mx2.starman.ee [62.65.192.9]) by smtp-gw1.starman.ee (Postfix) with ESMTP id 83D21A2151E; Fri, 2 Mar 2007 19:22:42 +0200 (EET) Received: from haigemalt_ei_osanud_smtp_serverit_confida_voi.starman.ee (depression.softematic.com [62.65.205.81]) by mx2.starman.ee (Postfix) with ESMTP id 6A5B032C47F; Fri, 2 Mar 2007 19:22:41 +0200 (EET) From: Sven Petai To: freebsd-stable@freebsd.org Date: Fri, 2 Mar 2007 19:22:47 +0200 User-Agent: KMail/1.9.5 References: <08e101c75cd8$3f569a40$de00a8c0@redeinterna.wavenet.com.br> In-Reply-To: <08e101c75cd8$3f569a40$de00a8c0@redeinterna.wavenet.com.br> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200703021922.47735.hadara@bsd.ee> X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Cc: =?iso-8859-1?q?R=F4mulo_Lima?= , =?iso-8859-1?q?S=F8ren_Schmidt?= Subject: Re: SATA: AHCI controller reset failure - After Upgrade X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2007 17:51:27 -0000 On Friday 02 March 2007 16:37, R=F4mulo Lima wrote: > Hi, > > Good morning, my name is R=F4mulo Lima, I had a problem when make an upgr= ade > in my Freebsd Server from version 6.1 to 6.2. Before upgrade my SATA disc > controller was working normally: > > atapci1: port > 0xec00-0xec0f,0xe480-0xe487,0xe400-0xe40f,0xe080-0xe087,0xe000-0xe01f mem > 0xdffff800-0xdffffbff irq 21 at device 31.1 on pci0 ad4: 78167MB 6Y080M0 YAR51HW0> at ata2-master SATA150 > > But after upgrade I got the following error, and my SATA disc stops, aft= er > that I proceeded with a downgrade and may Server work fine again. > > atapci1: AHCI controller reset failure > device_attach: atapci1 attach returned 6 This regression was discussed recently, see=20 http://docs.freebsd.org/cgi/getmsg.cgi?fetch=3D71434+0+current/freebsd-stab= le The problem seems to be the fact that BIOS indicates AHCI availability when in reality it's not available. Do you have options in BIOS for selecting in what mode SATA works, usually the selection is something like: raid, non-raid, ahci. If there are different modes available then does selecting others than the= =20 current one make any difference ? If it doesn't help then you might try the following patch as a workaround, = it=20 will disable any attempts to try AHCI on other ALI chipsets than 5288, sinc= e=20 that's the only one I have personally used AHCI on and can be fairly certai= n=20 that it really works there.=20 Of course this is only a _workaround_ until S=F8ren or someone else figures= out=20 how to detect AHCI on ALi chipsets more reliably. diff -ru sys/dev/ata_orig/ata-chipset.c sys/dev/ata/ata-chipset.c =2D-- sys/dev/ata_orig/ata-chipset.c Mon Feb 12 01:46:45 2007 +++ sys/dev/ata/ata-chipset.c Fri Mar 2 18:47:16 2007 @@ -952,7 +952,7 @@ struct ata_chip_id *idx; static struct ata_chip_id ids[] =3D {{ ATA_ALI_5289, 0x00, 2, ALISATA, ATA_SA150, "M5289" }, =2D { ATA_ALI_5288, 0x00, 4, ALISATA, ATA_SA300, "M5288" }, + { ATA_ALI_5288, 0x00, 4, ALIAHCI, ATA_SA300, "M5288" }, { ATA_ALI_5287, 0x00, 4, ALISATA, ATA_SA150, "M5287" }, { ATA_ALI_5281, 0x00, 2, ALISATA, ATA_SA150, "M5281" }, { ATA_ALI_5229, 0xc5, 0, ALINEW, ATA_UDMA6, "M5229" }, @@ -984,6 +984,7 @@ switch (ctlr->chip->cfg2) { case ALISATA: + case ALIAHCI: ctlr->channels =3D ctlr->chip->cfg1; ctlr->allocate =3D ata_ali_sata_allocate; ctlr->setmode =3D ata_sata_setmode; @@ -991,8 +992,9 @@ /* if we have a memory resource we can likely do AHCI */ ctlr->r_type2 =3D SYS_RES_MEMORY; ctlr->r_rid2 =3D PCIR_BAR(5); =2D if ((ctlr->r_res2 =3D bus_alloc_resource_any(dev, ctlr->r_type2, =2D &ctlr->r_rid2, RF_ACTI= VE))) + if (ctlr->chip->cfg2 =3D=3D ALIAHCI && + (ctlr->r_res2 =3D bus_alloc_resource_any(dev, ctlr->r_type2, + &ctlr->r_rid2, RF_ACTIVE))) return ata_ahci_chipinit(dev); /* enable PCI interrupt */ diff -ru sys/dev/ata_orig/ata-pci.h sys/dev/ata/ata-pci.h =2D-- sys/dev/ata_orig/ata-pci.h Mon Feb 12 01:46:45 2007 +++ sys/dev/ata/ata-pci.h Fri Mar 2 18:34:23 2007 @@ -360,6 +360,7 @@ #define ALIOLD 0x01 #define ALINEW 0x02 #define ALISATA 0x04 +#define ALIAHCI 0x08 #define HPT366 0 #define HPT370 1