On Friday 02 March 2007 16:37, R?mulo Lima wrote:> Hi,
>
> Good morning, my name is R?mulo Lima, I had a problem when make an upgrade
> in my Freebsd Server from version 6.1 to 6.2. Before upgrade my SATA disc
> controller was working normally:
>
> atapci1: <AcerLabs M5287 SATA150 controller> port
> 0xec00-0xec0f,0xe480-0xe487,0xe400-0xe40f,0xe080-0xe087,0xe000-0xe01f mem
> 0xdffff800-0xdffffbff irq 21 at device 31.1 on pci0 ad4: 78167MB <Maxtor
> 6Y080M0 YAR51HW0> at ata2-master SATA150
>
> But after upgrade I got the following error, and my SATA disc stops, after
> 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
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=71434+0+current/freebsd-stable
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
current one make any difference ?
If it doesn't help then you might try the following patch as a workaround,
it
will disable any attempts to try AHCI on other ALI chipsets than 5288, since
that's the only one I have personally used AHCI on and can be fairly certain
that it really works there.
Of course this is only a _workaround_ until S?ren or someone else figures out
how to detect AHCI on ALi chipsets more reliably.
diff -ru sys/dev/ata_orig/ata-chipset.c sys/dev/ata/ata-chipset.c
--- 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[] {{ ATA_ALI_5289, 0x00, 2, ALISATA,
ATA_SA150, "M5289" },
- { 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 = ctlr->chip->cfg1;
ctlr->allocate = ata_ali_sata_allocate;
ctlr->setmode = ata_sata_setmode;
@@ -991,8 +992,9 @@
/* if we have a memory resource we can likely do AHCI */
ctlr->r_type2 = SYS_RES_MEMORY;
ctlr->r_rid2 = PCIR_BAR(5);
- if ((ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2,
- &ctlr->r_rid2,
RF_ACTIVE)))
+ if (ctlr->chip->cfg2 == ALIAHCI &&
+ (ctlr->r_res2 = 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
--- 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