From: Tino Keitel on
On Sun, Jul 18, 2010 at 14:34:46 -0600, Jens Axboe wrote:

[...]

> See this is where I'm getting confused, since I'm not entirely sure what
> the boot process is. If I boot a DVD directly, then it's in piix mode.
> Booting through refit -> Linux, it's in piix mode. So my logic was that
> it is probably getting switched into ahci mode by the OSX boot loader or
> perhaps the driver does it there.

If this helps: I switched from grub-pc to grub-efi on my oldish Mac
mini Core 2 Duo (i945 chipset) and the hard disk used AHCI after this.
Suspend also works fine. So I would guess that the AHCI/PIIX difference
is caused by booting with EFI/legacy DOS bootblock, and the latter is
just done for Windows compatibility.

Regards,
Tino
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Tejun Heo on
Hello,

On 07/19/2010 02:25 AM, Jens Axboe wrote:
> +static void pch_update_bar(struct pci_dev *pdev)
> +{
> + if (pcim_iomap_regions(pdev, 1 << 5, "AHCI quirk")) {
> + int ret;
> +
> + printk("AHCI BAR not set - attempting to program... ");
> + pdev->resource[5].flags = IORESOURCE_MEM;
> + ret = pci_allocate_resource(pdev, 5);
> + if (ret)
> + printk (KERN_INFO "Failed to allocate new region\n");
> + else
> + printk (KERN_INFO "Succeeded\n");
> + } else
> + pcim_iounmap_regions(pdev, 1 << 5);
> +}

Hmm... as the firmware is setting up the resource during boot,
wouldn't it be better to save it and restore it during resume? That
would be simpler and more robust.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Matthew Garrett on
On Sun, Jul 18, 2010 at 06:44:41PM -0400, Jeff Garzik wrote:

> I would have quirked AHCI/piix hardware into AHCI mode long ago, if
> firmwares defaulting to piix mode would actually program the PCI BAR
> correctly.

If you perform the fixup early enough then the PCI resource allocation
code should take a decent stab at it. I'd feel more comfortable with
that once we start using ACPI _CRS by default, since that gives us a
much better chance of avoiding conflicting with some bit of motherboard
hardware.

--
Matthew Garrett | mjg59(a)srcf.ucam.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Jens Axboe on
On 07/18/2010 11:40 PM, Tino Keitel wrote:
> On Sun, Jul 18, 2010 at 14:34:46 -0600, Jens Axboe wrote:
>
> [...]
>
>> See this is where I'm getting confused, since I'm not entirely sure what
>> the boot process is. If I boot a DVD directly, then it's in piix mode.
>> Booting through refit -> Linux, it's in piix mode. So my logic was that
>> it is probably getting switched into ahci mode by the OSX boot loader or
>> perhaps the driver does it there.
>
> If this helps: I switched from grub-pc to grub-efi on my oldish Mac
> mini Core 2 Duo (i945 chipset) and the hard disk used AHCI after this.
> Suspend also works fine. So I would guess that the AHCI/PIIX difference
> is caused by booting with EFI/legacy DOS bootblock, and the latter is
> just done for Windows compatibility.

Great! That sounds way better. DO you have a pointer to grub-efi? I'm
finding some grub2 efi stuff with google, just want to make sure that is
it. A grub 0.9x with efi would be preferable, I find grub2 to be horrible
to work with in general...

--
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Tino Keitel on
On Mon, Jul 19, 2010 at 09:49:49 -0600, Jens Axboe wrote:

[...]

> Great! That sounds way better. DO you have a pointer to grub-efi? I'm
> finding some grub2 efi stuff with google, just want to make sure that is
> it. A grub 0.9x with efi would be preferable, I find grub2 to be horrible
> to work with in general...

With grub-efi I meant the EFI support in grub2. AFAIK grub 0.9x never
supported EFI.

What information do you need?

Regards,
Tino
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/