Patchwork [RFC,#upstream-fixes] libata: don't use 32bit PIO for small transfers

login
register
mail settings
Submitter tom.leiming@gmail.com
Date Sept. 14, 2011, 7:44 a.m.
Message ID <CACVXFVO0LzxSj=7Q054gcK5x9fDuNniE0GteKmpYNOXWAc-0gw@mail.gmail.com>
Download mbox | patch
Permalink /patch/114587/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

tom.leiming@gmail.com - Sept. 14, 2011, 7:44 a.m.
Hi Tejun and Alan,

Thanks for your spending time on the bug.

On Tue, Sep 6, 2011 at 5:49 PM, Alan Cox <alan@linux.intel.com> wrote:

>
> So NACK.
>
> Add a piix_sata_data_xfer32_maybe() function to the ata_piix driver
> specifically for this chipset.

Could you accept the quirk patch below to make these controllers working
at least now?



thanks,
Alan Cox - Sept. 14, 2011, 6:51 p.m.
On Wed, 14 Sep 2011 15:44:43 +0800
Ming Lei <tom.leiming@gmail.com> wrote:

> Hi Tejun and Alan,
> 
> Thanks for your spending time on the bug.
> 
> On Tue, Sep 6, 2011 at 5:49 PM, Alan Cox <alan@linux.intel.com> wrote:
> 
> >
> > So NACK.
> >
> > Add a piix_sata_data_xfer32_maybe() function to the ata_piix driver
> > specifically for this chipset.
> 
> Could you accept the quirk patch below to make these controllers
> working at least now?

To me that looks like the right fix. It affects the minimum amount of
hardware. It uses the standard operations in full and it documents
clearly what it is doing.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 43107e9..eb7ea56 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -341,11 +341,12 @@  static struct ata_port_operations piix_sata_ops = {
 };

 static struct ata_port_operations piix_pata_ops = {
-	.inherits		= &piix_sata_ops,
+	.inherits		= &ata_bmdma32_port_ops,
 	.cable_detect		= ata_cable_40wire,
 	.set_piomode		= piix_set_piomode,
 	.set_dmamode		= piix_set_dmamode,
 	.prereset		= piix_pata_prereset,
+	.sff_irq_check		= piix_irq_check,
 };

 static struct ata_port_operations piix_vmw_ops = {
@@ -1585,6 +1586,15 @@  static int __devinit piix_init_one(struct pci_dev *pdev,
 				"on poweroff and hibernation\n");
 	}

+	/*
+	 * Sandybridge chipset H61/P67/H67 have broken 32 mode up to now
+	 * see https://bugzilla.kernel.org/show_bug.cgi?id=40592
+	 */
+	if (pdev->vendor == PCI_VENDOR_ID_INTEL && pdev->device == 0x1c00)
+		piix_sata_ops.inherits = &ata_bmdma_port_ops;
+	else
+		piix_sata_ops.inherits = &ata_bmdma32_port_ops;
+
 	port_info[0] = piix_port_info[ent->driver_data];
 	port_info[1] = piix_port_info[ent->driver_data];