ARCHIVES

August 2011
July 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
August 2008
July 2008
June 2008
May 2008
March 2008
February 2008
January 2008
November 2007



CONTACT
About this blog: Computers hate me. They really do. Every time I try to do something unusual like add new hardware, something is guaranteed to go wrong. I decided to start writing about my constant problems so that someone else might benefit from my experiences - or at least laugh at them!

  FreeBSD hack to disable AHCI on Jmicron JMB363 controller

13 July 2008, 9:57pm      


I've discovered the hard way that a cheap 2 port PCI express card with a JMicron JMB363 chip on it hard locks FreeBSD 7.0 amd64 - usually within a minute of starting my disk testing (thrashing) program. This is a true hard lock: everything frozen, no keypresses work, even the reset button does nothing for a few moments... and then the computer powers off! (I've never seen this behaviour before, I presume it must be some failsafe circuit that realises things are FUBAR and the only option is to shut down.)

I suspect it's probably an AHCI quirk. The card's BIOS doesn't have any option to enable or disable AHCI in hardware, so instead I tried using FreeBSD's atacontrol to force the drives on that controller into SATA150 (and hopefully non AHCI) mode. It refuses to make any change, stubbornly reporting that the mode is (still) set to SATA300.

As a last resort, I examined and hacked the kernel source:

/usr/src/sys/dev/ata/ata-chipset.c:
-   { ATA_JMB363, 0, 2, 1, ATA_SA300, "JMB363" },
+ { ATA_JMB363, 0, 2, 0, ATA_SA150, "JMB363" },

On boot it's still reported as an AHCI compatible controller, and the attached drives are reported as SATA300, but it's no longer crashing the comp: the disk testing program successfully ran for over an hour, which is about a hundred times longer than it's previously lasted.

One other option that occurred to me was to jumper the drives to force SATA150 mode (first thing I do with a new Seagate is pull out the factory jumper), but unfortunately I had no idea where or if I'd stored the minature jumpers.

The software fix seems to be working. Fingers crossed.




Related posts:
FreeBSD sees through Seagate
FreeBSD gmirror: comparing the different load balancing algorithms
Quick tip: Disabling power button under FreeBSD
To AHCI or not to AHCI
Don't unplug a mounted drive under FreeBSD!