Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'dmaengine_topic_slave_id_removal_5.17' into next

Merge the tag dmaengine_topic_slave_id_removal_5.17 into next. This
brings in the slave_id removal topic changes

+117 -63
-6
drivers/dma/mmp_pdma.c
··· 727 727 728 728 chan->dir = direction; 729 729 chan->dev_addr = addr; 730 - /* FIXME: drivers should be ported over to use the filter 731 - * function. Once that's done, the following two lines can 732 - * be removed. 733 - */ 734 - if (cfg->slave_id) 735 - chan->drcmr = cfg->slave_id; 736 730 737 731 return 0; 738 732 }
-7
drivers/dma/pxa_dma.c
··· 909 909 *dcmd |= PXA_DCMD_BURST16; 910 910 else if (maxburst == 32) 911 911 *dcmd |= PXA_DCMD_BURST32; 912 - 913 - /* FIXME: drivers should be ported over to use the filter 914 - * function. Once that's done, the following two lines can 915 - * be removed. 916 - */ 917 - if (chan->cfg.slave_id) 918 - chan->drcmr = chan->cfg.slave_id; 919 912 } 920 913 921 914 static struct dma_async_tx_descriptor *
+49 -7
drivers/dma/qcom/qcom_adm.c
··· 8 8 #include <linux/device.h> 9 9 #include <linux/dmaengine.h> 10 10 #include <linux/dma-mapping.h> 11 + #include <linux/dma/qcom_adm.h> 11 12 #include <linux/init.h> 12 13 #include <linux/interrupt.h> 13 14 #include <linux/io.h> ··· 141 140 142 141 struct adm_async_desc *curr_txd; 143 142 struct dma_slave_config slave; 143 + u32 crci; 144 + u32 mux; 144 145 struct list_head node; 145 146 146 147 int error; ··· 382 379 return ERR_PTR(-EINVAL); 383 380 } 384 381 385 - crci = achan->slave.slave_id & 0xf; 386 - if (!crci || achan->slave.slave_id > 0x1f) { 382 + crci = achan->crci & 0xf; 383 + if (!crci || achan->crci > 0x1f) { 387 384 dev_err(adev->dev, "invalid crci value\n"); 388 385 return ERR_PTR(-EINVAL); 389 386 } ··· 406 403 if (!async_desc) 407 404 return ERR_PTR(-ENOMEM); 408 405 409 - if (crci) 410 - async_desc->mux = achan->slave.slave_id & ADM_CRCI_MUX_SEL ? 411 - ADM_CRCI_CTL_MUX_SEL : 0; 406 + async_desc->mux = achan->mux ? ADM_CRCI_CTL_MUX_SEL : 0; 412 407 async_desc->crci = crci; 413 408 async_desc->blk_size = blk_size; 414 409 async_desc->dma_len = single_count * sizeof(struct adm_desc_hw_single) + ··· 489 488 static int adm_slave_config(struct dma_chan *chan, struct dma_slave_config *cfg) 490 489 { 491 490 struct adm_chan *achan = to_adm_chan(chan); 491 + struct qcom_adm_peripheral_config *config = cfg->peripheral_config; 492 492 unsigned long flag; 493 493 494 494 spin_lock_irqsave(&achan->vc.lock, flag); 495 495 memcpy(&achan->slave, cfg, sizeof(struct dma_slave_config)); 496 + if (cfg->peripheral_size == sizeof(config)) 497 + achan->crci = config->crci; 496 498 spin_unlock_irqrestore(&achan->vc.lock, flag); 497 499 498 500 return 0; ··· 698 694 achan->vc.desc_free = adm_dma_free_desc; 699 695 } 700 696 697 + /** 698 + * adm_dma_xlate 699 + * @dma_spec: pointer to DMA specifier as found in the device tree 700 + * @ofdma: pointer to DMA controller data 701 + * 702 + * This can use either 1-cell or 2-cell formats, the first cell 703 + * identifies the slave device, while the optional second cell 704 + * contains the crci value. 705 + * 706 + * Returns pointer to appropriate dma channel on success or NULL on error. 707 + */ 708 + static struct dma_chan *adm_dma_xlate(struct of_phandle_args *dma_spec, 709 + struct of_dma *ofdma) 710 + { 711 + struct dma_device *dev = ofdma->of_dma_data; 712 + struct dma_chan *chan, *candidate = NULL; 713 + struct adm_chan *achan; 714 + 715 + if (!dev || dma_spec->args_count > 2) 716 + return NULL; 717 + 718 + list_for_each_entry(chan, &dev->channels, device_node) 719 + if (chan->chan_id == dma_spec->args[0]) { 720 + candidate = chan; 721 + break; 722 + } 723 + 724 + if (!candidate) 725 + return NULL; 726 + 727 + achan = to_adm_chan(candidate); 728 + if (dma_spec->args_count == 2) 729 + achan->crci = dma_spec->args[1]; 730 + else 731 + achan->crci = 0; 732 + 733 + return dma_get_slave_channel(candidate); 734 + } 735 + 701 736 static int adm_dma_probe(struct platform_device *pdev) 702 737 { 703 738 struct adm_device *adev; ··· 881 838 goto err_disable_clks; 882 839 } 883 840 884 - ret = of_dma_controller_register(pdev->dev.of_node, 885 - of_dma_xlate_by_chan_id, 841 + ret = of_dma_controller_register(pdev->dev.of_node, adm_dma_xlate, 886 842 &adev->common); 887 843 if (ret) 888 844 goto err_unregister_dma;
-8
drivers/dma/sh/shdma-base.c
··· 787 787 return -EINVAL; 788 788 789 789 /* 790 - * overriding the slave_id through dma_slave_config is deprecated, 791 - * but possibly some out-of-tree drivers still do it. 792 - */ 793 - if (WARN_ON_ONCE(config->slave_id && 794 - config->slave_id != schan->real_slave_id)) 795 - schan->real_slave_id = config->slave_id; 796 - 797 - /* 798 790 * We could lock this, but you shouldn't be configuring the 799 791 * channel, while using it... 800 792 */
-3
drivers/dma/sprd-dma.c
··· 795 795 return dst_datawidth; 796 796 } 797 797 798 - if (slave_cfg->slave_id) 799 - schan->dev_id = slave_cfg->slave_id; 800 - 801 798 hw->cfg = SPRD_DMA_DONOT_WAIT_BDONE << SPRD_DMA_WAIT_BDONE_OFFSET; 802 799 803 800 /*
-6
drivers/dma/tegra20-apb-dma.c
··· 343 343 } 344 344 345 345 memcpy(&tdc->dma_sconfig, sconfig, sizeof(*sconfig)); 346 - if (tdc->slave_id == TEGRA_APBDMA_SLAVE_ID_INVALID && 347 - sconfig->device_fc) { 348 - if (sconfig->slave_id > TEGRA_APBDMA_CSR_REQ_SEL_MASK) 349 - return -EINVAL; 350 - tdc->slave_id = sconfig->slave_id; 351 - } 352 346 tdc->config_init = true; 353 347 354 348 return 0;
+11 -6
drivers/dma/xilinx/xilinx_dpdma.c
··· 12 12 #include <linux/clk.h> 13 13 #include <linux/debugfs.h> 14 14 #include <linux/delay.h> 15 + #include <linux/dma/xilinx_dpdma.h> 15 16 #include <linux/dmaengine.h> 16 17 #include <linux/dmapool.h> 17 18 #include <linux/interrupt.h> ··· 1274 1273 struct dma_slave_config *config) 1275 1274 { 1276 1275 struct xilinx_dpdma_chan *chan = to_xilinx_chan(dchan); 1276 + struct xilinx_dpdma_peripheral_config *pconfig; 1277 1277 unsigned long flags; 1278 1278 1279 1279 /* ··· 1284 1282 * fixed both on the DPDMA side and on the DP controller side. 1285 1283 */ 1286 1284 1287 - spin_lock_irqsave(&chan->lock, flags); 1288 - 1289 1285 /* 1290 - * Abuse the slave_id to indicate that the channel is part of a video 1291 - * group. 1286 + * Use the peripheral_config to indicate that the channel is part 1287 + * of a video group. This requires matching use of the custom 1288 + * structure in each driver. 1292 1289 */ 1293 - if (chan->id <= ZYNQMP_DPDMA_VIDEO2) 1294 - chan->video_group = config->slave_id != 0; 1290 + pconfig = config->peripheral_config; 1291 + if (WARN_ON(pconfig && config->peripheral_size != sizeof(*pconfig))) 1292 + return -EINVAL; 1295 1293 1294 + spin_lock_irqsave(&chan->lock, flags); 1295 + if (chan->id <= ZYNQMP_DPDMA_VIDEO2 && pconfig) 1296 + chan->video_group = pconfig->video_group; 1296 1297 spin_unlock_irqrestore(&chan->lock, flags); 1297 1298 1298 1299 return 0;
+7 -2
drivers/gpu/drm/xlnx/zynqmp_disp.c
··· 24 24 25 25 #include <linux/clk.h> 26 26 #include <linux/delay.h> 27 + #include <linux/dma/xilinx_dpdma.h> 27 28 #include <linux/dma-mapping.h> 28 29 #include <linux/dmaengine.h> 29 30 #include <linux/module.h> ··· 1059 1058 zynqmp_disp_avbuf_set_format(layer->disp, layer, layer->disp_fmt); 1060 1059 1061 1060 /* 1062 - * Set slave_id for each DMA channel to indicate they're part of a 1061 + * Set pconfig for each DMA channel to indicate they're part of a 1063 1062 * video group. 1064 1063 */ 1065 1064 for (i = 0; i < info->num_planes; i++) { 1066 1065 struct zynqmp_disp_layer_dma *dma = &layer->dmas[i]; 1066 + struct xilinx_dpdma_peripheral_config pconfig = { 1067 + .video_group = true, 1068 + }; 1067 1069 struct dma_slave_config config = { 1068 1070 .direction = DMA_MEM_TO_DEV, 1069 - .slave_id = 1, 1071 + .peripheral_config = &pconfig, 1072 + .peripheral_size = sizeof(pconfig), 1070 1073 }; 1071 1074 1072 1075 dmaengine_slave_config(dma->chan, &config);
-2
drivers/mmc/host/bcm2835.c
··· 1293 1293 1294 1294 host->dma_cfg_tx.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 1295 1295 host->dma_cfg_tx.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 1296 - host->dma_cfg_tx.slave_id = 13; /* DREQ channel */ 1297 1296 host->dma_cfg_tx.direction = DMA_MEM_TO_DEV; 1298 1297 host->dma_cfg_tx.src_addr = 0; 1299 1298 host->dma_cfg_tx.dst_addr = host->phys_addr + SDDATA; 1300 1299 1301 1300 host->dma_cfg_rx.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 1302 1301 host->dma_cfg_rx.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 1303 - host->dma_cfg_rx.slave_id = 13; /* DREQ channel */ 1304 1302 host->dma_cfg_rx.direction = DMA_DEV_TO_MEM; 1305 1303 host->dma_cfg_rx.src_addr = host->phys_addr + SDDATA; 1306 1304 host->dma_cfg_rx.dst_addr = 0;
+12 -2
drivers/mtd/nand/raw/qcom_nandc.c
··· 6 6 #include <linux/clk.h> 7 7 #include <linux/slab.h> 8 8 #include <linux/bitops.h> 9 + #include <linux/dma/qcom_adm.h> 9 10 #include <linux/dma-mapping.h> 10 11 #include <linux/dmaengine.h> 11 12 #include <linux/module.h> ··· 953 952 struct dma_async_tx_descriptor *dma_desc; 954 953 struct scatterlist *sgl; 955 954 struct dma_slave_config slave_conf; 955 + struct qcom_adm_peripheral_config periph_conf = {}; 956 956 enum dma_transfer_direction dir_eng; 957 957 int ret; 958 958 ··· 985 983 if (read) { 986 984 slave_conf.src_maxburst = 16; 987 985 slave_conf.src_addr = nandc->base_dma + reg_off; 988 - slave_conf.slave_id = nandc->data_crci; 986 + if (nandc->data_crci) { 987 + periph_conf.crci = nandc->data_crci; 988 + slave_conf.peripheral_config = &periph_conf; 989 + slave_conf.peripheral_size = sizeof(periph_conf); 990 + } 989 991 } else { 990 992 slave_conf.dst_maxburst = 16; 991 993 slave_conf.dst_addr = nandc->base_dma + reg_off; 992 - slave_conf.slave_id = nandc->cmd_crci; 994 + if (nandc->cmd_crci) { 995 + periph_conf.crci = nandc->cmd_crci; 996 + slave_conf.peripheral_config = &periph_conf; 997 + slave_conf.peripheral_size = sizeof(periph_conf); 998 + } 993 999 } 994 1000 995 1001 ret = dmaengine_slave_config(nandc->chan, &slave_conf);
-2
drivers/spi/spi-pic32.c
··· 370 370 cfg.src_addr_width = dma_width; 371 371 cfg.dst_addr_width = dma_width; 372 372 /* tx channel */ 373 - cfg.slave_id = pic32s->tx_irq; 374 373 cfg.direction = DMA_MEM_TO_DEV; 375 374 ret = dmaengine_slave_config(master->dma_tx, &cfg); 376 375 if (ret) { ··· 377 378 return ret; 378 379 } 379 380 /* rx channel */ 380 - cfg.slave_id = pic32s->rx_irq; 381 381 cfg.direction = DMA_DEV_TO_MEM; 382 382 ret = dmaengine_slave_config(master->dma_rx, &cfg); 383 383 if (ret)
+13 -2
drivers/tty/serial/msm_serial.c
··· 9 9 10 10 #include <linux/kernel.h> 11 11 #include <linux/atomic.h> 12 + #include <linux/dma/qcom_adm.h> 12 13 #include <linux/dma-mapping.h> 13 14 #include <linux/dmaengine.h> 14 15 #include <linux/module.h> ··· 291 290 { 292 291 struct device *dev = msm_port->uart.dev; 293 292 struct dma_slave_config conf; 293 + struct qcom_adm_peripheral_config periph_conf = {}; 294 294 struct msm_dma *dma; 295 295 u32 crci = 0; 296 296 int ret; ··· 310 308 conf.device_fc = true; 311 309 conf.dst_addr = base + UARTDM_TF; 312 310 conf.dst_maxburst = UARTDM_BURST_SIZE; 313 - conf.slave_id = crci; 311 + if (crci) { 312 + conf.peripheral_config = &periph_conf; 313 + conf.peripheral_size = sizeof(periph_conf); 314 + periph_conf.crci = crci; 315 + } 314 316 315 317 ret = dmaengine_slave_config(dma->chan, &conf); 316 318 if (ret) ··· 339 333 { 340 334 struct device *dev = msm_port->uart.dev; 341 335 struct dma_slave_config conf; 336 + struct qcom_adm_peripheral_config periph_conf = {}; 342 337 struct msm_dma *dma; 343 338 u32 crci = 0; 344 339 int ret; ··· 362 355 conf.device_fc = true; 363 356 conf.src_addr = base + UARTDM_RF; 364 357 conf.src_maxburst = UARTDM_BURST_SIZE; 365 - conf.slave_id = crci; 358 + if (crci) { 359 + conf.peripheral_config = &periph_conf; 360 + conf.peripheral_size = sizeof(periph_conf); 361 + periph_conf.crci = crci; 362 + } 366 363 367 364 ret = dmaengine_slave_config(dma->chan, &conf); 368 365 if (ret)
+12
include/linux/dma/qcom_adm.h
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + #ifndef __LINUX_DMA_QCOM_ADM_H 3 + #define __LINUX_DMA_QCOM_ADM_H 4 + 5 + #include <linux/types.h> 6 + 7 + struct qcom_adm_peripheral_config { 8 + u32 crci; 9 + u32 mux; 10 + }; 11 + 12 + #endif /* __LINUX_DMA_QCOM_ADM_H */
+11
include/linux/dma/xilinx_dpdma.h
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + #ifndef __LINUX_DMA_XILINX_DPDMA_H 3 + #define __LINUX_DMA_XILINX_DPDMA_H 4 + 5 + #include <linux/types.h> 6 + 7 + struct xilinx_dpdma_peripheral_config { 8 + bool video_group; 9 + }; 10 + 11 + #endif /* __LINUX_DMA_XILINX_DPDMA_H */
-4
include/linux/dmaengine.h
··· 419 419 * @device_fc: Flow Controller Settings. Only valid for slave channels. Fill 420 420 * with 'true' if peripheral should be flow controller. Direction will be 421 421 * selected at Runtime. 422 - * @slave_id: Slave requester id. Only valid for slave channels. The dma 423 - * slave peripheral will have unique id as dma requester which need to be 424 - * pass as slave config. 425 422 * @peripheral_config: peripheral configuration for programming peripheral 426 423 * for dmaengine transfer 427 424 * @peripheral_size: peripheral configuration buffer size ··· 446 449 u32 src_port_window_size; 447 450 u32 dst_port_window_size; 448 451 bool device_fc; 449 - unsigned int slave_id; 450 452 void *peripheral_config; 451 453 size_t peripheral_size; 452 454 };
-2
include/sound/dmaengine_pcm.h
··· 60 60 * @maxburst: Maximum number of words(note: words, as in units of the 61 61 * src_addr_width member, not bytes) that can be send to or received from the 62 62 * DAI in one burst. 63 - * @slave_id: Slave requester id for the DMA channel. 64 63 * @filter_data: Custom DMA channel filter data, this will usually be used when 65 64 * requesting the DMA channel. 66 65 * @chan_name: Custom channel name to use when requesting DMA channel. ··· 73 74 dma_addr_t addr; 74 75 enum dma_slave_buswidth addr_width; 75 76 u32 maxburst; 76 - unsigned int slave_id; 77 77 void *filter_data; 78 78 const char *chan_name; 79 79 unsigned int fifo_size;
+2 -3
sound/core/pcm_dmaengine.c
··· 91 91 * @dma_data: DAI DMA data 92 92 * @slave_config: DMA slave configuration 93 93 * 94 - * Initializes the {dst,src}_addr, {dst,src}_maxburst, {dst,src}_addr_width and 95 - * slave_id fields of the DMA slave config from the same fields of the DAI DMA 94 + * Initializes the {dst,src}_addr, {dst,src}_maxburst, {dst,src}_addr_width 95 + * fields of the DMA slave config from the same fields of the DAI DMA 96 96 * data struct. The src and dst fields will be initialized depending on the 97 97 * direction of the substream. If the substream is a playback stream the dst 98 98 * fields will be initialized, if it is a capture stream the src fields will be ··· 124 124 slave_config->src_addr_width = dma_data->addr_width; 125 125 } 126 126 127 - slave_config->slave_id = dma_data->slave_id; 128 127 slave_config->peripheral_config = dma_data->peripheral_config; 129 128 slave_config->peripheral_size = dma_data->peripheral_size; 130 129 }
-1
sound/soc/tegra/tegra20_spdif.c
··· 290 290 spdif->playback_dma_data.addr = mem->start + TEGRA20_SPDIF_DATA_OUT; 291 291 spdif->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 292 292 spdif->playback_dma_data.maxburst = 4; 293 - spdif->playback_dma_data.slave_id = dmareq->start; 294 293 295 294 pm_runtime_enable(&pdev->dev); 296 295