Skip to content

Commit 990fa99

Browse files
committed
Merge tag 'dmaengine-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine
Pull dmaengine updates from Vinod Koul: - Renesas driver conversion to RUNTIME_PM_OPS() etc - Dropping module alias on bunch of drivers - GPI Block event interrupt support in Qualcomm driver and updates to I2C driver as well * tag 'dmaengine-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (23 commits) dt-bindings: dma: xilinx: Simplify dma-coherent property dmaengine: fsl-edma: configure tcd attr with separate src and dst settings dmaengine: st_fdma: drop unused module alias dmaengine: bcm2835: enable compile testing dmaengine: tegra210-adma: drop unused module alias dmaengine: sprd: drop unused module alias dmaengine: mmp_tdma: drop unnecessary OF node check in remove dmaengine: mmp_tdma: drop unused module alias dmaengine: k3dma: drop unused module alias dmaengine: fsl-qdma: drop unused module alias dmaengine: fsl-edma: drop unused module alias dmaengine: dw: drop unused module alias dmaengine: bcm2835: drop unused module alias dmaengine: at_hdmac: add COMPILE_TEST support dmaengine: at_hdmac: fix formats under 64-bit i2c: i2c-qcom-geni: Add Block event interrupt support dmaengine: qcom: gpi: Add GPI Block event interrupt support dmaengine: idxd: drain ATS translations when disabling WQ dmaengine: sh: Kconfig: Drop ARCH_R7S72100/ARCH_RZG2L dependency dmaengine: rcar-dmac: Convert to NOIRQ_SYSTEM_SLEEP/RUNTIME_PM_OPS() ...
2 parents 0623fdf + 2b11e74 commit 990fa99

File tree

20 files changed

+302
-85
lines changed

20 files changed

+302
-85
lines changed

Documentation/devicetree/bindings/dma/xilinx/xlnx,zynqmp-dma-1.0.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ properties:
5959
power-domains:
6060
maxItems: 1
6161

62-
dma-coherent:
63-
description: present if dma operations are coherent
62+
dma-coherent: true
6463

6564
required:
6665
- "#dma-cells"

drivers/dma/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ config ARM_DMA350
102102

103103
config AT_HDMAC
104104
tristate "Atmel AHB DMA support"
105-
depends on ARCH_AT91
105+
depends on ARCH_AT91 || COMPILE_TEST
106106
select DMA_ENGINE
107107
select DMA_VIRTUAL_CHANNELS
108108
help
@@ -143,7 +143,7 @@ config BCM_SBA_RAID
143143

144144
config DMA_BCM2835
145145
tristate "BCM2835 DMA engine support"
146-
depends on ARCH_BCM2835
146+
depends on ARCH_BCM2835 || COMPILE_TEST
147147
select DMA_ENGINE
148148
select DMA_VIRTUAL_CHANNELS
149149

drivers/dma/at_hdmac.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ atc_prep_dma_interleaved(struct dma_chan *chan,
887887
first = xt->sgl;
888888

889889
dev_info(chan2dev(chan),
890-
"%s: src=%pad, dest=%pad, numf=%d, frame_size=%d, flags=0x%lx\n",
890+
"%s: src=%pad, dest=%pad, numf=%zu, frame_size=%zu, flags=0x%lx\n",
891891
__func__, &xt->src_start, &xt->dst_start, xt->numf,
892892
xt->frame_size, flags);
893893

@@ -1174,7 +1174,7 @@ atc_prep_dma_memset_sg(struct dma_chan *chan,
11741174
int i;
11751175
int ret;
11761176

1177-
dev_vdbg(chan2dev(chan), "%s: v0x%x l0x%zx f0x%lx\n", __func__,
1177+
dev_vdbg(chan2dev(chan), "%s: v0x%x l0x%x f0x%lx\n", __func__,
11781178
value, sg_len, flags);
11791179

11801180
if (unlikely(!sgl || !sg_len)) {
@@ -1503,7 +1503,7 @@ atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
15031503
unsigned int periods = buf_len / period_len;
15041504
unsigned int i;
15051505

1506-
dev_vdbg(chan2dev(chan), "prep_dma_cyclic: %s buf@%pad - %d (%d/%d)\n",
1506+
dev_vdbg(chan2dev(chan), "prep_dma_cyclic: %s buf@%pad - %d (%zu/%zu)\n",
15071507
direction == DMA_MEM_TO_DEV ? "TO DEVICE" : "FROM DEVICE",
15081508
&buf_addr,
15091509
periods, buf_len, period_len);

drivers/dma/bcm2835-dma.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,6 @@ static struct platform_driver bcm2835_dma_driver = {
10601060

10611061
module_platform_driver(bcm2835_dma_driver);
10621062

1063-
MODULE_ALIAS("platform:bcm2835-dma");
10641063
MODULE_DESCRIPTION("BCM2835 DMA engine driver");
10651064
MODULE_AUTHOR("Florian Meier <florian.meier@koalo.de>");
10661065
MODULE_LICENSE("GPL");

drivers/dma/dw/platform.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
#include "internal.h"
2323

24-
#define DRV_NAME "dw_dmac"
25-
2624
static int dw_probe(struct platform_device *pdev)
2725
{
2826
const struct dw_dma_chip_pdata *match;
@@ -190,7 +188,7 @@ static struct platform_driver dw_driver = {
190188
.remove = dw_remove,
191189
.shutdown = dw_shutdown,
192190
.driver = {
193-
.name = DRV_NAME,
191+
.name = "dw_dmac",
194192
.pm = pm_sleep_ptr(&dw_dev_pm_ops),
195193
.of_match_table = of_match_ptr(dw_dma_of_id_table),
196194
.acpi_match_table = ACPI_PTR(dw_dma_acpi_id_table),
@@ -211,4 +209,3 @@ module_exit(dw_exit);
211209

212210
MODULE_LICENSE("GPL v2");
213211
MODULE_DESCRIPTION("Synopsys DesignWare DMA Controller platform driver");
214-
MODULE_ALIAS("platform:" DRV_NAME);

drivers/dma/fsl-edma-common.c

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,19 @@ void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan,
206206
mux_configure8(fsl_chan, muxaddr, ch_off, slot, enable);
207207
}
208208

209-
static unsigned int fsl_edma_get_tcd_attr(enum dma_slave_buswidth addr_width)
209+
static unsigned int fsl_edma_get_tcd_attr(enum dma_slave_buswidth src_addr_width,
210+
enum dma_slave_buswidth dst_addr_width)
210211
{
211-
u32 val;
212+
u32 src_val, dst_val;
212213

213-
if (addr_width == DMA_SLAVE_BUSWIDTH_UNDEFINED)
214-
addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
214+
if (src_addr_width == DMA_SLAVE_BUSWIDTH_UNDEFINED)
215+
src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
216+
if (dst_addr_width == DMA_SLAVE_BUSWIDTH_UNDEFINED)
217+
dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
215218

216-
val = ffs(addr_width) - 1;
217-
return val | (val << 8);
219+
src_val = ffs(src_addr_width) - 1;
220+
dst_val = ffs(dst_addr_width) - 1;
221+
return dst_val | (src_val << 8);
218222
}
219223

220224
void fsl_edma_free_desc(struct virt_dma_desc *vdesc)
@@ -612,13 +616,19 @@ struct dma_async_tx_descriptor *fsl_edma_prep_dma_cyclic(
612616

613617
dma_buf_next = dma_addr;
614618
if (direction == DMA_MEM_TO_DEV) {
619+
if (!fsl_chan->cfg.src_addr_width)
620+
fsl_chan->cfg.src_addr_width = fsl_chan->cfg.dst_addr_width;
615621
fsl_chan->attr =
616-
fsl_edma_get_tcd_attr(fsl_chan->cfg.dst_addr_width);
622+
fsl_edma_get_tcd_attr(fsl_chan->cfg.src_addr_width,
623+
fsl_chan->cfg.dst_addr_width);
617624
nbytes = fsl_chan->cfg.dst_addr_width *
618625
fsl_chan->cfg.dst_maxburst;
619626
} else {
627+
if (!fsl_chan->cfg.dst_addr_width)
628+
fsl_chan->cfg.dst_addr_width = fsl_chan->cfg.src_addr_width;
620629
fsl_chan->attr =
621-
fsl_edma_get_tcd_attr(fsl_chan->cfg.src_addr_width);
630+
fsl_edma_get_tcd_attr(fsl_chan->cfg.src_addr_width,
631+
fsl_chan->cfg.dst_addr_width);
622632
nbytes = fsl_chan->cfg.src_addr_width *
623633
fsl_chan->cfg.src_maxburst;
624634
}
@@ -689,13 +699,19 @@ struct dma_async_tx_descriptor *fsl_edma_prep_slave_sg(
689699
fsl_desc->dirn = direction;
690700

691701
if (direction == DMA_MEM_TO_DEV) {
702+
if (!fsl_chan->cfg.src_addr_width)
703+
fsl_chan->cfg.src_addr_width = fsl_chan->cfg.dst_addr_width;
692704
fsl_chan->attr =
693-
fsl_edma_get_tcd_attr(fsl_chan->cfg.dst_addr_width);
705+
fsl_edma_get_tcd_attr(fsl_chan->cfg.src_addr_width,
706+
fsl_chan->cfg.dst_addr_width);
694707
nbytes = fsl_chan->cfg.dst_addr_width *
695708
fsl_chan->cfg.dst_maxburst;
696709
} else {
710+
if (!fsl_chan->cfg.dst_addr_width)
711+
fsl_chan->cfg.dst_addr_width = fsl_chan->cfg.src_addr_width;
697712
fsl_chan->attr =
698-
fsl_edma_get_tcd_attr(fsl_chan->cfg.src_addr_width);
713+
fsl_edma_get_tcd_attr(fsl_chan->cfg.src_addr_width,
714+
fsl_chan->cfg.dst_addr_width);
699715
nbytes = fsl_chan->cfg.src_addr_width *
700716
fsl_chan->cfg.src_maxburst;
701717
}
@@ -766,6 +782,10 @@ struct dma_async_tx_descriptor *fsl_edma_prep_memcpy(struct dma_chan *chan,
766782
{
767783
struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan);
768784
struct fsl_edma_desc *fsl_desc;
785+
u32 src_bus_width, dst_bus_width;
786+
787+
src_bus_width = min_t(u32, DMA_SLAVE_BUSWIDTH_32_BYTES, 1 << (ffs(dma_src) - 1));
788+
dst_bus_width = min_t(u32, DMA_SLAVE_BUSWIDTH_32_BYTES, 1 << (ffs(dma_dst) - 1));
769789

770790
fsl_desc = fsl_edma_alloc_desc(fsl_chan, 1);
771791
if (!fsl_desc)
@@ -778,8 +798,9 @@ struct dma_async_tx_descriptor *fsl_edma_prep_memcpy(struct dma_chan *chan,
778798

779799
/* To match with copy_align and max_seg_size so 1 tcd is enough */
780800
fsl_edma_fill_tcd(fsl_chan, fsl_desc->tcd[0].vtcd, dma_src, dma_dst,
781-
fsl_edma_get_tcd_attr(DMA_SLAVE_BUSWIDTH_32_BYTES),
782-
32, len, 0, 1, 1, 32, 0, true, true, false);
801+
fsl_edma_get_tcd_attr(src_bus_width, dst_bus_width),
802+
src_bus_width, len, 0, 1, 1, dst_bus_width, 0, true,
803+
true, false);
783804

784805
return vchan_tx_prep(&fsl_chan->vchan, &fsl_desc->vdesc, flags);
785806
}

drivers/dma/fsl-edma-main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,5 @@ static void __exit fsl_edma_exit(void)
999999
}
10001000
module_exit(fsl_edma_exit);
10011001

1002-
MODULE_ALIAS("platform:fsl-edma");
10031002
MODULE_DESCRIPTION("Freescale eDMA engine driver");
10041003
MODULE_LICENSE("GPL v2");

drivers/dma/fsl-qdma.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,5 @@ static struct platform_driver fsl_qdma_driver = {
12961296

12971297
module_platform_driver(fsl_qdma_driver);
12981298

1299-
MODULE_ALIAS("platform:fsl-qdma");
13001299
MODULE_LICENSE("GPL v2");
13011300
MODULE_DESCRIPTION("NXP Layerscape qDMA engine driver");

drivers/dma/idxd/device.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ static void idxd_cmd_exec(struct idxd_device *idxd, int cmd_code, u32 operand,
1616
u32 *status);
1717
static void idxd_device_wqs_clear_state(struct idxd_device *idxd);
1818
static void idxd_wq_disable_cleanup(struct idxd_wq *wq);
19+
static int idxd_wq_config_write(struct idxd_wq *wq);
1920

2021
/* Interrupt control bits */
2122
void idxd_unmask_error_interrupts(struct idxd_device *idxd)
@@ -215,14 +216,28 @@ int idxd_wq_disable(struct idxd_wq *wq, bool reset_config)
215216
return 0;
216217
}
217218

219+
/*
220+
* Disable WQ does not drain address translations, if WQ attributes are
221+
* changed before translations are drained, pending translations can
222+
* be issued using updated WQ attibutes, resulting in invalid
223+
* translations being cached in the device translation cache.
224+
*
225+
* To make sure pending translations are drained before WQ
226+
* attributes are changed, we use a WQ Drain followed by WQ Reset and
227+
* then restore the WQ configuration.
228+
*/
229+
idxd_wq_drain(wq);
230+
218231
operand = BIT(wq->id % 16) | ((wq->id / 16) << 16);
219-
idxd_cmd_exec(idxd, IDXD_CMD_DISABLE_WQ, operand, &status);
232+
idxd_cmd_exec(idxd, IDXD_CMD_RESET_WQ, operand, &status);
220233

221234
if (status != IDXD_CMDSTS_SUCCESS) {
222-
dev_dbg(dev, "WQ disable failed: %#x\n", status);
235+
dev_dbg(dev, "WQ reset failed: %#x\n", status);
223236
return -ENXIO;
224237
}
225238

239+
idxd_wq_config_write(wq);
240+
226241
if (reset_config)
227242
idxd_wq_disable_cleanup(wq);
228243
clear_bit(wq->id, idxd->wq_enable_map);

drivers/dma/k3dma.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,5 +1034,4 @@ static struct platform_driver k3_pdma_driver = {
10341034
module_platform_driver(k3_pdma_driver);
10351035

10361036
MODULE_DESCRIPTION("HiSilicon k3 DMA Driver");
1037-
MODULE_ALIAS("platform:k3dma");
10381037
MODULE_LICENSE("GPL v2");

0 commit comments

Comments
 (0)