ICH10 not working with AHCI kernel option
I'm using Linux 2.6.33 and MSI X58 Pro-E motherboard which have
the following SATA controller:
00:1f.2 SATA controller: Intel Corporation 82801JI (ICH10 Family) SATA AHCI Controller
But if I use just the following kernel option:
<*> AHCI SATA support
it will not be able to mount the root device.
So I have to use:
[*] ATA SFF support
<*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support
What's wrong here? I mean, I would like to use just AHCI and
get rid of this legacy SFF interface.
Hints? Thanks.
Signature · 1 line
Linux 2.6.33: Man-Eating Seals of Antiquity
Quoted 4 lines
What's wrong here? I mean, I would like to use just AHCI and
get rid of this legacy SFF interface.Hints? Thanks.
Hint - we are not telepathic, nor do we have a secret backlink into your machine and copies of all your boot logs.
Quoted 2 lines · On Thu, 8 Apr 2010 14:45:25 +0100 Alan Cox <[email protected]> wrote:
Hint - we are not telepathic, nor do we have a secret backlink into your machine and copies of all your boot logs.
Yes, of course not Alan, but if you tell me what info you need,
I'll be glad in providing it. I just thought it was a trivial issue.
Regarding the boot log, it just says the usual:
ode: VFS: Cannot open root device "802" ...
But the important thing here is: should it work with just the
AHCI kernel support? I tested it with 2 machines and it gave me the same behaviour.
At first, my question was more theorical than practical.
Thanks.
Ps: if you tell me that it will never work with just the AHCI
kernel option, then there's no problem here.
Quoted 3 lines
But the important thing here is: should it work with just the
AHCI kernel support? I tested it with 2 machines and it gave me the same behaviour.
If you have the device name right (and if you are not using labels remember it might change depending upon whether the pata port has disks or not), your controller is in AHCI mode in the BIOS and your disk is on the SATA cables then yes.
And in those cases it should always use the AHCI driver for those devices even if the PIIX driver is also present
Alan
Quoted 7 lines · On Thu, 8 Apr 2010 14:59:16 +0100 Alan Cox <[email protected]> wrote:
If you have the device name right (and if you are not using labels remember it might change depending upon whether the pata port has disks or not), your controller is in AHCI mode in the BIOS and your disk is on the SATA cables then yes.
And in those cases it should always use the AHCI driver for those devices even if the PIIX driver is also present
Ok Alan, thanks for the answer. So I'll have to dig more here
to see where's the problem. The relevant part of the boot log is the following:
ahci 0000:00:1f.2: version 3.0
ahci 0000:00:1f.2: PCI INT B -> GSI 19 (level, low) -> IRQ 19
ahci 0000:00:1f.2: irq 29 for MSI/MSI-X
ahci: SSS flag set, parallel bus scan disabled
ahci 0000:00:1f.2: AHCI 0001.0200 32 slots 6 ports 3 Gbps 0x3f impl SATA mode ahci 0000:00:1f.2: flags: 64bit ncq sntf stag pm led clo pio slum part ccc ems sxs ahci 0000:00:1f.2: setting latency timer to 64
scsi0 : ahci
scsi1 : ahci
scsi2 : ahci
scsi3 : ahci
scsi4 : ahci
scsi5 : ahci
ata1: SATA max UDMA/133 abar m2048@0xf5ff6000 port 0xf5ff6100 irq 29
ata2: SATA max UDMA/133 abar m2048@0xf5ff6000 port 0xf5ff6180 irq 29
ata3: SATA max UDMA/133 abar m2048@0xf5ff6000 port 0xf5ff6200 irq 29
ata4: SATA max UDMA/133 abar m2048@0xf5ff6000 port 0xf5ff6280 irq 29
ata5: SATA max UDMA/133 abar m2048@0xf5ff6000 port 0xf5ff6300 irq 29
ata6: SATA max UDMA/133 abar m2048@0xf5ff6000 port 0xf5ff6380 irq 29
PNP: PS/2 Controller [PNP0303:PS2K] at 0x60,0x64 irq 1
PNP: PS/2 appears to have AUX port disabled, if this is incorrect please boot with i8042.nopnp
serio: i8042 KBD port at 0x60,0x64 irq 1
mice: PS/2 mouse device common for all mice
cpuidle: using governor ladder
cpuidle: using governor menu
TCP cubic registered
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata1.00: ATA-8: ST31500341AS, CC1H, max UDMA/133
ata1.00: 2930277168 sectors, multi 16: LBA48 NCQ (depth 31/32)
ata1.00: configured for UDMA/133
scsi 0:0:0:0: Direct-Access ATA ST31500341AS CC1H PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 2930277168 512-byte logical blocks: (1.50 TB/1.36 TiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sda: sda1 sda2
sd 0:0:0:0: [sda] Attached SCSI disk
ata2: SATA link down (SStatus 0 SControl 300)
ata3: SATA link down (SStatus 0 SControl 300)
ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata4.00: ATAPI: HL-DT-ST BD-RE GGW-H20L, YL05, max UDMA/133
ata4.00: configured for UDMA/133
scsi 3:0:0:0: CD-ROM HL-DT-ST BD-RE GGW-H20L YL05 PQ: 0 ANSI: 5
ata5: SATA link down (SStatus 0 SControl 300)
ata6: SATA link down (SStatus 0 SControl 300)
*** It seems it's using the AHCI driver, but if I remove the PIIX driver, it simply won't
mount the root device. At least for the logs it is using the ahci driver, correct?
Quoted 2 lines
It seems it's using the AHCI driver, but if I remove the PIIX driver, it simply won't
mount the root device. At least for the logs it is using the ahci driver, correct?
Yes
Quoted 1 line · On Thu, 8 Apr 2010 15:09:20 +0100 Alan Cox <[email protected]> wrote:
Yes
Ok, problem solved. You're right, the BIOS option was wrong.
The problem is that it's called "RAID mode" and I found it not intuitive since I don't use RAID (so I didn't touch it). I changed it from IDE to AHCI and it worked.
So just a quick and last question. I read here the following:
http://forum-en.msi.com/index.php?topic=106575.120
"AHCI is a native SATA Mode. There is not necessarely a major performance difference between IDE/Legacy Mode and AHCI Mode".
Of course this guy is talking about Windows, but can it be
applied to Linux too? I mean, does AHCI offers no significant performance improvement over SFF/Legacy mode?
Thanks.
Quoted 12 lines · Dâniel Fraga
Quoted 1 line · On Thu, 8 Apr 2010 15:09:20 +0100 Alan Cox<[email protected]> wrote:
Yes
Ok, problem solved. You're right, the BIOS option was wrong.
The problem is that it's called "RAID mode" and I found it not intuitive since I don't use RAID (so I didn't touch it). I changed it from IDE to AHCI and it worked.So just a quick and last question. I read here the following:
Quoted 8 lines
http://forum-en.msi.com/index.php?topic=106575.120
"AHCI is a native SATA Mode. There is not necessarely a major performance difference between IDE/Legacy Mode and AHCI Mode".
Of course this guy is talking about Windows, but can it be
applied to Linux too? I mean, does AHCI offers no significant performance improvement over SFF/Legacy mode?
Depends on a lot of things, and what you mean by "significant". You don't get NCQ in legacy mode, and you also don't get 64-bit DMA support, which gets more significant the more RAM you have.
Quoted 3 lines · On Thu, 08 Apr 2010 17:54:14 -0600 Robert Hancock <[email protected]> wrote:
Depends on a lot of things, and what you mean by "significant". You don't get NCQ in legacy mode, and you also don't get 64-bit DMA support, which gets more significant the more RAM you have.
I understand Robert. Ok, by significant I mean "better" and
"faster".
So there's no NCQ in legacy mode? But you wrote that
regarding just the ICH chipset or all chipsets? Because I remember when I used the forcedeth driver there was NCQ.
Thank you very much.
Quoted 7 lines · Dâniel Fraga
Quoted 3 lines · On Thu, 08 Apr 2010 17:54:14 -0600 Robert Hancock <[email protected]> wrote:
Depends on a lot of things, and what you mean by "significant". You don't get NCQ in legacy mode, and you also don't get 64-bit DMA support, which gets more significant the more RAM you have.
Quoted 6 lines
I understand Robert. Ok, by significant I mean "better" and "faster".
So there's no NCQ in legacy mode? But you wrote that regarding just the ICH chipset or all chipsets? Because I remember when I used the forcedeth driver there was NCQ.
Think you meant sata_nv or something there, forcedeth is the network driver :-) In that case that's not really legacy mode though, it's some chipset-specific enhanced mode like SWNCQ or ADMA in the NVIDIA case, or the newer Silicon Image controllers which support the fancy features with an entirely different interface from AHCI. In the case of Intel controllers, though, IDE mode is basically the same as a PATA controller with no real SATA-specific features (NCQ, 64-bit DMA, hotplug, etc.)
Quoted 2 lines · On Thu, 8 Apr 2010 20:09:29 -0600 Robert Hancock <[email protected]> wrote:
Think you meant
sata_nvor something there, forcedeth is the network driver :-) In that case that's not really legacy mode though, it's
Oh yeah, sorry for my confusion ;) sata_nv. ;)
Quoted 6 lines
some chipset-specific enhanced mode like SWNCQ or ADMA in the NVIDIA case, or the newer Silicon Image controllers which support the fancy features with an entirely different interface from AHCI. In the case of Intel controllers, though, IDE mode is basically the same as a PATA controller with no real SATA-specific features (NCQ, 64-bit DMA, hotplug, etc.)
Very interesting and thanks again for the excellent explanation
Robert!
Ps: I imagine how many people are running their servers or
desktop computers using the legacy PIIX driver, just because the BIOS setting is wrong (IDE instead of AHCI). In my case I just ignored the "RAID mode" option because I don't ever use RAID.
Don't you think it would be nice to add a warning message
when the kernel detects AHCI capable system like ICH10 and the kernel is misconfigured using the legacy PIIX driver? It could be something like that: "AHCI capable chipset: use ahci driver instead".
Ps2: sorry sending 2 times (forget to send to the list)
Quoted 23 lines · Dâniel Fraga
Quoted 2 lines · On Thu, 8 Apr 2010 20:09:29 -0600 Robert Hancock <[email protected]> wrote:
Think you meant
sata_nvor something there, forcedeth is the network driver :-) In that case that's not really legacy mode though, it'sOh yeah, sorry for my confusion ;)
sata_nv. ;)Quoted 6 lines
some chipset-specific enhanced mode like SWNCQ or ADMA in the NVIDIA case, or the newer Silicon Image controllers which support the fancy features with an entirely different interface from AHCI. In the case of Intel controllers, though, IDE mode is basically the same as a PATA controller with no real SATA-specific features (NCQ, 64-bit DMA, hotplug, etc.)
Very interesting and thanks again for the excellent explanation Robert!
Ps: I imagine how many people are running their servers or desktop computers using the legacy PIIX driver, just because the BIOS setting is wrong (IDE instead of AHCI). In my case I just ignored the "RAID mode" option because I don't ever use RAID.
Quoted 4 lines
Don't you think it would be nice to add a warning message when the kernel detects AHCI capable system like ICH10 and the kernel is misconfigured using the legacy PIIX driver? It could be something like that: "AHCI capable chipset: use ahci driver instead".
We can detect an AHCI-capable Intel chipsets (in most cases anyway), but problem is that a lot of systems with such chipsets, especially laptops, unfortunately have no way to actually put the controller into AHCI mode (no BIOS option for it). We could whine about it, but in a lot of cases there's not much that can be done about it..
Intel chipsets are pretty much the only ones that have the separate modes in the BIOS for AHCI - others like NVIDIA AHCI-compliant controllers support both legacy mode and AHCI in the same device, which is a lot more convenient in some ways..
Quoted 10 lines · On Thu, 8 Apr 2010 20:52:34 -0600 Robert Hancock <[email protected]> wrote:
We can detect an AHCI-capable Intel chipsets (in most cases anyway), but problem is that a lot of systems with such chipsets, especially laptops, unfortunately have no way to actually put the controller into AHCI mode (no BIOS option for it). We could whine about it, but in a lot of cases there's not much that can be done about it..
Intel chipsets are pretty much the only ones that have the separate modes in the BIOS for AHCI - others like NVIDIA AHCI-compliant controllers support both legacy mode and AHCI in the same device, which is a lot more convenient in some ways..
Yes, I agree completely!
It's absurd that in plain XXI century, hardware makers still
default to legacy mode without a chance for the user to change that in BIOS.
I understand that Linus Torvalds complained about EFI some time
ago (http://kerneltrap.org/node/6884), citing it as "other Intel brain-damage" but at least EFI would give a chance for the user to interact better with the system than the limited, ugly and old "BIOS".
When every motherboard maker adopt EFI, I hope this limitation
will go away. I can't understand why new Core i7 systems still use BIOS instead of EFI.
Quoted 7 lines · Dâniel Fraga
Quoted 3 lines · On Thu, 08 Apr 2010 17:54:14 -0600 Robert Hancock<[email protected]> wrote:
Depends on a lot of things, and what you mean by "significant". You don't get NCQ in legacy mode, and you also don't get 64-bit DMA support, which gets more significant the more RAM you have.
Quoted 6 lines
I understand Robert. Ok, by significant I mean "better" and
"faster".So there's no NCQ in legacy mode? But you wrote that
regarding just the ICH chipset or all chipsets? Because I remember when I used the forcedeth driver there was NCQ.
This has a reasonably comprehensive list:
http://ata.wiki.kernel.org/index.php/SATA_hardware_features
Quoted 3 lines
Depends on a lot of things, and what you mean by "significant". You don't get NCQ in legacy mode, and you also don't get 64-bit DMA support, which gets more significant the more RAM you have.
You also don't get the CPU having to handle each command itself and poke the drive which causes signficiant stalls (doubly so because Jeff Garzik hasn't applied my patches to fix the bogus ones yet ;))
So not only do you get 64bit DMA and NCQ but the inter command delay is lower so its faster overall. You also get less CPU stalls for I/O which can be very slow with legacy mode although it usually only upsets real time people.
Alan
Quoted 3 lines
So there's no NCQ in legacy mode? But you wrote that
regarding just the ICH chipset or all chipsets? Because I remember when I used the forcedeth driver there was NCQ.
NCQ requires interfaces above and beyond the "traditional" IDE interface that most controllers used. AHCI is sort of a standard for this but there are a few other NCQ capable devices with their own interfaces/extensions including Nvidia (forcedeth is an ethernet driver so I assume you actually meant the Nvidia SATA driver ?)
Alan
Quoted 8 lines · On Fri, 9 Apr 2010 10:08:33 +0100 Alan Cox <[email protected]> wrote:
You also don't get the CPU having to handle each command itself and poke the drive which causes signficiant stalls (doubly so because Jeff Garzik hasn't applied my patches to fix the bogus ones yet ;))
So not only do you get 64bit DMA and NCQ but the inter command delay is lower so its faster overall. You also get less CPU stalls for I/O which can be very slow with legacy mode although it usually only upsets real time people.
Interesting. With my old motherboard (sata_nv) I used to have
some stalls, mainly on GTK+ apps like Claws-mail during intense I/O and Firefox. Now with AHCI it's barely noticeable, but it happens too, although not as frequent as it used to happen with sata_nv.
I hope your patches get applied soon.
Quoted 6 lines · Robert Hancock
We can detect an AHCI-capable Intel chipsets (in most cases anyway), but problem is that a lot of systems with such chipsets, especially laptops, unfortunately have no way to actually put the controller into AHCI mode (no BIOS option for it). We could whine about it, but in a lot of cases there's not much that can be done about it..
I have a couple of machines with those BIOSes, and apart from the fact that the Intel ICH datasheets say something like "none but the saintly BIOS writers shall program this register", it does seem to be possible to put an ICH9R into AHCI mode using setpci and the fake hot plug driver...
I just wondered what the potential pitfalls might be of doing this? Obviously you wouldn't want to be doing anything with the controller at the time that you change it's mode. Is there also the risk of the bloody bios fiddling with the device after the OS has booted (and then getting surprised about it no longer being in piix mode)?
Cheers,
Tim.
Quoted 8 lines · Tim Small
Quoted 6 lines · Robert Hancock
We can detect an AHCI-capable Intel chipsets (in most cases anyway), but problem is that a lot of systems with such chipsets, especially laptops, unfortunately have no way to actually put the controller into AHCI mode (no BIOS option for it). We could whine about it, but in a lot of cases there's not much that can be done about it..
Quoted 4 lines
I have a couple of machines with those BIOSes, and apart from the fact that the Intel ICH datasheets say something like "none but the saintly BIOS writers shall program this register", it does seem to be possible to put an ICH9R into AHCI mode using setpci and the fake hot plug driver...
In some cases it's likely doable - though you'd likely want to do it as a PCI quirk, so that it gets detected as an AHCI device in the first place rather than having to change it later.
Quoted 6 lines
I just wondered what the potential pitfalls might be of doing this? Obviously you wouldn't want to be doing anything with the controller at the time that you change it's mode. Is there also the risk of the bloody bios fiddling with the device after the OS has booted (and then getting surprised about it no longer being in piix mode)?
Some laptop BIOSes do try to access the controller at certain points, like suspend or powerdown (presumably to make sure the drive heads are unloaded or something) - we've run into problems in the past when the controller was disabled at points where the BIOS didn't expect it to be and it was trying to poke at it, causing a big delay until it finally gave up.
For reasons like that we likely couldn't do it in the general case. We could provide it as a disabled-by-default feature, where if someone enables it and it breaks they get to keep both pieces..
Quoted 6 lines
Some laptop BIOSes do try to access the controller at certain points, like suspend or powerdown (presumably to make sure the drive heads are unloaded or something) - we've run into problems in the past when the controller was disabled at points where the BIOS didn't expect it to be and it was trying to poke at it, causing a big delay until it finally gave up.
Suspend/powerdown are less of a problem because any patch to put it into AHCI mode should put it back as it was before during suspend/poweroff.
It's strange goings in in the background that are more of a concern.
Alan
Quoted 9 lines · Alan Cox
Quoted 7 lines
Some laptop BIOSes do try to access the controller at certain points, like suspend or powerdown (presumably to make sure the drive heads are unloaded or something) - we've run into problems in the past when the controller was disabled at points where the BIOS didn't expect it to be and it was trying to poke at it, causing a big delay until it finally gave up.
Quoted 3 lines
Suspend/powerdown are less of a problem because any patch to put it into AHCI mode should put it back as it was before during suspend/poweroff.
Using DECLARE_PCI_FIXUP_SUSPEND etc? I'll see if I can get some time to have a go at this. The hardware I have access to without AHCI BIOS options are Dell Poweredge R200s and R300s.
As far as I can workout, from my experiments using setpci+fakehp two of the port IO regions get coalesced, and an additional memory IO BAR gets set up on the ICH9R when in AHCI mode, so I'll have to try and work out how to handle this properly in the quirk.
As Robert said, the "off-by-default + if it breaks, you get to keep both pieces" policy is what I had in mind, and I think this should go into arch/x86/pci/fixup.c ? Any obvious pit-falls to avoid?
Cheers,
Tim.
Quoted 3 lines
Using
DECLARE_PCI_FIXUP_SUSPENDetc? I'll see if I can get some time to have a go at this. The hardware I have access to without AHCI BIOS options are Dell Poweredge R200s and R300s.
Yep.
Quoted 3 lines
As Robert said, the "off-by-default + if it breaks, you get to keep both pieces" policy is what I had in mind, and I think this should go into
arch/x86/pci/fixup.c? Any obvious pit-falls to avoid?
There are probably two things to watch - you need to do the fixup early enough (I think as a header fixup) that the resources are correctly seen, and the chip docs say that if you hide one of the interfaces you can't unhide it - which shouldn't be a problem in your case.
Alan
Quoted 10 lines · Tim Small
Quoted 9 lines · Alan Cox
Quoted 7 lines
Some laptop BIOSes do try to access the controller at certain points, like suspend or powerdown (presumably to make sure the drive heads are unloaded or something) - we've run into problems in the past when the controller was disabled at points where the BIOS didn't expect it to be and it was trying to poke at it, causing a big delay until it finally gave up.
Quoted 7 lines
Quoted 3 lines
Suspend/powerdown are less of a problem because any patch to put it into AHCI mode should put it back as it was before during suspend/poweroff.
Using
DECLARE_PCI_FIXUP_SUSPENDetc? I'll see if I can get some time to have a go at this. The hardware I have access to without AHCI BIOS options are Dell Poweredge R200s and R300s.
Yeah, you'll really want to enable AHCI mode in the header stage on boot and on resume, and disable it on suspend and shutdown (not sure if we actually have a hook for the shutdown case?)
Quoted 9 lines
As far as I can workout, from my experiments using setpci+fakehp two of the port IO regions get coalesced, and an additional memory IO BAR gets set up on the ICH9R when in AHCI mode, so I'll have to try and work out how to handle this properly in the quirk.
As Robert said, the "off-by-default + if it breaks, you get to keep both pieces" policy is what I had in mind, and I think this should go into
arch/x86/pci/fixup.c? Any obvious pit-falls to avoid?
We seem to have most related quirks for this in drivers/pci/quirks.c, but I guess it could go into either..