diff options
author | Shannon Nelson <shannon.nelson@intel.com> | 2007-10-16 04:27:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:09 -0400 |
commit | 2ed6dc34f9ed39bb8e4c81ea1056f0ba56315841 (patch) | |
tree | e3f6ca7961f9c4e34453d06e584c0bc98ec630d7 /drivers/dma/ioat.c | |
parent | 7589670f37736bcc119ebfbd69aafea6d585d1d4 (diff) |
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.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/dma/ioat.c b/drivers/dma/ioat.c index ae5817bfc015..f7276bf2fe7e 100644 --- a/drivers/dma/ioat.c +++ b/drivers/dma/ioat.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Intel I/OAT DMA Linux driver | 2 | * Intel I/OAT DMA Linux driver |
3 | * Copyright(c) 2004 - 2007 Intel Corporation. | 3 | * Copyright(c) 2007 Intel Corporation. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms and conditions of the GNU General Public License, | 6 | * under the terms and conditions of the GNU General Public License, |
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <linux/pci.h> | 30 | #include <linux/pci.h> |
31 | #include <linux/interrupt.h> | 31 | #include <linux/interrupt.h> |
32 | #include <linux/dca.h> | ||
32 | #include "ioatdma.h" | 33 | #include "ioatdma.h" |
33 | #include "ioatdma_registers.h" | 34 | #include "ioatdma_registers.h" |
34 | #include "ioatdma_hw.h" | 35 | #include "ioatdma_hw.h" |
@@ -49,6 +50,7 @@ struct ioat_device { | |||
49 | struct pci_dev *pdev; | 50 | struct pci_dev *pdev; |
50 | void __iomem *iobase; | 51 | void __iomem *iobase; |
51 | struct ioatdma_device *dma; | 52 | struct ioatdma_device *dma; |
53 | struct dca_provider *dca; | ||
52 | }; | 54 | }; |
53 | 55 | ||
54 | static int __devinit ioat_probe(struct pci_dev *pdev, | 56 | static int __devinit ioat_probe(struct pci_dev *pdev, |
@@ -57,6 +59,10 @@ static int __devinit ioat_probe(struct pci_dev *pdev, | |||
57 | static void __devexit ioat_remove(struct pci_dev *pdev); | 59 | static void __devexit ioat_remove(struct pci_dev *pdev); |
58 | #endif | 60 | #endif |
59 | 61 | ||
62 | static int ioat_dca_enabled = 1; | ||
63 | module_param(ioat_dca_enabled, int, 0644); | ||
64 | MODULE_PARM_DESC(ioat_dca_enabled, "control support of dca service (default: 1)"); | ||
65 | |||
60 | static int ioat_setup_functionality(struct pci_dev *pdev, void __iomem *iobase) | 66 | static int ioat_setup_functionality(struct pci_dev *pdev, void __iomem *iobase) |
61 | { | 67 | { |
62 | struct ioat_device *device = pci_get_drvdata(pdev); | 68 | struct ioat_device *device = pci_get_drvdata(pdev); |
@@ -67,6 +73,8 @@ static int ioat_setup_functionality(struct pci_dev *pdev, void __iomem *iobase) | |||
67 | switch (version) { | 73 | switch (version) { |
68 | case IOAT_VER_1_2: | 74 | case IOAT_VER_1_2: |
69 | device->dma = ioat_dma_probe(pdev, iobase); | 75 | device->dma = ioat_dma_probe(pdev, iobase); |
76 | if (ioat_dca_enabled) | ||
77 | device->dca = ioat_dca_init(pdev, iobase); | ||
70 | break; | 78 | break; |
71 | default: | 79 | default: |
72 | err = -ENODEV; | 80 | err = -ENODEV; |
@@ -83,6 +91,13 @@ static void ioat_shutdown_functionality(struct pci_dev *pdev) | |||
83 | ioat_dma_remove(device->dma); | 91 | ioat_dma_remove(device->dma); |
84 | device->dma = NULL; | 92 | device->dma = NULL; |
85 | } | 93 | } |
94 | |||
95 | if (device->dca) { | ||
96 | unregister_dca_provider(device->dca); | ||
97 | free_dca_provider(device->dca); | ||
98 | device->dca = NULL; | ||
99 | } | ||
100 | |||
86 | } | 101 | } |
87 | 102 | ||
88 | static struct pci_driver ioat_pci_drv = { | 103 | static struct pci_driver ioat_pci_drv = { |