Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question)

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


tytso at mit

Apr 29, 2009, 7:07 PM

Post #1 of 22 (2525 views)
Permalink
No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question)

I was taking a look at why I can't get NCQ working on the Ultrabay drive
on the X61s Thinkpad (which is a big deal if you're using the X25-M
SSD):

[ 4563.614247] ata4.00: 390721968 sectors, multi 16: LBA48 NCQ (depth 0/32)
^^^^^^^

which as near as I can tell is because ATA_FLAG_NCQ isn't set in struct
ata_port->flag. This looks like it should be set to ata_piix.c if the
controller supports NCQ --- but ata_piix.c doesn't set ATA_FLAG_NCQ at
all. However, this web page:

http://www.intel.com/support/chipsets/imst/sb/CS-012304.htm

Seems to imply the 82801HBM/HEM SATA controller from the ICH8M/ICHM8-E
supports AHCI and NCQ, and this is the controller which is in the X61s
laptop.

So I wonder if it's safe to simply add ATA_FLAG_NCQ to ata_piix.c or
not? Can someone who's more familiar with Intel's ICH8 SATA controller
comment on whether this would be a safe thing to do?

Thanks,

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


tj at kernel

Apr 29, 2009, 7:19 PM

Post #2 of 22 (2490 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

Hello,

Theodore Ts'o wrote:
> [ 4563.614247] ata4.00: 390721968 sectors, multi 16: LBA48 NCQ (depth 0/32)
>
> which as near as I can tell is because ATA_FLAG_NCQ isn't set in struct
> ata_port->flag. This looks like it should be set to ata_piix.c if the
> controller supports NCQ --- but ata_piix.c doesn't set ATA_FLAG_NCQ at
> all. However, this web page:
>
> http://www.intel.com/support/chipsets/imst/sb/CS-012304.htm
>
> Seems to imply the 82801HBM/HEM SATA controller from the ICH8M/ICHM8-E
> supports AHCI and NCQ, and this is the controller which is in the X61s
> laptop.

The controller can be drive in two different modes - piix and ahci.
In piix mode, it behaves like good old IDE controller from 15 years
back and can't do NCQ. Looks like your controller is in piix mode.

> So I wonder if it's safe to simply add ATA_FLAG_NCQ to ata_piix.c or
> not? Can someone who's more familiar with Intel's ICH8 SATA controller
> comment on whether this would be a safe thing to do?

Oh... please don't that. It won't work. On ICHs, whether the
controller is put in piix or ahci mode is determined by the BIOS.
Most desktop BIOSen have option to put the controller in different
modes but most laptops don't seem to have such option.

Thanks.

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


jeff at garzik

Apr 29, 2009, 7:27 PM

Post #3 of 22 (2503 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

Theodore Ts'o wrote:

(you should cc linux-ide...)

> [ 4563.614247] ata4.00: 390721968 sectors, multi 16: LBA48 NCQ (depth 0/32)
> ^^^^^^^

That generally means your disk is capable of NCQ, but your controller is
not.

As Tejun noted, try switching to AHCI mode in BIOS.

Jeff



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


alex.buell at munted

Apr 30, 2009, 12:33 AM

Post #4 of 22 (2496 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

On Wed, 29 Apr 2009 22:27:46 -0400, I waved a wand and this message
magically appears in front of Jeff Garzik:

> As Tejun noted, try switching to AHCI mode in BIOS.

But is there a way to switch modes without needing to go through the
BIOS? Some laptops won't let you do that through BIOS.
--
http://www.munted.org.uk

Fearsome grindings.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


tj at kernel

Apr 30, 2009, 12:45 AM

Post #5 of 22 (2494 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

Alex Buell wrote:
> On Wed, 29 Apr 2009 22:27:46 -0400, I waved a wand and this message
> magically appears in front of Jeff Garzik:
>
>> As Tejun noted, try switching to AHCI mode in BIOS.
>
> But is there a way to switch modes without needing to go through the
> BIOS? Some laptops won't let you do that through BIOS.

There is and it isn't too difficult either in itself but the problem
is that for ahci mode to work the ABAR (PCI BAR 5) needs to be
allocated and enabled. On x86, the kernel takes the PCI resources
allocated by BIOS. Doing it directly isn't necessarily difficult but
is too dangerous as there can be areas which aren't described anywhere
but still are used by something.

Because ICHs don't enable ABAR in piix mode unless SCRAE is set and
most BIOSen don't set SCRAE, ABAR don't get allocated nor its space
get reserved in most cases if the controller is in piix mode.

So, at the point of driver load, there just isn't much we can do about
the missing ABAR. It's sad. Dunno why some laptop manufacturers
still program the thing into piix mode. :-(

Thanks.

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


tytso at mit

Apr 30, 2009, 4:34 AM

Post #6 of 22 (2485 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

On Thu, Apr 30, 2009 at 08:33:09AM +0100, Alex Buell wrote:
> On Wed, 29 Apr 2009 22:27:46 -0400, I waved a wand and this message
> magically appears in front of Jeff Garzik:
>
> > As Tejun noted, try switching to AHCI mode in BIOS.
>
> But is there a way to switch modes without needing to go through the
> BIOS? Some laptops won't let you do that through BIOS.

The BIOS setting already is in AHCI mode, and not in "compatibility
mode". This is with BIOS version 2.19 on the X61s. I can check to
see if there is a newer BIOS revision... hmm, there is a 2.20, but it
claims the only thing it fixes is:

- Fixed an issue where the AMT menu of BIOS Setup Utility might not be
displayed.

I can try upgrading to it and see if it's any better. Or maybe
someone on the Linux-thinkpad mailing list with contacts inside Lenovo
can bug them. Sounds like there's no way to work around this except
for a BIOS-level fix then? :-(

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


tytso at mit

Apr 30, 2009, 4:38 AM

Post #7 of 22 (2501 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

On Thu, Apr 30, 2009 at 07:34:45AM -0400, Theodore Tso wrote:
> On Thu, Apr 30, 2009 at 08:33:09AM +0100, Alex Buell wrote:
> > On Wed, 29 Apr 2009 22:27:46 -0400, I waved a wand and this message
> > magically appears in front of Jeff Garzik:
> >
> > > As Tejun noted, try switching to AHCI mode in BIOS.
> >
> > But is there a way to switch modes without needing to go through the
> > BIOS? Some laptops won't let you do that through BIOS.
>
> The BIOS setting already is in AHCI mode, and not in "compatibility
> mode".

Thinking about this a bit more, I'll bet the problem is the BIOS
setting is only affecting the primary SATA ports (which are being
grabed by ahci) and not the SATA port in the Ultrabay slot (which is
being picked up by either the ata_piix or piix driver). Sigh...

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


alan at lxorguk

Apr 30, 2009, 6:47 AM

Post #8 of 22 (2487 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

> So, at the point of driver load, there just isn't much we can do about
> the missing ABAR. It's sad. Dunno why some laptop manufacturers
> still program the thing into piix mode. :-(

Forcing out of PIIX mode would need to go into the PCI quirks and be a
boot option not a module one - at that point its doable as a header quirk.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


willy at linux

Apr 30, 2009, 8:35 AM

Post #9 of 22 (2485 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

On Thu, Apr 30, 2009 at 02:47:02PM +0100, Alan Cox wrote:
> > So, at the point of driver load, there just isn't much we can do about
> > the missing ABAR. It's sad. Dunno why some laptop manufacturers
> > still program the thing into piix mode. :-(
>
> Forcing out of PIIX mode would need to go into the PCI quirks and be a
> boot option not a module one - at that point its doable as a header quirk.

I think Matthew Garrett already has code to do this.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


hmh at hmh

Apr 30, 2009, 8:42 AM

Post #10 of 22 (2491 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

On Thu, 30 Apr 2009, Theodore Tso wrote:
> I can try upgrading to it and see if it's any better. Or maybe
> someone on the Linux-thinkpad mailing list with contacts inside Lenovo
> can bug them. Sounds like there's no way to work around this except
> for a BIOS-level fix then? :-(

Either me or Thomas Renninger can get in touch with Lenovo, yes. As usual,
I need a self-contained, precise report of what is wrong, why it is wrong,
and what should be done to fix it, so that I can forward it.

--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


mjg59 at srcf

Apr 30, 2009, 8:47 AM

Post #11 of 22 (2486 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

On Thu, Apr 30, 2009 at 08:35:08AM -0700, Matthew Wilcox wrote:
> On Thu, Apr 30, 2009 at 02:47:02PM +0100, Alan Cox wrote:
> > > So, at the point of driver load, there just isn't much we can do about
> > > the missing ABAR. It's sad. Dunno why some laptop manufacturers
> > > still program the thing into piix mode. :-(
> >
> > Forcing out of PIIX mode would need to go into the PCI quirks and be a
> > boot option not a module one - at that point its doable as a header quirk.
>
> I think Matthew Garrett already has code to do this.

Yeah, but some testers reported that it broke after using it for a
while. The most recent version I have is this:

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index a807797..9e7b460 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -893,6 +893,52 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode);
DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode);

+static void __devinit quirk_ahci_sata(struct pci_dev *pdev)
+{
+ u32 sir, newval;
+ u16 mode;
+
+ /* Make sure we're in AHCI mode */
+ pci_read_config_word(pdev, 0x90, &mode);
+ pci_write_config_word(pdev, 0x90, 0x40);
+
+ /* Need to set the SCRAE bit */
+ pci_read_config_dword(pdev, 0x94, &sir);
+ newval = (sir | 0x200);
+ pci_write_config_dword(pdev, 0x94, newval);
+
+ /* Set PCI_CLASS_STORAGE_SATA */
+ if ((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
+ pci_write_config_byte(pdev, PCI_CLASS_PROG, 0x01);
+ pci_write_config_byte(pdev, PCI_CLASS_DEVICE, 0x06);
+ pdev->class = PCI_CLASS_STORAGE_SATA_AHCI;
+ }
+
+ pci_read_config_word(pdev, PCI_DEVICE_ID, &pdev->device);
+ pci_assign_resource(pdev, 5);
+
+ printk (KERN_INFO "Quirked PIIX device to AHCI mode\n");
+}
+
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2652, quirk_ahci_sata);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2653, quirk_ahci_sata);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2680, quirk_ahci_sata);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x27c4, quirk_ahci_sata);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2828, quirk_ahci_sata);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2928, quirk_ahci_sata);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x292d, quirk_ahci_sata);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x292e, quirk_ahci_sata);
+
+#if 0
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2651, quirk_ahci_sata);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x27c0, quirk_ahci_sata);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2820, quirk_ahci_sata);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2825, quirk_ahci_sata);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2920, quirk_ahci_sata);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2921, quirk_ahci_sata);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2926, quirk_ahci_sata);
+#endif
+
/*
* Serverworks CSB5 IDE does not fully support native mode
*/

--
Matthew Garrett | mjg59 [at] srcf
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


hancockrwd at gmail

Apr 30, 2009, 6:49 PM

Post #12 of 22 (2984 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

Matthew Garrett wrote:
> On Thu, Apr 30, 2009 at 08:35:08AM -0700, Matthew Wilcox wrote:
>> On Thu, Apr 30, 2009 at 02:47:02PM +0100, Alan Cox wrote:
>>>> So, at the point of driver load, there just isn't much we can do about
>>>> the missing ABAR. It's sad. Dunno why some laptop manufacturers
>>>> still program the thing into piix mode. :-(
>>> Forcing out of PIIX mode would need to go into the PCI quirks and be a
>>> boot option not a module one - at that point its doable as a header quirk.
>> I think Matthew Garrett already has code to do this.
>
> Yeah, but some testers reported that it broke after using it for a
> while. The most recent version I have is this:

We should likely have something like this in the kernel, but it should
default to off. For one thing, some machines seem to have BIOS code that
tries to poke the controller for some reason during suspend/shutdown
events, etc. which would likely go nuts if the controller was
unexpectedly in AHCI mode..

>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index a807797..9e7b460 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -893,6 +893,52 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk
> DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode);
> DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode);
>
> +static void __devinit quirk_ahci_sata(struct pci_dev *pdev)
> +{
> + u32 sir, newval;
> + u16 mode;
> +
> + /* Make sure we're in AHCI mode */
> + pci_read_config_word(pdev, 0x90, &mode);
> + pci_write_config_word(pdev, 0x90, 0x40);
> +
> + /* Need to set the SCRAE bit */
> + pci_read_config_dword(pdev, 0x94, &sir);
> + newval = (sir | 0x200);
> + pci_write_config_dword(pdev, 0x94, newval);
> +
> + /* Set PCI_CLASS_STORAGE_SATA */
> + if ((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
> + pci_write_config_byte(pdev, PCI_CLASS_PROG, 0x01);
> + pci_write_config_byte(pdev, PCI_CLASS_DEVICE, 0x06);
> + pdev->class = PCI_CLASS_STORAGE_SATA_AHCI;
> + }
> +
> + pci_read_config_word(pdev, PCI_DEVICE_ID, &pdev->device);
> + pci_assign_resource(pdev, 5);
> +
> + printk (KERN_INFO "Quirked PIIX device to AHCI mode\n");
> +}
> +
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2652, quirk_ahci_sata);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2653, quirk_ahci_sata);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2680, quirk_ahci_sata);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x27c4, quirk_ahci_sata);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2828, quirk_ahci_sata);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2928, quirk_ahci_sata);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x292d, quirk_ahci_sata);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x292e, quirk_ahci_sata);
> +
> +#if 0
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2651, quirk_ahci_sata);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x27c0, quirk_ahci_sata);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2820, quirk_ahci_sata);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2825, quirk_ahci_sata);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2920, quirk_ahci_sata);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2921, quirk_ahci_sata);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2926, quirk_ahci_sata);
> +#endif
> +
> /*
> * Serverworks CSB5 IDE does not fully support native mode
> */
>

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


hancockrwd at gmail

Apr 30, 2009, 6:51 PM

Post #13 of 22 (2479 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

Theodore Tso wrote:
> On Thu, Apr 30, 2009 at 07:34:45AM -0400, Theodore Tso wrote:
>> On Thu, Apr 30, 2009 at 08:33:09AM +0100, Alex Buell wrote:
>>> On Wed, 29 Apr 2009 22:27:46 -0400, I waved a wand and this message
>>> magically appears in front of Jeff Garzik:
>>>
>>>> As Tejun noted, try switching to AHCI mode in BIOS.
>>> But is there a way to switch modes without needing to go through the
>>> BIOS? Some laptops won't let you do that through BIOS.
>> The BIOS setting already is in AHCI mode, and not in "compatibility
>> mode".
>
> Thinking about this a bit more, I'll bet the problem is the BIOS
> setting is only affecting the primary SATA ports (which are being
> grabed by ahci) and not the SATA port in the Ultrabay slot (which is
> being picked up by either the ata_piix or piix driver). Sigh...

dmesg and lspci -vv output might be useful..
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


tytso at mit

Apr 30, 2009, 7:51 PM

Post #14 of 22 (2490 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

On Thu, Apr 30, 2009 at 07:51:28PM -0600, Robert Hancock wrote:
>> Thinking about this a bit more, I'll bet the problem is the BIOS
>> setting is only affecting the primary SATA ports (which are being
>> grabed by ahci) and not the SATA port in the Ultrabay slot (which is
>> being picked up by either the ata_piix or piix driver). Sigh...
>
> dmesg and lspci -vv output might be useful..

Here you go...
Attachments: dmesg (46.1 KB)
  lspci (12.3 KB)


hancockrwd at gmail

Apr 30, 2009, 9:21 PM

Post #15 of 22 (2475 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

Theodore Tso wrote:
> On Thu, Apr 30, 2009 at 07:51:28PM -0600, Robert Hancock wrote:
>>> Thinking about this a bit more, I'll bet the problem is the BIOS
>>> setting is only affecting the primary SATA ports (which are being
>>> grabed by ahci) and not the SATA port in the Ultrabay slot (which is
>>> being picked up by either the ata_piix or piix driver). Sigh...
>> dmesg and lspci -vv output might be useful..
>
> Here you go...

I'm suspecting that that Ultrabay slot might be using the PATA ports on
the chipset, with a PATA-SATA bridge chip or something. I haven't seen
an Intel chipset with some SATA ports using AHCI and some in PIIX mode
before, the ones I've seen with both had the PIIX mode driving PATA
ports. If it is indeed bridged through PATA on that laptop, there's no
way you're going to get any NCQ support on that slot.

I don't know why Lenovo would do that, as it would kind of cripple SATA
drives in that slot, but hardware people do some bizarre things sometimes..
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


willy at linux

May 1, 2009, 4:35 AM

Post #16 of 22 (2454 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

On Thu, Apr 30, 2009 at 10:21:08PM -0600, Robert Hancock wrote:
> I'm suspecting that that Ultrabay slot might be using the PATA ports on
> the chipset, with a PATA-SATA bridge chip or something. I haven't seen
> an Intel chipset with some SATA ports using AHCI and some in PIIX mode
> before, the ones I've seen with both had the PIIX mode driving PATA
> ports. If it is indeed bridged through PATA on that laptop, there's no
> way you're going to get any NCQ support on that slot.
>
> I don't know why Lenovo would do that, as it would kind of cripple SATA
> drives in that slot, but hardware people do some bizarre things
> sometimes..

I have to agree with Robert. If you look at the ich8 data sheet
(313056-003), the mobile version has 3 ATA ports and 1 IDE port "that
can be electrically isolated". See pages 41, 43, and 50-51. on page 41,
it says the IDE port has "Tri-state modes to enable swap bay".

So I don't blame Lenovo for hooking up the Ultrabay slot using the IDE
port. They were pretty much told to do it.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


tytso at mit

May 1, 2009, 6:14 AM

Post #17 of 22 (2467 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

On Fri, May 01, 2009 at 04:35:33AM -0700, Matthew Wilcox wrote:
> On Thu, Apr 30, 2009 at 10:21:08PM -0600, Robert Hancock wrote:
> > I'm suspecting that that Ultrabay slot might be using the PATA ports on
> > the chipset, with a PATA-SATA bridge chip or something. I haven't seen
> > an Intel chipset with some SATA ports using AHCI and some in PIIX mode
> > before, the ones I've seen with both had the PIIX mode driving PATA
> > ports. If it is indeed bridged through PATA on that laptop, there's no
> > way you're going to get any NCQ support on that slot.
> >
> > I don't know why Lenovo would do that, as it would kind of cripple SATA
> > drives in that slot, but hardware people do some bizarre things
> > sometimes..
>
> I have to agree with Robert. If you look at the ich8 data sheet
> (313056-003), the mobile version has 3 ATA ports and 1 IDE port "that
> can be electrically isolated". See pages 41, 43, and 50-51. on page 41,
> it says the IDE port has "Tri-state modes to enable swap bay".
>
> So I don't blame Lenovo for hooking up the Ultrabay slot using the IDE
> port. They were pretty much told to do it.

Gaah.... so basically a SATA device (the X25-M) is talking to a
SATA-PATA bridge chip, which is then talking the IDE port in the ICH8
chipset, which shows up as piix, which we're then pretending is SATA
at the OS level via the ata_piix driver. Did I get that right?
(Excuse me while I go find a barf bag....)

The sad thing is there doesn't seem to be a good reason to do that,
since SATA is designed to be hot-swapping, so it's not like they need
to use tri-state modes on the IDE port --- especially if said IDE is
fronted by a PATA-SATA bridge chip anyway...

Oh.... and I suspect I know why they did it; I'm guessing they wanted
to support PATA Ultrabay devices for backwards compatibility on the
X60, and perhaps they were running out of connector pins on the
docking station (the Ultrabay slot is on the X61's "media slice"), and
they didn't have enough wires to run both PATA and SATA interfaces to
the docking station, *and* they wanted to use the same docking station
for the X60 and X61 Thinkpads.

Ah, well. I hope it made sense to *someone* at Lenovo... It would be
interesting to see if they fixed this in the X200 or not.

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


mjg59 at srcf

May 1, 2009, 6:59 AM

Post #18 of 22 (2477 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

On Fri, May 01, 2009 at 09:14:59AM -0400, Theodore Tso wrote:

> Oh.... and I suspect I know why they did it; I'm guessing they wanted
> to support PATA Ultrabay devices for backwards compatibility on the
> X60, and perhaps they were running out of connector pins on the
> docking station (the Ultrabay slot is on the X61's "media slice"), and
> they didn't have enough wires to run both PATA and SATA interfaces to
> the docking station, *and* they wanted to use the same docking station
> for the X60 and X61 Thinkpads.

SATA ultrabays have a standard SATA connector, which is in the same
physical location as the PATA connector on the older bays - it's not
possible for a single bay to support both PATA and SATA devices. Bear in
mind that the usual use for one of these bays is for optical drives, and
SATA slimline drives have only started appearing recently.

--
Matthew Garrett | mjg59 [at] srcf
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


willy at linux

May 1, 2009, 7:09 AM

Post #19 of 22 (2487 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

On Fri, May 01, 2009 at 09:14:59AM -0400, Theodore Tso wrote:
> Gaah.... so basically a SATA device (the X25-M) is talking to a
> SATA-PATA bridge chip, which is then talking the IDE port in the ICH8
> chipset, which shows up as piix, which we're then pretending is SATA
> at the OS level via the ata_piix driver. Did I get that right?
> (Excuse me while I go find a barf bag....)

Well ... libata doesn't pretend that everything is SATA; it uses
taskfiles which work for both PATA and SATA. Other than that, I think
you've got it right.

> Oh.... and I suspect I know why they did it; I'm guessing they wanted
> to support PATA Ultrabay devices for backwards compatibility on the
> X60, and perhaps they were running out of connector pins on the
> docking station (the Ultrabay slot is on the X61's "media slice"), and
> they didn't have enough wires to run both PATA and SATA interfaces to
> the docking station, *and* they wanted to use the same docking station
> for the X60 and X61 Thinkpads.
>
> Ah, well. I hope it made sense to *someone* at Lenovo... It would be
> interesting to see if they fixed this in the X200 or not.

Backwards compatibility is a pain. It looks like from this lspci:
https://bugzilla.redhat.com/attachment.cgi?id=317327 that the X200 uses
ICH9M which doesn't appear to have an IDE port on the chip (document
316972-004). So it must be fixed in the X200 ... unless they've put in
a SATA-PATA bridge in the base, and a PATA-SATA bridge in the ultrabay
...

Even then, it might work. I don't know enough about the PATA protocol
to say.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


tj at kernel

May 2, 2009, 7:07 PM

Post #20 of 22 (2452 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

Robert Hancock wrote:
> Matthew Garrett wrote:
>> On Thu, Apr 30, 2009 at 08:35:08AM -0700, Matthew Wilcox wrote:
>>> On Thu, Apr 30, 2009 at 02:47:02PM +0100, Alan Cox wrote:
>>>>> So, at the point of driver load, there just isn't much we can do about
>>>>> the missing ABAR. It's sad. Dunno why some laptop manufacturers
>>>>> still program the thing into piix mode. :-(
>>>> Forcing out of PIIX mode would need to go into the PCI quirks and be a
>>>> boot option not a module one - at that point its doable as a header
>>>> quirk.
>>> I think Matthew Garrett already has code to do this.
>>
>> Yeah, but some testers reported that it broke after using it for a
>> while. The most recent version I have is this:
>
> We should likely have something like this in the kernel, but it should
> default to off. For one thing, some machines seem to have BIOS code that
> tries to poke the controller for some reason during suspend/shutdown
> events, etc. which would likely go nuts if the controller was
> unexpectedly in AHCI mode..

Maybe, I don't know. Matthew's patch seems clean enough for upstream
inclusion but I'm always a bit put off about including some feature
which should default to off. It never gets used and tested a lot thus
ending up broken on many configurations further fueling the vicious
cycle. After the initial interested users passed, it just becomes
dead weight none uses which often is quite annoying when trying to
change code around it because nobody at that point knows on which
configurations it worked and even whether it not working is a
regression or expected behavior.

Given the wide variety of ich motherboards out in the wild and all
their different BIOS revisions and the fact that NCQ or not doesn't
make whole lot of difference for most desktop workload, I think why
bother. A few years back some vendors seemed to use it for product
differentiation but nowadays it's just silly to disable ahci for that
purpose.

Thanks.

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


hancockrwd at gmail

May 3, 2009, 1:50 PM

Post #21 of 22 (2448 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

Tejun Heo wrote:
> Robert Hancock wrote:
>> Matthew Garrett wrote:
>>> On Thu, Apr 30, 2009 at 08:35:08AM -0700, Matthew Wilcox wrote:
>>>> On Thu, Apr 30, 2009 at 02:47:02PM +0100, Alan Cox wrote:
>>>>>> So, at the point of driver load, there just isn't much we can do about
>>>>>> the missing ABAR. It's sad. Dunno why some laptop manufacturers
>>>>>> still program the thing into piix mode. :-(
>>>>> Forcing out of PIIX mode would need to go into the PCI quirks and be a
>>>>> boot option not a module one - at that point its doable as a header
>>>>> quirk.
>>>> I think Matthew Garrett already has code to do this.
>>> Yeah, but some testers reported that it broke after using it for a
>>> while. The most recent version I have is this:
>> We should likely have something like this in the kernel, but it should
>> default to off. For one thing, some machines seem to have BIOS code that
>> tries to poke the controller for some reason during suspend/shutdown
>> events, etc. which would likely go nuts if the controller was
>> unexpectedly in AHCI mode..
>
> Maybe, I don't know. Matthew's patch seems clean enough for upstream
> inclusion but I'm always a bit put off about including some feature
> which should default to off. It never gets used and tested a lot thus
> ending up broken on many configurations further fueling the vicious
> cycle. After the initial interested users passed, it just becomes
> dead weight none uses which often is quite annoying when trying to
> change code around it because nobody at that point knows on which
> configurations it worked and even whether it not working is a
> regression or expected behavior.

Well, it's a potential concern, but it's simple enough I doubt it would
really result in much of a burden. Having the force-AHCI option in place
would allow those interested to try it more easily and see just how
widely this can be done without breaking things.. It all really depends
on the BIOS implementation.

>
> Given the wide variety of ich motherboards out in the wild and all
> their different BIOS revisions and the fact that NCQ or not doesn't
> make whole lot of difference for most desktop workload, I think why
> bother. A few years back some vendors seemed to use it for product
> differentiation but nowadays it's just silly to disable ahci for that
> purpose.

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


jason at acm

May 3, 2009, 3:35 PM

Post #22 of 22 (2446 views)
Permalink
Re: No NCQ support on X61s Ultrabay? (Intel ICH8 SATA controller question) [In reply to]

And Robert Hancock writes:
> Well, it's a potential concern, but it's simple enough I doubt it
> would really result in much of a burden.

My D620 is one of those that corrupted the file system with the
force-AHCI patch. If I hadn't applied the patch externally, I might
have guessed it was the file system code... Given all the churn in the
fs code right now, is it wise to add another *known* corruption vector?

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

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.