aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/plat-orion/common.c18
-rw-r--r--drivers/dma/mv_xor.c15
-rw-r--r--drivers/dma/mv_xor.h1
-rw-r--r--include/linux/platform_data/dma-mv_xor.h1
4 files changed, 9 insertions, 26 deletions
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index 09d836060bf4..2d4b6414609f 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -625,14 +625,7 @@ static struct resource orion_xor0_shared_resources[] = {
625 }, 625 },
626}; 626};
627 627
628static struct mv_xor_channel_data orion_xor0_channels_data[2] = { 628static struct mv_xor_channel_data orion_xor0_channels_data[2];
629 {
630 .pool_size = PAGE_SIZE,
631 },
632 {
633 .pool_size = PAGE_SIZE,
634 },
635};
636 629
637static struct mv_xor_platform_data orion_xor0_pdata = { 630static struct mv_xor_platform_data orion_xor0_pdata = {
638 .channels = orion_xor0_channels_data, 631 .channels = orion_xor0_channels_data,
@@ -698,14 +691,7 @@ static struct resource orion_xor1_shared_resources[] = {
698 }, 691 },
699}; 692};
700 693
701static struct mv_xor_channel_data orion_xor1_channels_data[2] = { 694static struct mv_xor_channel_data orion_xor1_channels_data[2];
702 {
703 .pool_size = PAGE_SIZE,
704 },
705 {
706 .pool_size = PAGE_SIZE,
707 },
708};
709 695
710static struct mv_xor_platform_data orion_xor1_pdata = { 696static struct mv_xor_platform_data orion_xor1_pdata = {
711 .channels = orion_xor1_channels_data, 697 .channels = orion_xor1_channels_data,
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index fc983bf38438..ec741b4607e2 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -603,7 +603,7 @@ static int mv_xor_alloc_chan_resources(struct dma_chan *chan)
603 int idx; 603 int idx;
604 struct mv_xor_chan *mv_chan = to_mv_xor_chan(chan); 604 struct mv_xor_chan *mv_chan = to_mv_xor_chan(chan);
605 struct mv_xor_desc_slot *slot = NULL; 605 struct mv_xor_desc_slot *slot = NULL;
606 int num_descs_in_pool = mv_chan->pool_size/MV_XOR_SLOT_SIZE; 606 int num_descs_in_pool = MV_XOR_POOL_SIZE/MV_XOR_SLOT_SIZE;
607 607
608 /* Allocate descriptor slots */ 608 /* Allocate descriptor slots */
609 idx = mv_chan->slots_allocated; 609 idx = mv_chan->slots_allocated;
@@ -1074,7 +1074,7 @@ static int mv_xor_channel_remove(struct mv_xor_chan *mv_chan)
1074 1074
1075 dma_async_device_unregister(&mv_chan->dmadev); 1075 dma_async_device_unregister(&mv_chan->dmadev);
1076 1076
1077 dma_free_coherent(dev, mv_chan->pool_size, 1077 dma_free_coherent(dev, MV_XOR_POOL_SIZE,
1078 mv_chan->dma_desc_pool_virt, mv_chan->dma_desc_pool); 1078 mv_chan->dma_desc_pool_virt, mv_chan->dma_desc_pool);
1079 1079
1080 list_for_each_entry_safe(chan, _chan, &mv_chan->dmadev.channels, 1080 list_for_each_entry_safe(chan, _chan, &mv_chan->dmadev.channels,
@@ -1088,8 +1088,7 @@ static int mv_xor_channel_remove(struct mv_xor_chan *mv_chan)
1088static struct mv_xor_chan * 1088static struct mv_xor_chan *
1089mv_xor_channel_add(struct mv_xor_device *xordev, 1089mv_xor_channel_add(struct mv_xor_device *xordev,
1090 struct platform_device *pdev, 1090 struct platform_device *pdev,
1091 int idx, dma_cap_mask_t cap_mask, 1091 int idx, dma_cap_mask_t cap_mask, int irq)
1092 size_t pool_size, int irq)
1093{ 1092{
1094 int ret = 0; 1093 int ret = 0;
1095 struct mv_xor_chan *mv_chan; 1094 struct mv_xor_chan *mv_chan;
@@ -1109,9 +1108,8 @@ mv_xor_channel_add(struct mv_xor_device *xordev,
1109 * note: writecombine gives slightly better performance, but 1108 * note: writecombine gives slightly better performance, but
1110 * requires that we explicitly flush the writes 1109 * requires that we explicitly flush the writes
1111 */ 1110 */
1112 mv_chan->pool_size = pool_size;
1113 mv_chan->dma_desc_pool_virt = 1111 mv_chan->dma_desc_pool_virt =
1114 dma_alloc_writecombine(&pdev->dev, mv_chan->pool_size, 1112 dma_alloc_writecombine(&pdev->dev, MV_XOR_POOL_SIZE,
1115 &mv_chan->dma_desc_pool, GFP_KERNEL); 1113 &mv_chan->dma_desc_pool, GFP_KERNEL);
1116 if (!mv_chan->dma_desc_pool_virt) 1114 if (!mv_chan->dma_desc_pool_virt)
1117 return ERR_PTR(-ENOMEM); 1115 return ERR_PTR(-ENOMEM);
@@ -1193,7 +1191,7 @@ mv_xor_channel_add(struct mv_xor_device *xordev,
1193 return mv_chan; 1191 return mv_chan;
1194 1192
1195 err_free_dma: 1193 err_free_dma:
1196 dma_free_coherent(&pdev->dev, pool_size, 1194 dma_free_coherent(&pdev->dev, MV_XOR_POOL_SIZE,
1197 mv_chan->dma_desc_pool_virt, mv_chan->dma_desc_pool); 1195 mv_chan->dma_desc_pool_virt, mv_chan->dma_desc_pool);
1198 return ERR_PTR(ret); 1196 return ERR_PTR(ret);
1199} 1197}
@@ -1296,8 +1294,7 @@ static int mv_xor_probe(struct platform_device *pdev)
1296 1294
1297 xordev->channels[i] = 1295 xordev->channels[i] =
1298 mv_xor_channel_add(xordev, pdev, i, 1296 mv_xor_channel_add(xordev, pdev, i,
1299 cd->cap_mask, 1297 cd->cap_mask, irq);
1300 cd->pool_size, irq);
1301 if (IS_ERR(xordev->channels[i])) { 1298 if (IS_ERR(xordev->channels[i])) {
1302 ret = PTR_ERR(xordev->channels[i]); 1299 ret = PTR_ERR(xordev->channels[i]);
1303 goto err_channel_add; 1300 goto err_channel_add;
diff --git a/drivers/dma/mv_xor.h b/drivers/dma/mv_xor.h
index dab9f30e564a..698b4487b348 100644
--- a/drivers/dma/mv_xor.h
+++ b/drivers/dma/mv_xor.h
@@ -24,6 +24,7 @@
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25 25
26#define USE_TIMER 26#define USE_TIMER
27#define MV_XOR_POOL_SIZE PAGE_SIZE
27#define MV_XOR_SLOT_SIZE 64 28#define MV_XOR_SLOT_SIZE 64
28#define MV_XOR_THRESHOLD 1 29#define MV_XOR_THRESHOLD 1
29#define MV_XOR_MAX_CHANNELS 2 30#define MV_XOR_MAX_CHANNELS 2
diff --git a/include/linux/platform_data/dma-mv_xor.h b/include/linux/platform_data/dma-mv_xor.h
index b18dc2496186..8ec18f64e396 100644
--- a/include/linux/platform_data/dma-mv_xor.h
+++ b/include/linux/platform_data/dma-mv_xor.h
@@ -14,7 +14,6 @@
14 14
15struct mv_xor_channel_data { 15struct mv_xor_channel_data {
16 dma_cap_mask_t cap_mask; 16 dma_cap_mask_t cap_mask;
17 size_t pool_size;
18}; 17};
19 18
20struct mv_xor_platform_data { 19struct mv_xor_platform_data {