linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: ide <linux-ide@vger.kernel.org>, meissner@novell.com
Subject: [PATCH REDIFFED 4/4 #upstream] ahci: filter FPDMA non-zero offset enable for Aspire 3810T
Date: Wed, 16 Sep 2009 04:18:03 +0900	[thread overview]
Message-ID: <4AAFE86B.5070100@kernel.org> (raw)
In-Reply-To: <4AA702E7.7030905@pobox.com>

Curiously, Aspire 3810T issues many SATA feature enable commands via
_GTF, of which one is invalid and another is not supported by the
drive.  In the process, it also enables FPDMA non-zero offset.
However, the feature also needs to be supported and enabled from the
controller and it's wrong to enable it from _GTF unless the controller
can do it by default.

Currently, this ends up enabling FPDMA non-zero offset only on the
drive side leading to NCQ command failures and eventual disabling of
NCQ.  This patch makes libata filter out FPDMA non-zero offset enable
for the machine.

This was reported by Marcus Meissner in bnc#522790.

  https://bugzilla.novell.com/show_bug.cgi?id=522790

Reported-by: Marcus Meissner <meissner@novell.com>
---
This concludes the four patches to work around a device configuration
issue caused by strange _GTF.  This looks a bit pervasive for
#upstream-fixes but the changes should only affect the problematic
machine and be fairly safe.

Thanks.

 drivers/ata/ahci.c |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

Index: ata/drivers/ata/ahci.c
===================================================================
--- ata.orig/drivers/ata/ahci.c
+++ ata/drivers/ata/ahci.c
@@ -2858,6 +2858,50 @@ static bool ahci_broken_online(struct pc
 	return pdev->bus->number == (val >> 8) && pdev->devfn == (val & 0xff);
 }

+static void ahci_gtf_filter_workaround(struct ata_host *host)
+{
+	static const struct dmi_system_id sysids[] = {
+		/*
+		 * Aspire 3810T issues a bunch of SATA enable commands
+		 * via _GTF including an invalid one and one which is
+		 * rejected by the device.  Among the successful ones
+		 * is FPDMA non-zero offset enable which when enabled
+		 * only on the drive side leads to NCQ command
+		 * failures.  Filter it out.
+		 */
+		{
+			.ident = "Aspire 3810T",
+			.matches = {
+				DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+				DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3810T"),
+			},
+			.driver_data = (void *)ATA_ACPI_FILTER_FPDMA_OFFSET,
+		},
+		{ }
+	};
+	const struct dmi_system_id *dmi = dmi_first_match(sysids);
+	unsigned int filter;
+	int i;
+
+	if (!dmi)
+		return;
+
+	filter = (unsigned long)dmi->driver_data;
+	dev_printk(KERN_INFO, host->dev,
+		   "applying extra ACPI _GTF filter 0x%x for %s\n",
+		   filter, dmi->ident);
+
+	for (i = 0; i < host->n_ports; i++) {
+		struct ata_port *ap = host->ports[i];
+		struct ata_link *link;
+		struct ata_device *dev;
+
+		ata_for_each_link(link, ap, EDGE)
+			ata_for_each_dev(dev, link, ALL)
+				dev->gtf_filter |= filter;
+	}
+}
+
 static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	static int printed_version;
@@ -3023,6 +3067,9 @@ static int ahci_init_one(struct pci_dev
 	/* apply workaround for ASUS P5W DH Deluxe mainboard */
 	ahci_p5wdh_workaround(host);

+	/* apply gtf filter quirk */
+	ahci_gtf_filter_workaround(host);
+
 	/* initialize adapter */
 	rc = ahci_configure_dma_masks(pdev, hpriv->cap & HOST_CAP_64);
 	if (rc)

      parent reply	other threads:[~2009-09-15 19:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-04  8:52 [PATCH 1/4 #upstream-fixes] libata: cosmetic updates Tejun Heo
2009-08-04  8:52 ` [PATCH 2/4 #upstream-fixes] libata: implement more acpi filtering options Tejun Heo
2009-08-04  8:53   ` [PATCH 3/4 #upstream-fixes] libata: make gtf_filter per-dev Tejun Heo
2009-08-04  8:57     ` [PATCH 4/4 #upstream-fixes] ahci: filter FPDMA non-zero offset enable for Aspire 3810T Tejun Heo
2009-09-09  1:20 ` [PATCH 1/4 #upstream-fixes] libata: cosmetic updates Jeff Garzik
2009-09-15 19:16   ` [PATCH REDIFFED 1/4 #upstream] " Tejun Heo
2009-10-06  4:25     ` Jeff Garzik
2009-09-15 19:17   ` [PATCH REDIFFED 2/4 #upstream] libata: implement more acpi filtering options Tejun Heo
2009-10-06  4:56     ` Jeff Garzik
2009-09-15 19:17   ` [PATCH REDIFFED 3/4 #upstream] libata: make gtf_filter per-dev Tejun Heo
2009-09-15 19:18   ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AAFE86B.5070100@kernel.org \
    --to=tj@kernel.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=meissner@novell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).