Commit e68a7d35 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
  ...
parents d4efc0de eb91224e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@ Required properties:
  the secure world.
- qcom,controlled-remotely : optional, indicates that the bam is controlled by
  remote proccessor i.e. execution environment.
- qcom,powered-remotely : optional, indicates that the bam is powered up by
  a remote processor but must be initialized by the local processor.
- num-channels : optional, indicates supported number of DMA channels in a
  remotely controlled bam.
- qcom,num-ees : optional, indicates supported number of Execution Environments
+1 −1
Original line number Diff line number Diff line
@@ -717,7 +717,7 @@ config XILINX_DMA

config XILINX_ZYNQMP_DMA
	tristate "Xilinx ZynqMP DMA Engine"
	depends on (ARCH_ZYNQ || MICROBLAZE || ARM64)
	depends on ARCH_ZYNQ || MICROBLAZE || ARM64 || COMPILE_TEST
	select DMA_ENGINE
	help
	  Enable support for Xilinx ZynqMP DMA controller.
+4 −6
Original line number Diff line number Diff line
@@ -585,16 +585,14 @@ static void msgdma_chan_desc_cleanup(struct msgdma_device *mdev)
	struct msgdma_sw_desc *desc, *next;

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

		list_del(&desc->node);

		callback = desc->async_tx.callback;
		callback_param = desc->async_tx.callback_param;
		if (callback) {
		dmaengine_desc_get_callback(&desc->async_tx, &cb);
		if (dmaengine_desc_callback_valid(&cb)) {
			spin_unlock(&mdev->lock);
			callback(callback_param);
			dmaengine_desc_callback_invoke(&cb, NULL);
			spin_lock(&mdev->lock);
		}

+33 −36
Original line number Diff line number Diff line
@@ -155,7 +155,7 @@
#define		AT_XDMAC_CC_WRIP	(0x1 << 23)	/* Write in Progress (read only) */
#define			AT_XDMAC_CC_WRIP_DONE		(0x0 << 23)
#define			AT_XDMAC_CC_WRIP_IN_PROGRESS	(0x1 << 23)
#define		AT_XDMAC_CC_PERID(i)	(0x7f & (i) << 24)	/* Channel Peripheral Identifier */
#define		AT_XDMAC_CC_PERID(i)	((0x7f & (i)) << 24)	/* Channel Peripheral Identifier */
#define AT_XDMAC_CDS_MSP	0x2C	/* Channel Data Stride Memory Set Pattern */
#define AT_XDMAC_CSUS		0x30	/* Channel Source Microblock Stride */
#define AT_XDMAC_CDUS		0x34	/* Channel Destination Microblock Stride */
@@ -1926,8 +1926,31 @@ static void at_xdmac_free_chan_resources(struct dma_chan *chan)
	return;
}

#ifdef CONFIG_PM
static int atmel_xdmac_prepare(struct device *dev)
static void at_xdmac_axi_config(struct platform_device *pdev)
{
	struct at_xdmac	*atxdmac = (struct at_xdmac *)platform_get_drvdata(pdev);
	bool dev_m2m = false;
	u32 dma_requests;

	if (!atxdmac->layout->axi_config)
		return; /* Not supported */

	if (!of_property_read_u32(pdev->dev.of_node, "dma-requests",
				  &dma_requests)) {
		dev_info(&pdev->dev, "controller in mem2mem mode.\n");
		dev_m2m = true;
	}

	if (dev_m2m) {
		at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_M2M);
		at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_M2M);
	} else {
		at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_P2M);
		at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_P2M);
	}
}

static int __maybe_unused atmel_xdmac_prepare(struct device *dev)
{
	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
	struct dma_chan		*chan, *_chan;
@@ -1941,12 +1964,8 @@ static int atmel_xdmac_prepare(struct device *dev)
	}
	return 0;
}
#else
#	define atmel_xdmac_prepare NULL
#endif

#ifdef CONFIG_PM_SLEEP
static int atmel_xdmac_suspend(struct device *dev)
static int __maybe_unused atmel_xdmac_suspend(struct device *dev)
{
	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
	struct dma_chan		*chan, *_chan;
@@ -1970,11 +1989,12 @@ static int atmel_xdmac_suspend(struct device *dev)
	return 0;
}

static int atmel_xdmac_resume(struct device *dev)
static int __maybe_unused atmel_xdmac_resume(struct device *dev)
{
	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
	struct at_xdmac_chan	*atchan;
	struct dma_chan		*chan, *_chan;
	struct platform_device	*pdev = container_of(dev, struct platform_device, dev);
	int			i;
	int ret;

@@ -1982,6 +2002,8 @@ static int atmel_xdmac_resume(struct device *dev)
	if (ret)
		return ret;

	at_xdmac_axi_config(pdev);

	/* Clear pending interrupts. */
	for (i = 0; i < atxdmac->dma.chancnt; i++) {
		atchan = &atxdmac->chan[i];
@@ -2005,31 +2027,6 @@ static int atmel_xdmac_resume(struct device *dev)
	}
	return 0;
}
#endif /* CONFIG_PM_SLEEP */

static void at_xdmac_axi_config(struct platform_device *pdev)
{
	struct at_xdmac	*atxdmac = (struct at_xdmac *)platform_get_drvdata(pdev);
	bool dev_m2m = false;
	u32 dma_requests;

	if (!atxdmac->layout->axi_config)
		return; /* Not supported */

	if (!of_property_read_u32(pdev->dev.of_node, "dma-requests",
				  &dma_requests)) {
		dev_info(&pdev->dev, "controller in mem2mem mode.\n");
		dev_m2m = true;
	}

	if (dev_m2m) {
		at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_M2M);
		at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_M2M);
	} else {
		at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_P2M);
		at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_P2M);
	}
}

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

static const struct dev_pm_ops atmel_xdmac_dev_pm_ops = {
static const struct dev_pm_ops __maybe_unused atmel_xdmac_dev_pm_ops = {
	.prepare	= atmel_xdmac_prepare,
	SET_LATE_SYSTEM_SLEEP_PM_OPS(atmel_xdmac_suspend, atmel_xdmac_resume)
};
@@ -2234,7 +2231,7 @@ static struct platform_driver at_xdmac_driver = {
	.driver = {
		.name		= "at_xdmac",
		.of_match_table	= of_match_ptr(atmel_xdmac_dt_ids),
		.pm		= &atmel_xdmac_dev_pm_ops,
		.pm		= pm_ptr(&atmel_xdmac_dev_pm_ops),
	}
};

+1 −1
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ void bcom_ata_reset_bd(struct bcom_task *tsk)
	struct bcom_ata_var *var;

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

	tsk->index = 0;
	tsk->outdex = 0;
Loading