summaryrefslogtreecommitdiffstats
path: root/drivers/dma/ioat.c
diff options
context:
space:
mode:
authorShannon Nelson <shannon.nelson@intel.com>2007-10-16 01:27:42 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 09:43:09 -0700
commit2ed6dc34f9ed39bb8e4c81ea1056f0ba56315841 (patch)
treee3f6ca7961f9c4e34453d06e584c0bc98ec630d7 /drivers/dma/ioat.c
parent7589670f37736bcc119ebfbd69aafea6d585d1d4 (diff)
downloadop-kernel-dev-2ed6dc34f9ed39bb8e4c81ea1056f0ba56315841.zip
op-kernel-dev-2ed6dc34f9ed39bb8e4c81ea1056f0ba56315841.tar.gz
I/OAT: Add DCA services
Add code to connect to the DCA driver and provide cpu tags for use by drivers that would like to use Direct Cache Access hints. [Adrian Bunk] Several Kconfig cleanup items [Andrew Morten, Chris Leech] Fix for using cpu_physical_id() even when built for uni-processor Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/dma/ioat.c')
-rw-r--r--drivers/dma/ioat.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/dma/ioat.c b/drivers/dma/ioat.c
index ae5817b..f7276bf 100644
--- a/drivers/dma/ioat.c
+++ b/drivers/dma/ioat.c
@@ -1,6 +1,6 @@
/*
* Intel I/OAT DMA Linux driver
- * Copyright(c) 2004 - 2007 Intel Corporation.
+ * Copyright(c) 2007 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -29,6 +29,7 @@
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
+#include <linux/dca.h>
#include "ioatdma.h"
#include "ioatdma_registers.h"
#include "ioatdma_hw.h"
@@ -49,6 +50,7 @@ struct ioat_device {
struct pci_dev *pdev;
void __iomem *iobase;
struct ioatdma_device *dma;
+ struct dca_provider *dca;
};
static int __devinit ioat_probe(struct pci_dev *pdev,
@@ -57,6 +59,10 @@ static int __devinit ioat_probe(struct pci_dev *pdev,
static void __devexit ioat_remove(struct pci_dev *pdev);
#endif
+static int ioat_dca_enabled = 1;
+module_param(ioat_dca_enabled, int, 0644);
+MODULE_PARM_DESC(ioat_dca_enabled, "control support of dca service (default: 1)");
+
static int ioat_setup_functionality(struct pci_dev *pdev, void __iomem *iobase)
{
struct ioat_device *device = pci_get_drvdata(pdev);
@@ -67,6 +73,8 @@ static int ioat_setup_functionality(struct pci_dev *pdev, void __iomem *iobase)
switch (version) {
case IOAT_VER_1_2:
device->dma = ioat_dma_probe(pdev, iobase);
+ if (ioat_dca_enabled)
+ device->dca = ioat_dca_init(pdev, iobase);
break;
default:
err = -ENODEV;
@@ -83,6 +91,13 @@ static void ioat_shutdown_functionality(struct pci_dev *pdev)
ioat_dma_remove(device->dma);
device->dma = NULL;
}
+
+ if (device->dca) {
+ unregister_dca_provider(device->dca);
+ free_dca_provider(device->dca);
+ device->dca = NULL;
+ }
+
}
static struct pci_driver ioat_pci_drv = {
OpenPOWER on IntegriCloud