Comment 4 for bug 817017

Revision history for this message
Bernhard Froemel (froemel) wrote :

Thanks!
> And this is in drivers/pci/pci-driver.c. Note that I have swapped the fixup and resume.
> [...]
I see your reservation concerning the changes here... we are not going to get that upstream: there could be side-effects with other quirks.

I have a different suggestion which is hooked in a little bit earlier, but does not require changes in pci-driver.c: instead of starting to handle the "wrong" device and change it into the "correct" one, this patch will put the SATA controller into the desired mode *before* the PCI subsystem sees it.
My patch uses a kernel command parameter too, but also registers the mode of the SATA device controller during startup (e.g. if someone has set it into AHCI via grub2). Resume should be handled correctly in any case (see the comments for details).

I put this yesterday in place and tested it a few times: seems to work fine for me. It should be easy to handle the other devices for iMac 8,1 and 11,1 too - for now I tested only my MBP 6,2.
Note that the patch is nearly upstream-ready, but I want to test it a few weeks/months before actual submission.

> IIRC, earlier MBP's required a 0x40 instead of a 0x60 written to config word 0x90.
That's chipset specific. I guess 0x60 will not harm where previously 0x40 "was required" (of course it's best to look it up in the datasheets). Bit 6 is the important part (AHCI mode) - bit 5 (6 SATA ports instead of 2 on controller 1) is a suggestion from the Intel 5 series datasheet and may be reserved/unused in previous chipsets.