Skip to content

Commit e68a7d3

Browse files
committed
Merge tag 'dmaengine-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine
Pull dmaengine updates from Vinod Koul: "A bunch of driver updates, no new driver or controller support this time though: - Another pile of idxd updates - pm routines cleanup for at_xdmac driver - Correct handling of callback_result for few drivers - zynqmp_dma driver updates and descriptor management refinement - Hardware handshaking support for dw-axi-dmac - Support for remotely powered controllers in Qcom bam dma - tegra driver updates" * tag 'dmaengine-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (69 commits) dmaengine: ti: k3-udma: Set r/tchan or rflow to NULL if request fail dmaengine: ti: k3-udma: Set bchan to NULL if a channel request fail dmaengine: stm32-dma: avoid 64-bit division in stm32_dma_get_max_width dmaengine: fsl-edma: support edma memcpy dmaengine: idxd: fix resource leak on dmaengine driver disable dmaengine: idxd: cleanup completion record allocation dmaengine: zynqmp_dma: Correctly handle descriptor callbacks dmaengine: xilinx_dma: Correctly handle cyclic descriptor callbacks dmaengine: altera-msgdma: Correctly handle descriptor callbacks dmaengine: at_xdmac: fix compilation warning dmaengine: dw-axi-dmac: Simplify assignment in dma_chan_pause() dmaengine: qcom: bam_dma: Add "powered remotely" mode dt-bindings: dmaengine: bam_dma: Add "powered remotely" mode dmaengine: sa11x0: Mark PM functions as __maybe_unused dmaengine: switch from 'pci_' to 'dma_' API dmaengine: ioat: switch from 'pci_' to 'dma_' API dmaengine: hsu: switch from 'pci_' to 'dma_' API dmaengine: hisi_dma: switch from 'pci_' to 'dma_' API dmaengine: dw: switch from 'pci_' to 'dma_' API dmaengine: dw-edma-pcie: switch from 'pci_' to 'dma_' API ...
2 parents d4efc0d + eb91224 commit e68a7d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+490
-330
lines changed

Documentation/devicetree/bindings/dma/qcom_bam_dma.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Required properties:
1515
the secure world.
1616
- qcom,controlled-remotely : optional, indicates that the bam is controlled by
1717
remote proccessor i.e. execution environment.
18+
- qcom,powered-remotely : optional, indicates that the bam is powered up by
19+
a remote processor but must be initialized by the local processor.
1820
- num-channels : optional, indicates supported number of DMA channels in a
1921
remotely controlled bam.
2022
- qcom,num-ees : optional, indicates supported number of Execution Environments

drivers/dma/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ config XILINX_DMA
717717

718718
config XILINX_ZYNQMP_DMA
719719
tristate "Xilinx ZynqMP DMA Engine"
720-
depends on (ARCH_ZYNQ || MICROBLAZE || ARM64)
720+
depends on ARCH_ZYNQ || MICROBLAZE || ARM64 || COMPILE_TEST
721721
select DMA_ENGINE
722722
help
723723
Enable support for Xilinx ZynqMP DMA controller.

drivers/dma/altera-msgdma.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -585,16 +585,14 @@ static void msgdma_chan_desc_cleanup(struct msgdma_device *mdev)
585585
struct msgdma_sw_desc *desc, *next;
586586

587587
list_for_each_entry_safe(desc, next, &mdev->done_list, node) {
588-
dma_async_tx_callback callback;
589-
void *callback_param;
588+
struct dmaengine_desc_callback cb;
590589

591590
list_del(&desc->node);
592591

593-
callback = desc->async_tx.callback;
594-
callback_param = desc->async_tx.callback_param;
595-
if (callback) {
592+
dmaengine_desc_get_callback(&desc->async_tx, &cb);
593+
if (dmaengine_desc_callback_valid(&cb)) {
596594
spin_unlock(&mdev->lock);
597-
callback(callback_param);
595+
dmaengine_desc_callback_invoke(&cb, NULL);
598596
spin_lock(&mdev->lock);
599597
}
600598

drivers/dma/at_xdmac.c

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
#define AT_XDMAC_CC_WRIP (0x1 << 23) /* Write in Progress (read only) */
156156
#define AT_XDMAC_CC_WRIP_DONE (0x0 << 23)
157157
#define AT_XDMAC_CC_WRIP_IN_PROGRESS (0x1 << 23)
158-
#define AT_XDMAC_CC_PERID(i) (0x7f & (i) << 24) /* Channel Peripheral Identifier */
158+
#define AT_XDMAC_CC_PERID(i) ((0x7f & (i)) << 24) /* Channel Peripheral Identifier */
159159
#define AT_XDMAC_CDS_MSP 0x2C /* Channel Data Stride Memory Set Pattern */
160160
#define AT_XDMAC_CSUS 0x30 /* Channel Source Microblock Stride */
161161
#define AT_XDMAC_CDUS 0x34 /* Channel Destination Microblock Stride */
@@ -1926,8 +1926,31 @@ static void at_xdmac_free_chan_resources(struct dma_chan *chan)
19261926
return;
19271927
}
19281928

1929-
#ifdef CONFIG_PM
1930-
static int atmel_xdmac_prepare(struct device *dev)
1929+
static void at_xdmac_axi_config(struct platform_device *pdev)
1930+
{
1931+
struct at_xdmac *atxdmac = (struct at_xdmac *)platform_get_drvdata(pdev);
1932+
bool dev_m2m = false;
1933+
u32 dma_requests;
1934+
1935+
if (!atxdmac->layout->axi_config)
1936+
return; /* Not supported */
1937+
1938+
if (!of_property_read_u32(pdev->dev.of_node, "dma-requests",
1939+
&dma_requests)) {
1940+
dev_info(&pdev->dev, "controller in mem2mem mode.\n");
1941+
dev_m2m = true;
1942+
}
1943+
1944+
if (dev_m2m) {
1945+
at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_M2M);
1946+
at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_M2M);
1947+
} else {
1948+
at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_P2M);
1949+
at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_P2M);
1950+
}
1951+
}
1952+
1953+
static int __maybe_unused atmel_xdmac_prepare(struct device *dev)
19311954
{
19321955
struct at_xdmac *atxdmac = dev_get_drvdata(dev);
19331956
struct dma_chan *chan, *_chan;
@@ -1941,12 +1964,8 @@ static int atmel_xdmac_prepare(struct device *dev)
19411964
}
19421965
return 0;
19431966
}
1944-
#else
1945-
# define atmel_xdmac_prepare NULL
1946-
#endif
19471967

1948-
#ifdef CONFIG_PM_SLEEP
1949-
static int atmel_xdmac_suspend(struct device *dev)
1968+
static int __maybe_unused atmel_xdmac_suspend(struct device *dev)
19501969
{
19511970
struct at_xdmac *atxdmac = dev_get_drvdata(dev);
19521971
struct dma_chan *chan, *_chan;
@@ -1970,18 +1989,21 @@ static int atmel_xdmac_suspend(struct device *dev)
19701989
return 0;
19711990
}
19721991

1973-
static int atmel_xdmac_resume(struct device *dev)
1992+
static int __maybe_unused atmel_xdmac_resume(struct device *dev)
19741993
{
19751994
struct at_xdmac *atxdmac = dev_get_drvdata(dev);
19761995
struct at_xdmac_chan *atchan;
19771996
struct dma_chan *chan, *_chan;
1997+
struct platform_device *pdev = container_of(dev, struct platform_device, dev);
19781998
int i;
19791999
int ret;
19802000

19812001
ret = clk_prepare_enable(atxdmac->clk);
19822002
if (ret)
19832003
return ret;
19842004

2005+
at_xdmac_axi_config(pdev);
2006+
19852007
/* Clear pending interrupts. */
19862008
for (i = 0; i < atxdmac->dma.chancnt; i++) {
19872009
atchan = &atxdmac->chan[i];
@@ -2005,31 +2027,6 @@ static int atmel_xdmac_resume(struct device *dev)
20052027
}
20062028
return 0;
20072029
}
2008-
#endif /* CONFIG_PM_SLEEP */
2009-
2010-
static void at_xdmac_axi_config(struct platform_device *pdev)
2011-
{
2012-
struct at_xdmac *atxdmac = (struct at_xdmac *)platform_get_drvdata(pdev);
2013-
bool dev_m2m = false;
2014-
u32 dma_requests;
2015-
2016-
if (!atxdmac->layout->axi_config)
2017-
return; /* Not supported */
2018-
2019-
if (!of_property_read_u32(pdev->dev.of_node, "dma-requests",
2020-
&dma_requests)) {
2021-
dev_info(&pdev->dev, "controller in mem2mem mode.\n");
2022-
dev_m2m = true;
2023-
}
2024-
2025-
if (dev_m2m) {
2026-
at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_M2M);
2027-
at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_M2M);
2028-
} else {
2029-
at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_P2M);
2030-
at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_P2M);
2031-
}
2032-
}
20332030

20342031
static int at_xdmac_probe(struct platform_device *pdev)
20352032
{
@@ -2210,7 +2207,7 @@ static int at_xdmac_remove(struct platform_device *pdev)
22102207
return 0;
22112208
}
22122209

2213-
static const struct dev_pm_ops atmel_xdmac_dev_pm_ops = {
2210+
static const struct dev_pm_ops __maybe_unused atmel_xdmac_dev_pm_ops = {
22142211
.prepare = atmel_xdmac_prepare,
22152212
SET_LATE_SYSTEM_SLEEP_PM_OPS(atmel_xdmac_suspend, atmel_xdmac_resume)
22162213
};
@@ -2234,7 +2231,7 @@ static struct platform_driver at_xdmac_driver = {
22342231
.driver = {
22352232
.name = "at_xdmac",
22362233
.of_match_table = of_match_ptr(atmel_xdmac_dt_ids),
2237-
.pm = &atmel_xdmac_dev_pm_ops,
2234+
.pm = pm_ptr(&atmel_xdmac_dev_pm_ops),
22382235
}
22392236
};
22402237

drivers/dma/bestcomm/ata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void bcom_ata_reset_bd(struct bcom_task *tsk)
133133
struct bcom_ata_var *var;
134134

135135
/* Reset all BD */
136-
memset(tsk->bd, 0x00, tsk->num_bd * tsk->bd_size);
136+
memset_io(tsk->bd, 0x00, tsk->num_bd * tsk->bd_size);
137137

138138
tsk->index = 0;
139139
tsk->outdex = 0;

drivers/dma/bestcomm/bestcomm.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ bcom_task_alloc(int bd_count, int bd_size, int priv_size)
9595
tsk->bd = bcom_sram_alloc(bd_count * bd_size, 4, &tsk->bd_pa);
9696
if (!tsk->bd)
9797
goto error;
98-
memset(tsk->bd, 0x00, bd_count * bd_size);
98+
memset_io(tsk->bd, 0x00, bd_count * bd_size);
9999

100100
tsk->num_bd = bd_count;
101101
tsk->bd_size = bd_size;
@@ -186,16 +186,16 @@ bcom_load_image(int task, u32 *task_image)
186186
inc = bcom_task_inc(task);
187187

188188
/* Clear & copy */
189-
memset(var, 0x00, BCOM_VAR_SIZE);
190-
memset(inc, 0x00, BCOM_INC_SIZE);
189+
memset_io(var, 0x00, BCOM_VAR_SIZE);
190+
memset_io(inc, 0x00, BCOM_INC_SIZE);
191191

192192
desc_src = (u32 *)(hdr + 1);
193193
var_src = desc_src + hdr->desc_size;
194194
inc_src = var_src + hdr->var_size;
195195

196-
memcpy(desc, desc_src, hdr->desc_size * sizeof(u32));
197-
memcpy(var + hdr->first_var, var_src, hdr->var_size * sizeof(u32));
198-
memcpy(inc, inc_src, hdr->inc_size * sizeof(u32));
196+
memcpy_toio(desc, desc_src, hdr->desc_size * sizeof(u32));
197+
memcpy_toio(var + hdr->first_var, var_src, hdr->var_size * sizeof(u32));
198+
memcpy_toio(inc, inc_src, hdr->inc_size * sizeof(u32));
199199

200200
return 0;
201201
}
@@ -302,13 +302,13 @@ static int bcom_engine_init(void)
302302
return -ENOMEM;
303303
}
304304

305-
memset(bcom_eng->tdt, 0x00, tdt_size);
306-
memset(bcom_eng->ctx, 0x00, ctx_size);
307-
memset(bcom_eng->var, 0x00, var_size);
308-
memset(bcom_eng->fdt, 0x00, fdt_size);
305+
memset_io(bcom_eng->tdt, 0x00, tdt_size);
306+
memset_io(bcom_eng->ctx, 0x00, ctx_size);
307+
memset_io(bcom_eng->var, 0x00, var_size);
308+
memset_io(bcom_eng->fdt, 0x00, fdt_size);
309309

310310
/* Copy the FDT for the EU#3 */
311-
memcpy(&bcom_eng->fdt[48], fdt_ops, sizeof(fdt_ops));
311+
memcpy_toio(&bcom_eng->fdt[48], fdt_ops, sizeof(fdt_ops));
312312

313313
/* Initialize Task base structure */
314314
for (task=0; task<BCOM_MAX_TASKS; task++)

drivers/dma/bestcomm/fec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ bcom_fec_rx_reset(struct bcom_task *tsk)
140140
tsk->index = 0;
141141
tsk->outdex = 0;
142142

143-
memset(tsk->bd, 0x00, tsk->num_bd * tsk->bd_size);
143+
memset_io(tsk->bd, 0x00, tsk->num_bd * tsk->bd_size);
144144

145145
/* Configure some stuff */
146146
bcom_set_task_pragma(tsk->tasknum, BCOM_FEC_RX_BD_PRAGMA);
@@ -241,7 +241,7 @@ bcom_fec_tx_reset(struct bcom_task *tsk)
241241
tsk->index = 0;
242242
tsk->outdex = 0;
243243

244-
memset(tsk->bd, 0x00, tsk->num_bd * tsk->bd_size);
244+
memset_io(tsk->bd, 0x00, tsk->num_bd * tsk->bd_size);
245245

246246
/* Configure some stuff */
247247
bcom_set_task_pragma(tsk->tasknum, BCOM_FEC_TX_BD_PRAGMA);

drivers/dma/bestcomm/gen_bd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ bcom_gen_bd_rx_reset(struct bcom_task *tsk)
142142
tsk->index = 0;
143143
tsk->outdex = 0;
144144

145-
memset(tsk->bd, 0x00, tsk->num_bd * tsk->bd_size);
145+
memset_io(tsk->bd, 0x00, tsk->num_bd * tsk->bd_size);
146146

147147
/* Configure some stuff */
148148
bcom_set_task_pragma(tsk->tasknum, BCOM_GEN_RX_BD_PRAGMA);
@@ -226,7 +226,7 @@ bcom_gen_bd_tx_reset(struct bcom_task *tsk)
226226
tsk->index = 0;
227227
tsk->outdex = 0;
228228

229-
memset(tsk->bd, 0x00, tsk->num_bd * tsk->bd_size);
229+
memset_io(tsk->bd, 0x00, tsk->num_bd * tsk->bd_size);
230230

231231
/* Configure some stuff */
232232
bcom_set_task_pragma(tsk->tasknum, BCOM_GEN_TX_BD_PRAGMA);

drivers/dma/dma-jz4780.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@ static int jz4780_dma_probe(struct platform_device *pdev)
915915
dd->dst_addr_widths = JZ_DMA_BUSWIDTHS;
916916
dd->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
917917
dd->residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
918+
dd->max_sg_burst = JZ_DMA_MAX_DESC;
918919

919920
/*
920921
* Enable DMA controller, mark all channels as not programmable.

drivers/dma/dmaengine.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,13 +695,12 @@ static struct dma_chan *find_candidate(struct dma_device *device,
695695
*/
696696
struct dma_chan *dma_get_slave_channel(struct dma_chan *chan)
697697
{
698-
int err = -EBUSY;
699-
700698
/* lock against __dma_request_channel */
701699
mutex_lock(&dma_list_mutex);
702700

703701
if (chan->client_count == 0) {
704702
struct dma_device *device = chan->device;
703+
int err;
705704

706705
dma_cap_set(DMA_PRIVATE, device->cap_mask);
707706
device->privatecnt++;

0 commit comments

Comments
 (0)