aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2015-08-11 11:49:00 -0400
committerVinod Koul <vinod.koul@intel.com>2015-08-17 04:07:30 -0400
commitef97bd0f59741ca1a555b69b8708f6601e35c3ed (patch)
tree5563f79da5b08ca7db83dba59435732b4e60a9cf
parent3372de5813e4da8305002ff6ffbfc0c7012cb319 (diff)
dmanegine: ioatdma: remove function ptrs in ioatdma_device
Since we are a "single" device driver now we no longer require the function pointers in ioatdma_device. Remove. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Acked-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/ioat/dma.c6
-rw-r--r--drivers/dma/ioat/dma.h14
-rw-r--r--drivers/dma/ioat/init.c25
3 files changed, 13 insertions, 32 deletions
diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
index 2031bb4ad536..7435585dbbd6 100644
--- a/drivers/dma/ioat/dma.c
+++ b/drivers/dma/ioat/dma.c
@@ -121,7 +121,7 @@ void ioat_stop(struct ioatdma_chan *ioat_chan)
121 tasklet_kill(&ioat_chan->cleanup_task); 121 tasklet_kill(&ioat_chan->cleanup_task);
122 122
123 /* final cleanup now that everything is quiesced and can't re-arm */ 123 /* final cleanup now that everything is quiesced and can't re-arm */
124 ioat_dma->cleanup_fn((unsigned long)&ioat_chan->dma_chan); 124 ioat_cleanup_event((unsigned long)&ioat_chan->dma_chan);
125} 125}
126 126
127static void __ioat_issue_pending(struct ioatdma_chan *ioat_chan) 127static void __ioat_issue_pending(struct ioatdma_chan *ioat_chan)
@@ -520,10 +520,8 @@ int ioat_check_space_lock(struct ioatdma_chan *ioat_chan, int num_descs)
520 */ 520 */
521 if (time_is_before_jiffies(ioat_chan->timer.expires) 521 if (time_is_before_jiffies(ioat_chan->timer.expires)
522 && timer_pending(&ioat_chan->timer)) { 522 && timer_pending(&ioat_chan->timer)) {
523 struct ioatdma_device *ioat_dma = ioat_chan->ioat_dma;
524
525 mod_timer(&ioat_chan->timer, jiffies + COMPLETION_TIMEOUT); 523 mod_timer(&ioat_chan->timer, jiffies + COMPLETION_TIMEOUT);
526 ioat_dma->timer_fn((unsigned long)ioat_chan); 524 ioat_timer_event((unsigned long)ioat_chan);
527 } 525 }
528 526
529 return -ENOMEM; 527 return -ENOMEM;
diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
index 2e1f05464703..df569d810b8f 100644
--- a/drivers/dma/ioat/dma.h
+++ b/drivers/dma/ioat/dma.h
@@ -68,14 +68,6 @@ enum ioat_irq_mode {
68 * @msix_entries: irq handlers 68 * @msix_entries: irq handlers
69 * @idx: per channel data 69 * @idx: per channel data
70 * @dca: direct cache access context 70 * @dca: direct cache access context
71 * @intr_quirk: interrupt setup quirk (for ioat_v1 devices)
72 * @enumerate_channels: hw version specific channel enumeration
73 * @reset_hw: hw version specific channel (re)initialization
74 * @cleanup_fn: select between the v2 and v3 cleanup routines
75 * @timer_fn: select between the v2 and v3 timer watchdog routines
76 * @self_test: hardware version specific self test for each supported op type
77 *
78 * Note: the v3 cleanup routine supports raid operations
79 */ 71 */
80struct ioatdma_device { 72struct ioatdma_device {
81 struct pci_dev *pdev; 73 struct pci_dev *pdev;
@@ -91,12 +83,6 @@ struct ioatdma_device {
91 struct dca_provider *dca; 83 struct dca_provider *dca;
92 enum ioat_irq_mode irq_mode; 84 enum ioat_irq_mode irq_mode;
93 u32 cap; 85 u32 cap;
94 void (*intr_quirk)(struct ioatdma_device *ioat_dma);
95 int (*enumerate_channels)(struct ioatdma_device *ioat_dma);
96 int (*reset_hw)(struct ioatdma_chan *ioat_chan);
97 void (*cleanup_fn)(unsigned long data);
98 void (*timer_fn)(unsigned long data);
99 int (*self_test)(struct ioatdma_device *ioat_dma);
100}; 86};
101 87
102struct ioatdma_chan { 88struct ioatdma_chan {
diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c
index e6969809d723..592222105997 100644
--- a/drivers/dma/ioat/init.c
+++ b/drivers/dma/ioat/init.c
@@ -113,6 +113,9 @@ static void ioat_remove(struct pci_dev *pdev);
113static void 113static void
114ioat_init_channel(struct ioatdma_device *ioat_dma, 114ioat_init_channel(struct ioatdma_device *ioat_dma,
115 struct ioatdma_chan *ioat_chan, int idx); 115 struct ioatdma_chan *ioat_chan, int idx);
116static void ioat_intr_quirk(struct ioatdma_device *ioat_dma);
117static int ioat_enumerate_channels(struct ioatdma_device *ioat_dma);
118static int ioat3_dma_self_test(struct ioatdma_device *ioat_dma);
116 119
117static int ioat_dca_enabled = 1; 120static int ioat_dca_enabled = 1;
118module_param(ioat_dca_enabled, int, 0644); 121module_param(ioat_dca_enabled, int, 0644);
@@ -443,8 +446,8 @@ intx:
443 446
444 ioat_dma->irq_mode = IOAT_INTX; 447 ioat_dma->irq_mode = IOAT_INTX;
445done: 448done:
446 if (ioat_dma->intr_quirk) 449 if (is_bwd_ioat(pdev))
447 ioat_dma->intr_quirk(ioat_dma); 450 ioat_intr_quirk(ioat_dma);
448 intrctrl |= IOAT_INTRCTRL_MASTER_INT_EN; 451 intrctrl |= IOAT_INTRCTRL_MASTER_INT_EN;
449 writeb(intrctrl, ioat_dma->reg_base + IOAT_INTRCTRL_OFFSET); 452 writeb(intrctrl, ioat_dma->reg_base + IOAT_INTRCTRL_OFFSET);
450 return 0; 453 return 0;
@@ -489,7 +492,7 @@ static int ioat_probe(struct ioatdma_device *ioat_dma)
489 goto err_completion_pool; 492 goto err_completion_pool;
490 } 493 }
491 494
492 ioat_dma->enumerate_channels(ioat_dma); 495 ioat_enumerate_channels(ioat_dma);
493 496
494 dma_cap_set(DMA_MEMCPY, dma->cap_mask); 497 dma_cap_set(DMA_MEMCPY, dma->cap_mask);
495 dma->dev = &pdev->dev; 498 dma->dev = &pdev->dev;
@@ -503,7 +506,7 @@ static int ioat_probe(struct ioatdma_device *ioat_dma)
503 if (err) 506 if (err)
504 goto err_setup_interrupts; 507 goto err_setup_interrupts;
505 508
506 err = ioat_dma->self_test(ioat_dma); 509 err = ioat3_dma_self_test(ioat_dma);
507 if (err) 510 if (err)
508 goto err_self_test; 511 goto err_self_test;
509 512
@@ -582,7 +585,7 @@ static int ioat_enumerate_channels(struct ioatdma_device *ioat_dma)
582 ioat_init_channel(ioat_dma, ioat_chan, i); 585 ioat_init_channel(ioat_dma, ioat_chan, i);
583 ioat_chan->xfercap_log = xfercap_log; 586 ioat_chan->xfercap_log = xfercap_log;
584 spin_lock_init(&ioat_chan->prep_lock); 587 spin_lock_init(&ioat_chan->prep_lock);
585 if (ioat_dma->reset_hw(ioat_chan)) { 588 if (ioat_reset_hw(ioat_chan)) {
586 i = 0; 589 i = 0;
587 break; 590 break;
588 } 591 }
@@ -611,7 +614,7 @@ static void ioat_free_chan_resources(struct dma_chan *c)
611 return; 614 return;
612 615
613 ioat_stop(ioat_chan); 616 ioat_stop(ioat_chan);
614 ioat_dma->reset_hw(ioat_chan); 617 ioat_reset_hw(ioat_chan);
615 618
616 spin_lock_bh(&ioat_chan->cleanup_lock); 619 spin_lock_bh(&ioat_chan->cleanup_lock);
617 spin_lock_bh(&ioat_chan->prep_lock); 620 spin_lock_bh(&ioat_chan->prep_lock);
@@ -730,9 +733,9 @@ ioat_init_channel(struct ioatdma_device *ioat_dma,
730 list_add_tail(&ioat_chan->dma_chan.device_node, &dma->channels); 733 list_add_tail(&ioat_chan->dma_chan.device_node, &dma->channels);
731 ioat_dma->idx[idx] = ioat_chan; 734 ioat_dma->idx[idx] = ioat_chan;
732 init_timer(&ioat_chan->timer); 735 init_timer(&ioat_chan->timer);
733 ioat_chan->timer.function = ioat_dma->timer_fn; 736 ioat_chan->timer.function = ioat_timer_event;
734 ioat_chan->timer.data = data; 737 ioat_chan->timer.data = data;
735 tasklet_init(&ioat_chan->cleanup_task, ioat_dma->cleanup_fn, data); 738 tasklet_init(&ioat_chan->cleanup_task, ioat_cleanup_event, data);
736} 739}
737 740
738#define IOAT_NUM_SRC_TEST 6 /* must be <= 8 */ 741#define IOAT_NUM_SRC_TEST 6 /* must be <= 8 */
@@ -1053,10 +1056,6 @@ static int ioat3_dma_probe(struct ioatdma_device *ioat_dma, int dca)
1053 bool is_raid_device = false; 1056 bool is_raid_device = false;
1054 int err; 1057 int err;
1055 1058
1056 ioat_dma->enumerate_channels = ioat_enumerate_channels;
1057 ioat_dma->reset_hw = ioat_reset_hw;
1058 ioat_dma->self_test = ioat3_dma_self_test;
1059 ioat_dma->intr_quirk = ioat_intr_quirk;
1060 dma = &ioat_dma->dma_dev; 1059 dma = &ioat_dma->dma_dev;
1061 dma->device_prep_dma_memcpy = ioat_dma_prep_memcpy_lock; 1060 dma->device_prep_dma_memcpy = ioat_dma_prep_memcpy_lock;
1062 dma->device_issue_pending = ioat_issue_pending; 1061 dma->device_issue_pending = ioat_issue_pending;
@@ -1114,8 +1113,6 @@ static int ioat3_dma_probe(struct ioatdma_device *ioat_dma, int dca)
1114 } 1113 }
1115 1114
1116 dma->device_tx_status = ioat_tx_status; 1115 dma->device_tx_status = ioat_tx_status;
1117 ioat_dma->cleanup_fn = ioat_cleanup_event;
1118 ioat_dma->timer_fn = ioat_timer_event;
1119 1116
1120 /* starting with CB3.3 super extended descriptors are supported */ 1117 /* starting with CB3.3 super extended descriptors are supported */
1121 if (ioat_dma->cap & IOAT_CAP_RAID16SS) { 1118 if (ioat_dma->cap & IOAT_CAP_RAID16SS) {