Commit 23db0ed3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull dmaengine fixes from Vinod Koul:
 "Bunch of minor driver fixes for drivers in this cycle:

   - Kernel doc warning documentation fixes

   - apple driver fix for register access

   - amd driver dropping private dma_ops

   - freescale cleanup path fix

   - refcount fix for mv_xor driver

   - null pointer deref fix for at_xdmac driver

   - GENMASK to GENMASK_ULL fix for loongson2 apb driver

   - Tegra driver fix for correcting dma status"

* tag 'dmaengine-fix-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
  dmaengine: tegra: Return correct DMA status when paused
  dmaengine: mv_xor: fix child node refcount handling in early exit
  dmaengine: fsl-edma: implement the cleanup path of fsl_edma3_attach_pd()
  dmaengine: amd: qdma: Remove using the private get and set dma_ops APIs
  dmaengine: apple-admac: Avoid accessing registers in probe
  linux/dmaengine.h: fix a few kernel-doc warnings
  dmaengine: loongson2-apb: Change GENMASK to GENMASK_ULL
  dmaengine: dw: Select only supported masters for ACPI devices
  dmaengine: at_xdmac: avoid null_prt_deref in at_xdmac_prep_dma_memset
parents 6fcb22ef ebc00869
Loading
Loading
Loading
Loading
+12 −16
Original line number Diff line number Diff line
@@ -7,9 +7,9 @@
#include <linux/bitfield.h>
#include <linux/bitops.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/dma-map-ops.h>
#include <linux/platform_device.h>
#include <linux/platform_data/amd_qdma.h>
#include <linux/regmap.h>
@@ -492,18 +492,9 @@ static int qdma_device_verify(struct qdma_device *qdev)

static int qdma_device_setup(struct qdma_device *qdev)
{
	struct device *dev = &qdev->pdev->dev;
	u32 ring_sz = QDMA_DEFAULT_RING_SIZE;
	int ret = 0;

	while (dev && get_dma_ops(dev))
		dev = dev->parent;
	if (!dev) {
		qdma_err(qdev, "dma device not found");
		return -EINVAL;
	}
	set_dma_ops(&qdev->pdev->dev, get_dma_ops(dev));

	ret = qdma_setup_fmap_context(qdev);
	if (ret) {
		qdma_err(qdev, "Failed setup fmap context");
@@ -548,11 +539,12 @@ static void qdma_free_queue_resources(struct dma_chan *chan)
{
	struct qdma_queue *queue = to_qdma_queue(chan);
	struct qdma_device *qdev = queue->qdev;
	struct device *dev = qdev->dma_dev.dev;
	struct qdma_platdata *pdata;

	qdma_clear_queue_context(queue);
	vchan_free_chan_resources(&queue->vchan);
	dma_free_coherent(dev, queue->ring_size * QDMA_MM_DESC_SIZE,
	pdata = dev_get_platdata(&qdev->pdev->dev);
	dma_free_coherent(pdata->dma_dev, queue->ring_size * QDMA_MM_DESC_SIZE,
			  queue->desc_base, queue->dma_desc_base);
}

@@ -565,6 +557,7 @@ static int qdma_alloc_queue_resources(struct dma_chan *chan)
	struct qdma_queue *queue = to_qdma_queue(chan);
	struct qdma_device *qdev = queue->qdev;
	struct qdma_ctxt_sw_desc desc;
	struct qdma_platdata *pdata;
	size_t size;
	int ret;

@@ -572,8 +565,9 @@ static int qdma_alloc_queue_resources(struct dma_chan *chan)
	if (ret)
		return ret;

	pdata = dev_get_platdata(&qdev->pdev->dev);
	size = queue->ring_size * QDMA_MM_DESC_SIZE;
	queue->desc_base = dma_alloc_coherent(qdev->dma_dev.dev, size,
	queue->desc_base = dma_alloc_coherent(pdata->dma_dev, size,
					      &queue->dma_desc_base,
					      GFP_KERNEL);
	if (!queue->desc_base) {
@@ -588,7 +582,7 @@ static int qdma_alloc_queue_resources(struct dma_chan *chan)
	if (ret) {
		qdma_err(qdev, "Failed to setup SW desc ctxt for %s",
			 chan->name);
		dma_free_coherent(qdev->dma_dev.dev, size, queue->desc_base,
		dma_free_coherent(pdata->dma_dev, size, queue->desc_base,
				  queue->dma_desc_base);
		return ret;
	}
@@ -948,8 +942,9 @@ static int qdma_init_error_irq(struct qdma_device *qdev)

static int qdmam_alloc_qintr_rings(struct qdma_device *qdev)
{
	u32 ctxt[QDMA_CTXT_REGMAP_LEN];
	struct qdma_platdata *pdata = dev_get_platdata(&qdev->pdev->dev);
	struct device *dev = &qdev->pdev->dev;
	u32 ctxt[QDMA_CTXT_REGMAP_LEN];
	struct qdma_intr_ring *ring;
	struct qdma_ctxt_intr intr_ctxt;
	u32 vector;
@@ -969,7 +964,8 @@ static int qdmam_alloc_qintr_rings(struct qdma_device *qdev)
		ring->msix_id = qdev->err_irq_idx + i + 1;
		ring->ridx = i;
		ring->color = 1;
		ring->base = dmam_alloc_coherent(dev, QDMA_INTR_RING_SIZE,
		ring->base = dmam_alloc_coherent(pdata->dma_dev,
						 QDMA_INTR_RING_SIZE,
						 &ring->dev_base, GFP_KERNEL);
		if (!ring->base) {
			qdma_err(qdev, "Failed to alloc intr ring %d", i);
+2 −5
Original line number Diff line number Diff line
@@ -153,6 +153,8 @@ static int admac_alloc_sram_carveout(struct admac_data *ad,
{
	struct admac_sram *sram;
	int i, ret = 0, nblocks;
	ad->txcache.size = readl_relaxed(ad->base + REG_TX_SRAM_SIZE);
	ad->rxcache.size = readl_relaxed(ad->base + REG_RX_SRAM_SIZE);

	if (dir == DMA_MEM_TO_DEV)
		sram = &ad->txcache;
@@ -912,12 +914,7 @@ static int admac_probe(struct platform_device *pdev)
		goto free_irq;
	}

	ad->txcache.size = readl_relaxed(ad->base + REG_TX_SRAM_SIZE);
	ad->rxcache.size = readl_relaxed(ad->base + REG_RX_SRAM_SIZE);

	dev_info(&pdev->dev, "Audio DMA Controller\n");
	dev_info(&pdev->dev, "imprint %x TX cache %u RX cache %u\n",
		 readl_relaxed(ad->base + REG_IMPRINT), ad->txcache.size, ad->rxcache.size);

	return 0;

+2 −0
Original line number Diff line number Diff line
@@ -1363,6 +1363,8 @@ at_xdmac_prep_dma_memset(struct dma_chan *chan, dma_addr_t dest, int value,
		return NULL;

	desc = at_xdmac_memset_create_desc(chan, atchan, dest, len, value);
	if (!desc)
		return NULL;
	list_add_tail(&desc->desc_node, &desc->descs_list);

	desc->tx_dma_desc.cookie = -EBUSY;
+4 −2
Original line number Diff line number Diff line
@@ -8,13 +8,15 @@

static bool dw_dma_acpi_filter(struct dma_chan *chan, void *param)
{
	struct dw_dma *dw = to_dw_dma(chan->device);
	struct dw_dma_chip_pdata *data = dev_get_drvdata(dw->dma.dev);
	struct acpi_dma_spec *dma_spec = param;
	struct dw_dma_slave slave = {
		.dma_dev = dma_spec->dev,
		.src_id = dma_spec->slave_id,
		.dst_id = dma_spec->slave_id,
		.m_master = 0,
		.p_master = 1,
		.m_master = data->m_master,
		.p_master = data->p_master,
	};

	return dw_dma_filter(chan, &slave);
+8 −0
Original line number Diff line number Diff line
@@ -51,11 +51,15 @@ struct dw_dma_chip_pdata {
	int (*probe)(struct dw_dma_chip *chip);
	int (*remove)(struct dw_dma_chip *chip);
	struct dw_dma_chip *chip;
	u8 m_master;
	u8 p_master;
};

static __maybe_unused const struct dw_dma_chip_pdata dw_dma_chip_pdata = {
	.probe = dw_dma_probe,
	.remove = dw_dma_remove,
	.m_master = 0,
	.p_master = 1,
};

static const struct dw_dma_platform_data idma32_pdata = {
@@ -72,6 +76,8 @@ static __maybe_unused const struct dw_dma_chip_pdata idma32_chip_pdata = {
	.pdata = &idma32_pdata,
	.probe = idma32_dma_probe,
	.remove = idma32_dma_remove,
	.m_master = 0,
	.p_master = 0,
};

static const struct dw_dma_platform_data xbar_pdata = {
@@ -88,6 +94,8 @@ static __maybe_unused const struct dw_dma_chip_pdata xbar_chip_pdata = {
	.pdata = &xbar_pdata,
	.probe = idma32_dma_probe,
	.remove = idma32_dma_remove,
	.m_master = 0,
	.p_master = 0,
};

#endif /* _DMA_DW_INTERNAL_H */
Loading