Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132059
b: refs/heads/master
c: 49bc463
h: refs/heads/master
i:
  132057: fa63163
  132055: 906f884
v: v3
  • Loading branch information
Maciej Sosnowski authored and Dan Williams committed Mar 4, 2009
1 parent ed23b88 commit 6a2f295
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1d93e52eb48df986a3c4d5ad8a520bf1f6837367
refs/heads/master: 49bc46360d68156ce82b2b1a12badb80078453a0
24 changes: 24 additions & 0 deletions trunk/drivers/dma/ioat_dca.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,23 @@

#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.
Expand Down Expand Up @@ -452,6 +469,13 @@ struct dca_provider *ioat2_dca_init(struct pci_dev *pdev, void __iomem *iobase)
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);
Expand Down

0 comments on commit 6a2f295

Please sign in to comment.