Skip to content

Commit cedd54f

Browse files
committed
Merge tag 'dmaengine-fix-5.7-rc7' of git://git.infradead.org/users/vkoul/slave-dma
Pull dmaengine fixes from Vinod Koul: "Some driver fixes: - dmatest restoration of defaults - tegra210-adma probe handling fix - k3-udma flags fixed for slave_sg and memcpy - list fix for zynqmp_dma - idxd interrupt completion fix - lock fix for owl" * tag 'dmaengine-fix-5.7-rc7' of git://git.infradead.org/users/vkoul/slave-dma: dmaengine: tegra210-adma: Fix an error handling path in 'tegra_adma_probe()' dmaengine: ti: k3-udma: Fix TR mode flags for slave_sg and memcpy dmaengine: zynqmp_dma: Move list_del inside zynqmp_dma_free_descriptor. dmaengine: dmatest: Restore default for channel dmaengine: idxd: fix interrupt completion after unmasking dmaengine: owl: Use correct lock in owl_dma_get_pchan()
2 parents 57f1b0c + 3a5fd0d commit cedd54f

File tree

7 files changed

+40
-21
lines changed

7 files changed

+40
-21
lines changed

drivers/dma/dmatest.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,10 +1166,11 @@ static int dmatest_run_set(const char *val, const struct kernel_param *kp)
11661166
mutex_unlock(&info->lock);
11671167
return ret;
11681168
} else if (dmatest_run) {
1169-
if (is_threaded_test_pending(info))
1170-
start_threaded_tests(info);
1171-
else
1172-
pr_info("Could not start test, no channels configured\n");
1169+
if (!is_threaded_test_pending(info)) {
1170+
pr_info("No channels configured, continue with any\n");
1171+
add_threaded_test(info);
1172+
}
1173+
start_threaded_tests(info);
11731174
} else {
11741175
stop_threaded_test(info);
11751176
}

drivers/dma/idxd/device.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ int idxd_unmask_msix_vector(struct idxd_device *idxd, int vec_id)
6262
perm.ignore = 0;
6363
iowrite32(perm.bits, idxd->reg_base + offset);
6464

65+
/*
66+
* A readback from the device ensures that any previously generated
67+
* completion record writes are visible to software based on PCI
68+
* ordering rules.
69+
*/
70+
perm.bits = ioread32(idxd->reg_base + offset);
71+
6572
return 0;
6673
}
6774

drivers/dma/idxd/irq.c

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ static int irq_process_pending_llist(struct idxd_irq_entry *irq_entry,
173173
struct llist_node *head;
174174
int queued = 0;
175175

176+
*processed = 0;
176177
head = llist_del_all(&irq_entry->pending_llist);
177178
if (!head)
178179
return 0;
@@ -197,6 +198,7 @@ static int irq_process_work_list(struct idxd_irq_entry *irq_entry,
197198
struct list_head *node, *next;
198199
int queued = 0;
199200

201+
*processed = 0;
200202
if (list_empty(&irq_entry->work_list))
201203
return 0;
202204

@@ -218,10 +220,9 @@ static int irq_process_work_list(struct idxd_irq_entry *irq_entry,
218220
return queued;
219221
}
220222

221-
irqreturn_t idxd_wq_thread(int irq, void *data)
223+
static int idxd_desc_process(struct idxd_irq_entry *irq_entry)
222224
{
223-
struct idxd_irq_entry *irq_entry = data;
224-
int rc, processed = 0, retry = 0;
225+
int rc, processed, total = 0;
225226

226227
/*
227228
* There are two lists we are processing. The pending_llist is where
@@ -244,15 +245,26 @@ irqreturn_t idxd_wq_thread(int irq, void *data)
244245
*/
245246
do {
246247
rc = irq_process_work_list(irq_entry, &processed);
247-
if (rc != 0) {
248-
retry++;
248+
total += processed;
249+
if (rc != 0)
249250
continue;
250-
}
251251

252252
rc = irq_process_pending_llist(irq_entry, &processed);
253-
} while (rc != 0 && retry != 10);
253+
total += processed;
254+
} while (rc != 0);
255+
256+
return total;
257+
}
258+
259+
irqreturn_t idxd_wq_thread(int irq, void *data)
260+
{
261+
struct idxd_irq_entry *irq_entry = data;
262+
int processed;
254263

264+
processed = idxd_desc_process(irq_entry);
255265
idxd_unmask_msix_vector(irq_entry->idxd, irq_entry->id);
266+
/* catch anything unprocessed after unmasking */
267+
processed += idxd_desc_process(irq_entry);
256268

257269
if (processed == 0)
258270
return IRQ_NONE;

drivers/dma/owl-dma.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,11 @@ struct owl_dma_txd {
175175
* @id: physical index to this channel
176176
* @base: virtual memory base for the dma channel
177177
* @vchan: the virtual channel currently being served by this physical channel
178-
* @lock: a lock to use when altering an instance of this struct
179178
*/
180179
struct owl_dma_pchan {
181180
u32 id;
182181
void __iomem *base;
183182
struct owl_dma_vchan *vchan;
184-
spinlock_t lock;
185183
};
186184

187185
/**
@@ -437,14 +435,14 @@ static struct owl_dma_pchan *owl_dma_get_pchan(struct owl_dma *od,
437435
for (i = 0; i < od->nr_pchans; i++) {
438436
pchan = &od->pchans[i];
439437

440-
spin_lock_irqsave(&pchan->lock, flags);
438+
spin_lock_irqsave(&od->lock, flags);
441439
if (!pchan->vchan) {
442440
pchan->vchan = vchan;
443-
spin_unlock_irqrestore(&pchan->lock, flags);
441+
spin_unlock_irqrestore(&od->lock, flags);
444442
break;
445443
}
446444

447-
spin_unlock_irqrestore(&pchan->lock, flags);
445+
spin_unlock_irqrestore(&od->lock, flags);
448446
}
449447

450448
return pchan;

drivers/dma/tegra210-adma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ static int tegra_adma_probe(struct platform_device *pdev)
900900
ret = dma_async_device_register(&tdma->dma_dev);
901901
if (ret < 0) {
902902
dev_err(&pdev->dev, "ADMA registration failed: %d\n", ret);
903-
goto irq_dispose;
903+
goto rpm_put;
904904
}
905905

906906
ret = of_dma_controller_register(pdev->dev.of_node,

drivers/dma/ti/k3-udma.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2156,7 +2156,8 @@ udma_prep_slave_sg_tr(struct udma_chan *uc, struct scatterlist *sgl,
21562156
d->residue += sg_dma_len(sgent);
21572157
}
21582158

2159-
cppi5_tr_csf_set(&tr_req[tr_idx - 1].flags, CPPI5_TR_CSF_EOP);
2159+
cppi5_tr_csf_set(&tr_req[tr_idx - 1].flags,
2160+
CPPI5_TR_CSF_SUPR_EVT | CPPI5_TR_CSF_EOP);
21602161

21612162
return d;
21622163
}
@@ -2733,7 +2734,8 @@ udma_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
27332734
tr_req[1].dicnt3 = 1;
27342735
}
27352736

2736-
cppi5_tr_csf_set(&tr_req[num_tr - 1].flags, CPPI5_TR_CSF_EOP);
2737+
cppi5_tr_csf_set(&tr_req[num_tr - 1].flags,
2738+
CPPI5_TR_CSF_SUPR_EVT | CPPI5_TR_CSF_EOP);
27372739

27382740
if (uc->config.metadata_size)
27392741
d->vd.tx.metadata_ops = &metadata_ops;

drivers/dma/xilinx/zynqmp_dma.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ static void zynqmp_dma_free_descriptor(struct zynqmp_dma_chan *chan,
434434
struct zynqmp_dma_desc_sw *child, *next;
435435

436436
chan->desc_free_cnt++;
437+
list_del(&sdesc->node);
437438
list_add_tail(&sdesc->node, &chan->free_list);
438439
list_for_each_entry_safe(child, next, &sdesc->tx_list, node) {
439440
chan->desc_free_cnt++;
@@ -608,8 +609,6 @@ static void zynqmp_dma_chan_desc_cleanup(struct zynqmp_dma_chan *chan)
608609
dma_async_tx_callback callback;
609610
void *callback_param;
610611

611-
list_del(&desc->node);
612-
613612
callback = desc->async_tx.callback;
614613
callback_param = desc->async_tx.callback_param;
615614
if (callback) {

0 commit comments

Comments
 (0)