All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maciej Sosnowski <maciej.sosnowski@intel.com>
To: dan.j.williams@intel.com
Cc: snakebyte@gmx.de, shannon.nelson@intel.com,
	jeffrey.t.krisher@intel.com, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: [PATCH 1/7] I/OAT: add verification for proper APICID_TAG_MAP setting by BIOS
Date: Thu, 26 Feb 2009 11:04:23 +0100	[thread overview]
Message-ID: <20090226100408.3615.48145.stgit@linux.site> (raw)
In-Reply-To: <20090226100327.3615.21419.stgit@linux.site>

BIOS versions for systems with I/OAT ver.2 have been found
which fail to program APICID_TAG_MAP for DCA.
The ioatdma driver should recognize incorrectly set APICID_TAG_MAP
and disable DCA in that case.

Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Jeff Kirsher <jeffrey.t.krisher@intel.com>
---

 drivers/dma/ioat_dca.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/dma/ioat_dca.c b/drivers/dma/ioat_dca.c
index 6cf622d..78705ca 100644
--- a/drivers/dma/ioat_dca.c
+++ b/drivers/dma/ioat_dca.c
@@ -49,6 +49,23 @@ #define DCA3_TAG_MAP_LITERAL_VAL 0x1
 
 #define DCA_TAG_MAP_MASK 0xDF
 
+/* expected tag map bytes for I/OAT ver.2 */
+#define DCA2_TAG_MAP_BYTE0 0x80
+#define DCA2_TAG_MAP_BYTE1 0x0
+#define DCA2_TAG_MAP_BYTE2 0x81
+#define DCA2_TAG_MAP_BYTE3 0x82
+#define DCA2_TAG_MAP_BYTE4 0x82
+
+/* verify if tag map matches expected values */
+static inline int dca2_tag_map_valid(u8 *tag_map)
+{
+	return ((tag_map[0] == DCA2_TAG_MAP_BYTE0) &&
+		(tag_map[1] == DCA2_TAG_MAP_BYTE1) &&
+		(tag_map[2] == DCA2_TAG_MAP_BYTE2) &&
+		(tag_map[3] == DCA2_TAG_MAP_BYTE3) &&
+		(tag_map[4] == DCA2_TAG_MAP_BYTE4));
+}
+
 /*
  * "Legacy" DCA systems do not implement the DCA register set in the
  * I/OAT device.  Software needs direct support for their tag mappings.
@@ -452,6 +469,13 @@ struct dca_provider *ioat2_dca_init(stru
 			ioatdca->tag_map[i] = 0;
 	}
 
+	if (!dca2_tag_map_valid(ioatdca->tag_map)) {
+		dev_err(&pdev->dev, "APICID_TAG_MAP set incorrectly by BIOS, "
+			"disabling DCA\n");
+		free_dca_provider(dca);
+		return NULL;
+	}
+
 	err = register_dca_provider(dca, &pdev->dev);
 	if (err) {
 		free_dca_provider(dca);


  reply	other threads:[~2009-02-26 10:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-26 10:04 [PATCH 0/7] I/OAT update Maciej Sosnowski
2009-02-26 10:04 ` Maciej Sosnowski [this message]
2009-02-26 10:04 ` [PATCH 2/7] I/OAT: do not set DCACTRL_CMPL_WRITE_ENABLE for I/OAT ver.3 Maciej Sosnowski
2009-02-26 10:04 ` [PATCH 3/7] I/OAT: fail initialization on zero channels detection Maciej Sosnowski
2009-02-26 10:05 ` [PATCH 4/7] I/OAT: cancel watchdog before dma remove Maciej Sosnowski
2009-02-26 10:05 ` [PATCH 5/7] I/OAT: set tcp_dma_copybreak to 256k for I/OAT ver.3 Maciej Sosnowski
2009-02-26 10:05 ` [PATCH 6/7] I/OAT: list usage cleanup Maciej Sosnowski
2009-02-26 10:05 ` [PATCH 7/7] I/OAT: update driver version and copyright dates Maciej Sosnowski
2009-02-26 10:31 ` [PATCH 0/7] I/OAT update Jeff Kirsher
2009-02-26 10:48   ` David Miller

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=20090226100408.3615.48145.stgit@linux.site \
    --to=maciej.sosnowski@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=jeffrey.t.krisher@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shannon.nelson@intel.com \
    --cc=snakebyte@gmx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.