Skip to content

Commit 6fba14a

Browse files
committed
Merge tag 'dmaengine-fix-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine
Pull dmaengine fixes from Vinod Koul: - Revert pl330 issue_pending waits until WFP state due to regression reported in Bluetooth loading - Xilinx driver fixes for synchronization, buffer offsets, locking and kdoc - idxd fixes for spinlock and preventing the migration of the perf context to an invalid target - idma driver fix for interrupt handling when powered off - Tegra driver residual calculation fix - Owl driver register access fix * tag 'dmaengine-fix-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: dmaengine: idxd: Fix oops during rmmod on single-CPU platforms dmaengine: xilinx: xdma: Clarify kdoc in XDMA driver dmaengine: xilinx: xdma: Fix synchronization issue dmaengine: xilinx: xdma: Fix wrong offsets in the buffers addresses in dma descriptor dma: xilinx_dpdma: Fix locking dmaengine: idxd: Convert spinlock to mutex to lock evl workqueue idma64: Don't try to serve interrupts when device is powered off dmaengine: tegra186: Fix residual calculation dmaengine: owl: fix register access functions dmaengine: Revert "dmaengine: pl330: issue_pending waits until WFP state"
2 parents 63407d3 + f221033 commit 6fba14a

File tree

14 files changed

+64
-42
lines changed

14 files changed

+64
-42
lines changed

drivers/dma/idma64.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ static irqreturn_t idma64_irq(int irq, void *dev)
171171
u32 status_err;
172172
unsigned short i;
173173

174+
/* Since IRQ may be shared, check if DMA controller is powered on */
175+
if (status == GENMASK(31, 0))
176+
return IRQ_NONE;
177+
174178
dev_vdbg(idma64->dma.dev, "%s: status=%#x\n", __func__, status);
175179

176180
/* Check if we have any interrupt from the DMA controller */

drivers/dma/idxd/cdev.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ static void idxd_cdev_evl_drain_pasid(struct idxd_wq *wq, u32 pasid)
342342
if (!evl)
343343
return;
344344

345-
spin_lock(&evl->lock);
345+
mutex_lock(&evl->lock);
346346
status.bits = ioread64(idxd->reg_base + IDXD_EVLSTATUS_OFFSET);
347347
t = status.tail;
348348
h = status.head;
@@ -354,9 +354,8 @@ static void idxd_cdev_evl_drain_pasid(struct idxd_wq *wq, u32 pasid)
354354
set_bit(h, evl->bmap);
355355
h = (h + 1) % size;
356356
}
357-
spin_unlock(&evl->lock);
358-
359357
drain_workqueue(wq->wq);
358+
mutex_unlock(&evl->lock);
360359
}
361360

362361
static int idxd_cdev_release(struct inode *node, struct file *filep)

drivers/dma/idxd/debugfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static int debugfs_evl_show(struct seq_file *s, void *d)
6666
if (!evl || !evl->log)
6767
return 0;
6868

69-
spin_lock(&evl->lock);
69+
mutex_lock(&evl->lock);
7070

7171
evl_status.bits = ioread64(idxd->reg_base + IDXD_EVLSTATUS_OFFSET);
7272
t = evl_status.tail;
@@ -87,7 +87,7 @@ static int debugfs_evl_show(struct seq_file *s, void *d)
8787
dump_event_entry(idxd, s, i, &count, processed);
8888
}
8989

90-
spin_unlock(&evl->lock);
90+
mutex_unlock(&evl->lock);
9191
return 0;
9292
}
9393

drivers/dma/idxd/device.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ static int idxd_device_evl_setup(struct idxd_device *idxd)
775775
goto err_alloc;
776776
}
777777

778-
spin_lock(&evl->lock);
778+
mutex_lock(&evl->lock);
779779
evl->log = addr;
780780
evl->dma = dma_addr;
781781
evl->log_size = size;
@@ -796,7 +796,7 @@ static int idxd_device_evl_setup(struct idxd_device *idxd)
796796
gencfg.evl_en = 1;
797797
iowrite32(gencfg.bits, idxd->reg_base + IDXD_GENCFG_OFFSET);
798798

799-
spin_unlock(&evl->lock);
799+
mutex_unlock(&evl->lock);
800800
return 0;
801801

802802
err_alloc:
@@ -819,7 +819,7 @@ static void idxd_device_evl_free(struct idxd_device *idxd)
819819
if (!gencfg.evl_en)
820820
return;
821821

822-
spin_lock(&evl->lock);
822+
mutex_lock(&evl->lock);
823823
gencfg.evl_en = 0;
824824
iowrite32(gencfg.bits, idxd->reg_base + IDXD_GENCFG_OFFSET);
825825

@@ -836,7 +836,7 @@ static void idxd_device_evl_free(struct idxd_device *idxd)
836836
evl_dma = evl->dma;
837837
evl->log = NULL;
838838
evl->size = IDXD_EVL_SIZE_MIN;
839-
spin_unlock(&evl->lock);
839+
mutex_unlock(&evl->lock);
840840

841841
dma_free_coherent(dev, evl_log_size, evl_log, evl_dma);
842842
}

drivers/dma/idxd/idxd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ struct idxd_driver_data {
293293

294294
struct idxd_evl {
295295
/* Lock to protect event log access. */
296-
spinlock_t lock;
296+
struct mutex lock;
297297
void *log;
298298
dma_addr_t dma;
299299
/* Total size of event log = number of entries * entry size. */

drivers/dma/idxd/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static int idxd_init_evl(struct idxd_device *idxd)
354354
if (!evl)
355355
return -ENOMEM;
356356

357-
spin_lock_init(&evl->lock);
357+
mutex_init(&evl->lock);
358358
evl->size = IDXD_EVL_SIZE_MIN;
359359

360360
idxd_name = dev_name(idxd_confdev(idxd));

drivers/dma/idxd/irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ static void process_evl_entries(struct idxd_device *idxd)
363363
evl_status.bits = 0;
364364
evl_status.int_pending = 1;
365365

366-
spin_lock(&evl->lock);
366+
mutex_lock(&evl->lock);
367367
/* Clear interrupt pending bit */
368368
iowrite32(evl_status.bits_upper32,
369369
idxd->reg_base + IDXD_EVLSTATUS_OFFSET + sizeof(u32));
@@ -380,7 +380,7 @@ static void process_evl_entries(struct idxd_device *idxd)
380380

381381
evl_status.head = h;
382382
iowrite32(evl_status.bits_lower32, idxd->reg_base + IDXD_EVLSTATUS_OFFSET);
383-
spin_unlock(&evl->lock);
383+
mutex_unlock(&evl->lock);
384384
}
385385

386386
irqreturn_t idxd_misc_thread(int vec, void *data)

drivers/dma/idxd/perfmon.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -528,14 +528,11 @@ static int perf_event_cpu_offline(unsigned int cpu, struct hlist_node *node)
528528
return 0;
529529

530530
target = cpumask_any_but(cpu_online_mask, cpu);
531-
532531
/* migrate events if there is a valid target */
533-
if (target < nr_cpu_ids)
532+
if (target < nr_cpu_ids) {
534533
cpumask_set_cpu(target, &perfmon_dsa_cpu_mask);
535-
else
536-
target = -1;
537-
538-
perf_pmu_migrate_context(&idxd_pmu->pmu, cpu, target);
534+
perf_pmu_migrate_context(&idxd_pmu->pmu, cpu, target);
535+
}
539536

540537
return 0;
541538
}

drivers/dma/owl-dma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static void pchan_update(struct owl_dma_pchan *pchan, u32 reg,
250250
else
251251
regval &= ~val;
252252

253-
writel(val, pchan->base + reg);
253+
writel(regval, pchan->base + reg);
254254
}
255255

256256
static void pchan_writel(struct owl_dma_pchan *pchan, u32 reg, u32 data)
@@ -274,7 +274,7 @@ static void dma_update(struct owl_dma *od, u32 reg, u32 val, bool state)
274274
else
275275
regval &= ~val;
276276

277-
writel(val, od->base + reg);
277+
writel(regval, od->base + reg);
278278
}
279279

280280
static void dma_writel(struct owl_dma *od, u32 reg, u32 data)

drivers/dma/pl330.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,9 +1053,6 @@ static bool _trigger(struct pl330_thread *thrd)
10531053

10541054
thrd->req_running = idx;
10551055

1056-
if (desc->rqtype == DMA_MEM_TO_DEV || desc->rqtype == DMA_DEV_TO_MEM)
1057-
UNTIL(thrd, PL330_STATE_WFP);
1058-
10591056
return true;
10601057
}
10611058

0 commit comments

Comments
 (0)