linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Lord <liml@rtr.ca>
To: Jeff Garzik <jgarzik@pobox.com>,
	IDE/ATA development list <linux-ide@vger.kernel.org>
Cc: Saeed Bishara <saeed@marvell.com>
Subject: [PATCH 04/07] sata_mv: workaround errata PCI#7
Date: Mon, 06 Apr 2009 15:24:14 -0400	[thread overview]
Message-ID: <49DA56DE.3000200@rtr.ca> (raw)
In-Reply-To: <49DA566D.9040501@rtr.ca>

Workaround for 60x1-B2 errata PCI#7.

Write-combining may be unreliable when chip operates in PCI-X mode,
so disable write-combining when in PCI-X mode.

Also, update the errata comments at the top of sata_mv,
and include a note about errata PCI#11.

Signed-off-by: Mark Lord <mlord@pobox.com>
--

Expanding the original 3-part patch series to 7-parts now.


--- old/drivers/ata/sata_mv.c	2009-04-06 12:23:32.000000000 -0400
+++ new/drivers/ata/sata_mv.c	2009-04-06 13:24:28.000000000 -0400
@@ -28,10 +28,6 @@
 /*
  * sata_mv TODO list:
  *
- * --> More errata workarounds for PCI-X.
- *
- * --> Complete a full errata audit for all chipsets to identify others.
- *
  * --> Develop a low-power-consumption strategy, and implement it.
  *
  * --> Add sysfs attributes for per-chip / per-HC IRQ coalescing thresholds.
@@ -44,6 +40,15 @@
  *       connect two SATA ports.
  */
 
+/*
+ * 80x1-B2 errata PCI#11:
+ *
+ * Users of the 6041/6081 Rev.B2 chips (current is C0)
+ * should be careful to insert those cards only onto PCI-X bus #0,
+ * and only in device slots 0..7, not higher.  The chips may not
+ * work correctly otherwise  (note: this is a pretty rare condition).
+ */
+
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -181,6 +186,7 @@
 	/* PCI interface registers */
 
 	PCI_COMMAND_OFS		= 0xc00,
+	PCI_COMMAND_MWRCOM	= (1 << 4),	/* PCI Master Write Combining */
 	PCI_COMMAND_MRDTRIG	= (1 << 7),	/* PCI Master Read Trigger */
 
 	PCI_MAIN_CMD_STS_OFS	= 0xd30,
@@ -3527,6 +3533,18 @@
 	return 1; /* okay */
 }
 
+static void mv_60x1b2_errata_pci7(struct ata_host *host)
+{
+	struct mv_host_priv *hpriv = host->private_data;
+	void __iomem *mmio = hpriv->base;
+
+	/* workaround for 60x1-B2 errata PCI#7 */
+	if (mv_in_pcix_mode(host)) {
+		u32 reg = readl(mmio + PCI_COMMAND_OFS);
+		writelfl(reg & ~PCI_COMMAND_MWRCOM, mmio + PCI_COMMAND_OFS);
+	}
+}
+
 static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
 {
 	struct pci_dev *pdev = to_pci_dev(host->dev);
@@ -3580,6 +3598,7 @@
 
 		switch (pdev->revision) {
 		case 0x7:
+			mv_60x1b2_errata_pci7(host);
 			hp_flags |= MV_HP_ERRATA_60X1B2;
 			break;
 		case 0x9:

  reply	other threads:[~2009-04-06 19:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-06 16:29 [PATCH 01/03] sata_mv: revert SoC irq breakage Mark Lord
2009-04-06 16:30 ` [PATCH 02/03] sata_mv: fix irq mask races Mark Lord
2009-04-06 16:31   ` [PATCH 03/03] sata_mv: replace 0x1f with ATA_PIO4 Mark Lord
2009-04-06 19:22     ` [PATCH 03/03] sata_mv: replace 0x1f with ATA_PIO4 (v2) Mark Lord
2009-04-06 19:24       ` Mark Lord [this message]
2009-04-06 19:24         ` [PATCH 05/07] sata_mv: workaround errata SATA#26 Mark Lord
2009-04-06 19:25           ` [PATCH 06/07] sata_mv: cosmetic renames Mark Lord
2009-04-06 19:26             ` [PATCH 07/07] sata_mv: workaround errata SATA#13 Mark Lord
2009-04-06 20:43               ` [PATCH 08/08] sata_mv: shorten register names Mark Lord
2009-04-06 19:51             ` [PATCH 06/07] sata_mv: cosmetic renames Jeff Garzik
2009-04-06 20:12               ` Mark Lord
2009-04-07  0:16 ` [PATCH 01/03] sata_mv: revert SoC irq breakage Jeff Garzik

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=49DA56DE.3000200@rtr.ca \
    --to=liml@rtr.ca \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=saeed@marvell.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).