Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0ad1771 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'dmaengine-fix-4.10-rc4' of git://git.infradead.org/users/vkoul/slave-dma

Pull dmaengine fixes from Vinod Koul:
 "The fixes this time around are spread over drivers, pretty normal
  update:

   - PCI ID for SKL ioatdma, workaround for SKX and
     ioat_alloc_chan_resources sleepy allocation fix

   - dw kconfig typo fix

   - null pointer deref for stm32

   - MAINTAINERS Update for at_hdmac

   - pl330 runtime pm fixes

   - omap-dma port window fix

   - rcar-dmac unmap slave resource fix"

* tag 'dmaengine-fix-4.10-rc4' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: rcar-dmac: unmap slave resource when channel is freed
  dmaengine: omap-dma: Fix the port_window support
  dmaengine: iota: ioat_alloc_chan_resources should not perform sleeping allocations.
  dmaengine: pl330: Fix runtime PM support for terminated transfers
  MAINTAINERS: dmaengine: Update + Hand over the at_hdmac driver to Ludovic
  dmaengine: omap-dma: Fix dynamic lch_map allocation
  dmaengine: ti-dma-crossbar: Add some 'of_node_put()' in error path.
  dmaengine: stm32-dma: Fix null pointer dereference in stm32_dma_tx_status
  dmaengine: stm32-dma: Set correct args number for DMA request from DT
  dmaengine: dw: fix typo in Kconfig
  dmaengine: ioatdma: workaround SKX ioatdma version
  dmaengine: ioatdma: Add Skylake PCI Dev ID
parents e96f8f18 3139dc8d
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -2193,14 +2193,6 @@ L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S:	Supported
F:	sound/soc/atmel

ATMEL DMA DRIVER
M:	Nicolas Ferre <nicolas.ferre@atmel.com>
L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S:	Supported
F:	drivers/dma/at_hdmac.c
F:	drivers/dma/at_hdmac_regs.h
F:	include/linux/platform_data/dma-atmel.h

ATMEL XDMA DRIVER
M:	Ludovic Desroches <ludovic.desroches@atmel.com>
L:	linux-arm-kernel@lists.infradead.org
@@ -8178,6 +8170,15 @@ S: Maintained
F:	drivers/tty/serial/atmel_serial.c
F:	include/linux/atmel_serial.h

MICROCHIP / ATMEL DMA DRIVER
M:	Ludovic Desroches <ludovic.desroches@microchip.com>
L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
L:	dmaengine@vger.kernel.org
S:	Supported
F:	drivers/dma/at_hdmac.c
F:	drivers/dma/at_hdmac_regs.h
F:	include/linux/platform_data/dma-atmel.h

MICROCHIP / ATMEL ISC DRIVER
M:	Songjun Wu <songjun.wu@microchip.com>
L:	linux-media@vger.kernel.org
+1 −1
Original line number Diff line number Diff line
@@ -24,5 +24,5 @@ config DW_DMAC_PCI
	select DW_DMAC_CORE
	help
	  Support the Synopsys DesignWare AHB DMA controller on the
	  platfroms that enumerate it as a PCI device. For example,
	  platforms that enumerate it as a PCI device. For example,
	  Intel Medfield has integrated this GPDMA controller.
+2 −0
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@
#define PCI_DEVICE_ID_INTEL_IOAT_BDX8	0x6f2e
#define PCI_DEVICE_ID_INTEL_IOAT_BDX9	0x6f2f

#define PCI_DEVICE_ID_INTEL_IOAT_SKX	0x2021

#define IOAT_VER_1_2            0x12    /* Version 1.2 */
#define IOAT_VER_2_0            0x20    /* Version 2.0 */
#define IOAT_VER_3_0            0x30    /* Version 3.0 */
+12 −3
Original line number Diff line number Diff line
@@ -106,6 +106,8 @@ static struct pci_device_id ioat_pci_tbl[] = {
	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BDX8) },
	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BDX9) },

	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_SKX) },

	/* I/OAT v3.3 platforms */
	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BWD0) },
	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BWD1) },
@@ -243,10 +245,15 @@ static bool is_bdx_ioat(struct pci_dev *pdev)
	}
}

static inline bool is_skx_ioat(struct pci_dev *pdev)
{
	return (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_SKX) ? true : false;
}

static bool is_xeon_cb32(struct pci_dev *pdev)
{
	return is_jf_ioat(pdev) || is_snb_ioat(pdev) || is_ivb_ioat(pdev) ||
		is_hsw_ioat(pdev) || is_bdx_ioat(pdev);
		is_hsw_ioat(pdev) || is_bdx_ioat(pdev) || is_skx_ioat(pdev);
}

bool is_bwd_ioat(struct pci_dev *pdev)
@@ -693,7 +700,7 @@ static int ioat_alloc_chan_resources(struct dma_chan *c)
	/* doing 2 32bit writes to mmio since 1 64b write doesn't work */
	ioat_chan->completion =
		dma_pool_zalloc(ioat_chan->ioat_dma->completion_pool,
				GFP_KERNEL, &ioat_chan->completion_dma);
				GFP_NOWAIT, &ioat_chan->completion_dma);
	if (!ioat_chan->completion)
		return -ENOMEM;

@@ -703,7 +710,7 @@ static int ioat_alloc_chan_resources(struct dma_chan *c)
	       ioat_chan->reg_base + IOAT_CHANCMP_OFFSET_HIGH);

	order = IOAT_MAX_ORDER;
	ring = ioat_alloc_ring(c, order, GFP_KERNEL);
	ring = ioat_alloc_ring(c, order, GFP_NOWAIT);
	if (!ring)
		return -ENOMEM;

@@ -1357,6 +1364,8 @@ static int ioat_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)

	device->version = readb(device->reg_base + IOAT_VER_OFFSET);
	if (device->version >= IOAT_VER_3_0) {
		if (is_skx_ioat(pdev))
			device->version = IOAT_VER_3_2;
		err = ioat3_dma_probe(device, ioat_dca_enabled);

		if (device->version >= IOAT_VER_3_3)
+37 −24
Original line number Diff line number Diff line
@@ -938,21 +938,14 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg(
		d->ccr |= CCR_DST_AMODE_POSTINC;
		if (port_window) {
			d->ccr |= CCR_SRC_AMODE_DBLIDX;
			d->ei = 1;
			/*
			 * One frame covers the port_window and by  configure
			 * the source frame index to be -1 * (port_window - 1)
			 * we instruct the sDMA that after a frame is processed
			 * it should move back to the start of the window.
			 */
			d->fi = -(port_window_bytes - 1);

			if (port_window_bytes >= 64)
				d->csdp = CSDP_SRC_BURST_64 | CSDP_SRC_PACKED;
				d->csdp |= CSDP_SRC_BURST_64;
			else if (port_window_bytes >= 32)
				d->csdp = CSDP_SRC_BURST_32 | CSDP_SRC_PACKED;
				d->csdp |= CSDP_SRC_BURST_32;
			else if (port_window_bytes >= 16)
				d->csdp = CSDP_SRC_BURST_16 | CSDP_SRC_PACKED;
				d->csdp |= CSDP_SRC_BURST_16;

		} else {
			d->ccr |= CCR_SRC_AMODE_CONSTANT;
		}
@@ -962,13 +955,21 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg(
		d->ccr |= CCR_SRC_AMODE_POSTINC;
		if (port_window) {
			d->ccr |= CCR_DST_AMODE_DBLIDX;
			d->ei = 1;
			/*
			 * One frame covers the port_window and by  configure
			 * the source frame index to be -1 * (port_window - 1)
			 * we instruct the sDMA that after a frame is processed
			 * it should move back to the start of the window.
			 */
			d->fi = -(port_window_bytes - 1);

			if (port_window_bytes >= 64)
				d->csdp = CSDP_DST_BURST_64 | CSDP_DST_PACKED;
				d->csdp |= CSDP_DST_BURST_64;
			else if (port_window_bytes >= 32)
				d->csdp = CSDP_DST_BURST_32 | CSDP_DST_PACKED;
				d->csdp |= CSDP_DST_BURST_32;
			else if (port_window_bytes >= 16)
				d->csdp = CSDP_DST_BURST_16 | CSDP_DST_PACKED;
				d->csdp |= CSDP_DST_BURST_16;
		} else {
			d->ccr |= CCR_DST_AMODE_CONSTANT;
		}
@@ -1017,7 +1018,7 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg(
		osg->addr = sg_dma_address(sgent);
		osg->en = en;
		osg->fn = sg_dma_len(sgent) / frame_bytes;
		if (port_window && dir == DMA_MEM_TO_DEV) {
		if (port_window && dir == DMA_DEV_TO_MEM) {
			osg->ei = 1;
			/*
			 * One frame covers the port_window and by  configure
@@ -1452,6 +1453,7 @@ static int omap_dma_probe(struct platform_device *pdev)
	struct omap_dmadev *od;
	struct resource *res;
	int rc, i, irq;
	u32 lch_count;

	od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL);
	if (!od)
@@ -1494,20 +1496,31 @@ static int omap_dma_probe(struct platform_device *pdev)
	spin_lock_init(&od->lock);
	spin_lock_init(&od->irq_lock);

	if (!pdev->dev.of_node) {
		od->dma_requests = od->plat->dma_attr->lch_count;
		if (unlikely(!od->dma_requests))
	/* Number of DMA requests */
	od->dma_requests = OMAP_SDMA_REQUESTS;
	} else if (of_property_read_u32(pdev->dev.of_node, "dma-requests",
	if (pdev->dev.of_node && of_property_read_u32(pdev->dev.of_node,
						      "dma-requests",
						      &od->dma_requests)) {
		dev_info(&pdev->dev,
			 "Missing dma-requests property, using %u.\n",
			 OMAP_SDMA_REQUESTS);
		od->dma_requests = OMAP_SDMA_REQUESTS;
	}

	od->lch_map = devm_kcalloc(&pdev->dev, od->dma_requests,
				   sizeof(*od->lch_map), GFP_KERNEL);
	/* Number of available logical channels */
	if (!pdev->dev.of_node) {
		lch_count = od->plat->dma_attr->lch_count;
		if (unlikely(!lch_count))
			lch_count = OMAP_SDMA_CHANNELS;
	} else if (of_property_read_u32(pdev->dev.of_node, "dma-channels",
					&lch_count)) {
		dev_info(&pdev->dev,
			 "Missing dma-channels property, using %u.\n",
			 OMAP_SDMA_CHANNELS);
		lch_count = OMAP_SDMA_CHANNELS;
	}

	od->lch_map = devm_kcalloc(&pdev->dev, lch_count, sizeof(*od->lch_map),
				   GFP_KERNEL);
	if (!od->lch_map)
		return -ENOMEM;

Loading