Skip to contentSkip to conversation

dmaengine: dw: Enable for Intel Elkhart Lake

PATCH Applied Andy Shevchenko 2 participants 15 messages Aug 20, 2019 – Aug 29, 2019

Subsystems (2)
lore
Share & tools
lore

Andy Shevchenko

author reviewer
#0 lore raw

v2 cover dmaengine: dw: Enable for Intel Elkhart Lake

On Intel Elkhart Lake the DMA controllers can be provided by Intel® PSE (Programmable Services Engine) and exposed either as PCI or ACPI devices.

To support both schemes here is a patch series.

First two patches fixes minor issues in DMA ACPI layer, patches 3-5 enables Intel Elkhart Lake DMA controllers that exposed as ACPI devices, patch 6 is clean up, patch 7 is fix for possible race on ->remove() stage, patch 8 is follow up clean up and patches 9-10 is a split for better maintenance.

Changelog v2:
- spell correctly Intel® PSE in the code and commit messages (Jarkko)
- drop couple of not needed right now patches against DMA ACPI layer

Andy Shevchenko (10):
dmaengine: acpi: Set up DMA mask based on CSRT
dmaengine: acpi: Add kernel doc parameter descriptions
dmaengine: dw: Export struct dw_dma_chip_pdata for wider use
dmaengine: dw: platform: Use struct dw_dma_chip_pdata
dmaengine: dw: platform: Enable iDMA 32-bit on Intel Elkhart Lake
dmaengine: dw: platform: Use devm_platform_ioremap_resource()
dmaengine: dw: platform: Switch to acpi_dma_controller_register()
dmaengine: dw: platform: Move handle check to
dw_dma_acpi_controller_register()
dmaengine: dw: platform: Split ACPI helpers to separate module
dmaengine: dw: platform: Split OF helpers to separate module

 drivers/dma/acpi-dma.c    |  12 ++-
 drivers/dma/dw/Makefile   |   4 +-
 drivers/dma/dw/acpi.c     |  53 +++++++++
 drivers/dma/dw/internal.h |  51 +++++++++
 drivers/dma/dw/of.c       | 131 ++++++++++++++++++++++
 drivers/dma/dw/pci.c      |  60 +++--------
 drivers/dma/dw/platform.c | 221 +++++++++-----------------------------
 7 files changed, 312 insertions(+), 220 deletions(-)
 create mode 100644 drivers/dma/dw/acpi.c
 create mode 100644 drivers/dma/dw/of.c
Signature · 1 line
2.23.0.rc1
author reviewer
#1 lore raw

PATCH v2 1/10 dmaengine: acpi: Set up DMA mask based on CSRT

CSRT has an information about address width, which is supported by the certain DMA controller.

Use information from CSRT to set up DMA mask for shared controller.

---
 drivers/dma/acpi-dma.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/dma/acpi-dma.c +7 -0
index 30243f5c0710..4d66ee059808 100644
@@ -10,6 +10,7 @@
  */
 
 #include <linux/device.h>
+#include <linux/dma-mapping.h>
 #include <linux/err.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -82,6 +83,12 @@ static int acpi_dma_parse_resource_group(const struct acpi_csrt_group *grp,
 	if (si->base_request_line == 0 && si->num_handshake_signals == 0)
 		return 0;
 
+	/* Set up DMA mask based on value from CSRT */
+	ret = dma_coerce_mask_and_coherent(&adev->dev,
+					   DMA_BIT_MASK(si->dma_address_width));
+	if (ret)
+		return 0;
+
 	adma->base_request_line = si->base_request_line;
 	adma->end_request_line = si->base_request_line +
 				 si->num_handshake_signals - 1;
Signature · 1 line
2.23.0.rc1
author reviewer
#2 lore raw

PATCH v2 2/10 dmaengine: acpi: Add kernel doc parameter descriptions

In reply to Andy Shevchenko

Kernel documentation script is not happy about absence of function parameter descriptions:

drivers/dma/acpi-dma.c:163: warning: Function parameter or member 'data' not described in 'acpi_dma_controller_register' drivers/dma/acpi-dma.c:247: warning: Function parameter or member 'data' not described in 'devm_acpi_dma_controller_register' drivers/dma/acpi-dma.c:274: warning: Function parameter or member 'dev' not described in 'devm_acpi_dma_controller_free'

Append the descriptions of above mentioned function parameters.

---
 drivers/dma/acpi-dma.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/dma/acpi-dma.c +3 -2
index 4d66ee059808..8a05db3343d3 100644
@@ -147,7 +147,7 @@ static void acpi_dma_parse_csrt(struct acpi_device *adev, struct acpi_dma *adma)
  * @dev:		struct device of DMA controller
  * @acpi_dma_xlate:	translation function which converts a dma specifier
  *			into a dma_chan structure
- * @data		pointer to controller specific data to be used by
+ * @data:		pointer to controller specific data to be used by
  *			translation function
  *
  * Allocated memory should be freed with appropriate acpi_dma_controller_free()
@@ -231,7 +231,7 @@ static void devm_acpi_dma_release(struct device *dev, void *res)
  * devm_acpi_dma_controller_register - resource managed acpi_dma_controller_register()
  * @dev:		device that is registering this DMA controller
  * @acpi_dma_xlate:	translation function
- * @data		pointer to controller specific data
+ * @data:		pointer to controller specific data
  *
  * Managed acpi_dma_controller_register(). DMA controller registered by this
  * function are automatically freed on driver detach. See
@@ -264,6 +264,7 @@ EXPORT_SYMBOL_GPL(devm_acpi_dma_controller_register);
 
 /**
  * devm_acpi_dma_controller_free - resource managed acpi_dma_controller_free()
+ * @dev:	device that is unregistering as DMA controller
  *
  * Unregister a DMA controller registered with
  * devm_acpi_dma_controller_register(). Normally this function will not need to
Signature · 1 line
2.23.0.rc1
author reviewer
#3 lore raw

PATCH v2 3/10 dmaengine: dw: Export struct dw_dma_chip_pdata for wider use

In reply to Andy Shevchenko

We are expecting some devices can be enumerated either as PCI or ACPI. Nevertheless, they will share same information, thus, provide a generic struct dw_dma_chip_pdata for all glue drivers.

---
 drivers/dma/dw/internal.h | 28 ++++++++++++++++++
 drivers/dma/dw/pci.c      | 60 +++++++++++----------------------------
 2 files changed, 44 insertions(+), 44 deletions(-)
drivers/dma/dw/internal.h +28 -0
index 1dd7a4e6dd23..df5c84e2a4fd 100644
@@ -23,4 +23,32 @@ int do_dw_dma_enable(struct dw_dma_chip *chip);
 
 extern bool dw_dma_filter(struct dma_chan *chan, void *param);
 
+struct dw_dma_chip_pdata {
+	const struct dw_dma_platform_data *pdata;
+	int (*probe)(struct dw_dma_chip *chip);
+	int (*remove)(struct dw_dma_chip *chip);
+	struct dw_dma_chip *chip;
+};
+
+static __maybe_unused const struct dw_dma_chip_pdata dw_dma_chip_pdata = {
+	.probe = dw_dma_probe,
+	.remove = dw_dma_remove,
+};
+
+static const struct dw_dma_platform_data idma32_pdata = {
+	.nr_channels = 8,
+	.chan_allocation_order = CHAN_ALLOCATION_ASCENDING,
+	.chan_priority = CHAN_PRIORITY_ASCENDING,
+	.block_size = 131071,
+	.nr_masters = 1,
+	.data_width = {4},
+	.multi_block = {1, 1, 1, 1, 1, 1, 1, 1},
+};
+
+static __maybe_unused const struct dw_dma_chip_pdata idma32_chip_pdata = {
+	.pdata = &idma32_pdata,
+	.probe = idma32_dma_probe,
+	.remove = idma32_dma_remove,
+};
+
 #endif /* _DMA_DW_INTERNAL_H */
drivers/dma/dw/pci.c +16 -44

104 lines not on this page · raw message

Signature · 1 line
2.23.0.rc1
author reviewer
#4 lore raw

PATCH v2 4/10 dmaengine: dw: platform: Use struct dw_dma_chip_pdata

In reply to Andy Shevchenko

Now, when we have a generic structure for the chip and platform data, use it in the platform glue driver.

---
 drivers/dma/dw/platform.c | 42 +++++++++++++++++++++++++++++----------
 1 file changed, 31 insertions(+), 11 deletions(-)
drivers/dma/dw/platform.c +31 -11
index 382dfd9e9600..234abbd6359a 100644
@@ -168,12 +168,22 @@ dw_dma_parse_dt(struct platform_device *pdev)
 
 static int dw_probe(struct platform_device *pdev)
 {
+	const struct dw_dma_chip_pdata *match;
+	struct dw_dma_chip_pdata *data;
 	struct dw_dma_chip *chip;
 	struct device *dev = &pdev->dev;
 	struct resource *mem;
 	const struct dw_dma_platform_data *pdata;
 	int err;
 
+	match = device_get_match_data(dev);
+	if (!match)
+		return -ENODEV;
+
+	data = devm_kmemdup(&pdev->dev, match, sizeof(*match), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
 	chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
 	if (!chip)
 		return -ENOMEM;
@@ -199,6 +209,8 @@ static int dw_probe(struct platform_device *pdev)
 	chip->id = pdev->id;
 	chip->pdata = pdata;
 
+	data->chip = chip;
+
 	chip->clk = devm_clk_get(chip->dev, "hclk");
 	if (IS_ERR(chip->clk))
 		return PTR_ERR(chip->clk);
@@ -208,11 +220,11 @@ static int dw_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(&pdev->dev);
 
-	err = dw_dma_probe(chip);
+	err = data->probe(chip);
 	if (err)
 		goto err_dw_dma_probe;
 
-	platform_set_drvdata(pdev, chip);
+	platform_set_drvdata(pdev, data);
 
 	if (pdev->dev.of_node) {
 		err = of_dma_controller_register(pdev->dev.of_node,
@@ -235,12 +247,17 @@ static int dw_probe(struct platform_device *pdev)
 
 static int dw_remove(struct platform_device *pdev)
 {
-	struct dw_dma_chip *chip = platform_get_drvdata(pdev);
+	struct dw_dma_chip_pdata *data = platform_get_drvdata(pdev);
+	struct dw_dma_chip *chip = data->chip;
+	int ret;
 
 	if (pdev->dev.of_node)
 		of_dma_controller_free(pdev->dev.of_node);
 
-	dw_dma_remove(chip);
+	ret = data->remove(chip);
+	if (ret)
+		dev_warn(chip->dev, "can't remove device properly: %d\n", ret);
+
 	pm_runtime_disable(&pdev->dev);
 	clk_disable_unprepare(chip->clk);
 
@@ -249,7 +266,8 @@ static int dw_remove(struct platform_device *pdev)
 
 static void dw_shutdown(struct platform_device *pdev)
 {
-	struct dw_dma_chip *chip = platform_get_drvdata(pdev);
+	struct dw_dma_chip_pdata *data = platform_get_drvdata(pdev);
+	struct dw_dma_chip *chip = data->chip;
 
 	/*
 	 * We have to call do_dw_dma_disable() to stop any ongoing transfer. On
@@ -269,7 +287,7 @@ static void dw_shutdown(struct platform_device *pdev)
 
 #ifdef CONFIG_OF
 static const struct of_device_id dw_dma_of_id_table[] = {
-	{ .compatible = "snps,dma-spear1340" },
+	{ .compatible = "snps,dma-spear1340", .data = &dw_dma_chip_pdata },
 	{}
 };
 MODULE_DEVICE_TABLE(of, dw_dma_of_id_table);
@@ -277,9 +295,9 @@ MODULE_DEVICE_TABLE(of, dw_dma_of_id_table);
 
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id dw_dma_acpi_id_table[] = {
-	{ "INTL9C60", 0 },
-	{ "80862286", 0 },
-	{ "808622C0", 0 },
+	{ "INTL9C60", (kernel_ulong_t)&dw_dma_chip_pdata },
+	{ "80862286", (kernel_ulong_t)&dw_dma_chip_pdata },
+	{ "808622C0", (kernel_ulong_t)&dw_dma_chip_pdata },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, dw_dma_acpi_id_table);
@@ -289,7 +307,8 @@ MODULE_DEVICE_TABLE(acpi, dw_dma_acpi_id_table);
 
 static int dw_suspend_late(struct device *dev)
 {
-	struct dw_dma_chip *chip = dev_get_drvdata(dev);
+	struct dw_dma_chip_pdata *data = dev_get_drvdata(dev);
+	struct dw_dma_chip *chip = data->chip;
 
 	do_dw_dma_disable(chip);
 	clk_disable_unprepare(chip->clk);
@@ -299,7 +318,8 @@ static int dw_suspend_late(struct device *dev)
 
 static int dw_resume_early(struct device *dev)
 {
-	struct dw_dma_chip *chip = dev_get_drvdata(dev);
+	struct dw_dma_chip_pdata *data = dev_get_drvdata(dev);
+	struct dw_dma_chip *chip = data->chip;
 	int ret;
 
 	ret = clk_prepare_enable(chip->clk);
Signature · 1 line
2.23.0.rc1
author reviewer
#5 lore raw

PATCH v2 5/10 dmaengine: dw: platform: Enable iDMA 32-bit on Intel Elkhart Lake

In reply to Andy Shevchenko

Intel® PSE (Programmable Services Engine) provides few DMA controllers to the host on Intel Elkhart Lake. Enable them in the ACPI glue driver.

---
 drivers/dma/dw/platform.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/dma/dw/platform.c +11 -5
index 234abbd6359a..63465fd0e286 100644
@@ -173,7 +173,6 @@ static int dw_probe(struct platform_device *pdev)
 	struct dw_dma_chip *chip;
 	struct device *dev = &pdev->dev;
 	struct resource *mem;
-	const struct dw_dma_platform_data *pdata;
 	int err;
 
 	match = device_get_match_data(dev);
@@ -201,13 +200,14 @@ static int dw_probe(struct platform_device *pdev)
 	if (err)
 		return err;
 
-	pdata = dev_get_platdata(dev);
-	if (!pdata)
-		pdata = dw_dma_parse_dt(pdev);
+	if (!data->pdata)
+		data->pdata = dev_get_platdata(dev);
+	if (!data->pdata)
+		data->pdata = dw_dma_parse_dt(pdev);
 
 	chip->dev = dev;
 	chip->id = pdev->id;
-	chip->pdata = pdata;
+	chip->pdata = data->pdata;
 
 	data->chip = chip;
 
@@ -298,6 +298,12 @@ static const struct acpi_device_id dw_dma_acpi_id_table[] = {
 	{ "INTL9C60", (kernel_ulong_t)&dw_dma_chip_pdata },
 	{ "80862286", (kernel_ulong_t)&dw_dma_chip_pdata },
 	{ "808622C0", (kernel_ulong_t)&dw_dma_chip_pdata },
+
+	/* Elkhart Lake iDMA 32-bit (PSE DMA) */
+	{ "80864BB4", (kernel_ulong_t)&idma32_chip_pdata },
+	{ "80864BB5", (kernel_ulong_t)&idma32_chip_pdata },
+	{ "80864BB6", (kernel_ulong_t)&idma32_chip_pdata },
+
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, dw_dma_acpi_id_table);
Signature · 1 line
2.23.0.rc1
author reviewer
#6 lore raw

PATCH v2 6/10 dmaengine: dw: platform: Use devm_platform_ioremap_resource()

In reply to Andy Shevchenko

Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.

---
 drivers/dma/dw/platform.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/dma/dw/platform.c +1 -3
index 63465fd0e286..8576439d0035 100644
@@ -172,7 +172,6 @@ static int dw_probe(struct platform_device *pdev)
 	struct dw_dma_chip_pdata *data;
 	struct dw_dma_chip *chip;
 	struct device *dev = &pdev->dev;
-	struct resource *mem;
 	int err;
 
 	match = device_get_match_data(dev);
@@ -191,8 +190,7 @@ static int dw_probe(struct platform_device *pdev)
 	if (chip->irq < 0)
 		return chip->irq;
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	chip->regs = devm_ioremap_resource(dev, mem);
+	chip->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(chip->regs))
 		return PTR_ERR(chip->regs);
 
Signature · 1 line
2.23.0.rc1
author reviewer
#7 lore raw

PATCH v2 7/10 dmaengine: dw: platform: Switch to acpi_dma_controller_register()

In reply to Andy Shevchenko

There is a possibility to have registered ACPI DMA controller while it has been gone already.

To avoid the potential crash, move to non-managed
acpi_dma_controller_register().

Fixes 42c91ee71d6d ("dw_dmac: add ACPI support")
---
 drivers/dma/dw/platform.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/dma/dw/platform.c +12 -2
index 8576439d0035..44fec1eabccd 100644
@@ -84,13 +84,20 @@ static void dw_dma_acpi_controller_register(struct dw_dma *dw)
 	dma_cap_set(DMA_SLAVE, info->dma_cap);
 	info->filter_fn = dw_dma_acpi_filter;
 
-	ret = devm_acpi_dma_controller_register(dev, acpi_dma_simple_xlate,
-						info);
+	ret = acpi_dma_controller_register(dev, acpi_dma_simple_xlate, info);
 	if (ret)
 		dev_err(dev, "could not register acpi_dma_controller\n");
 }
+
+static void dw_dma_acpi_controller_free(struct dw_dma *dw)
+{
+	struct device *dev = dw->dma.dev;
+
+	acpi_dma_controller_free(dev);
+}
 #else /* !CONFIG_ACPI */
 static inline void dw_dma_acpi_controller_register(struct dw_dma *dw) {}
+static inline void dw_dma_acpi_controller_free(struct dw_dma *dw) {}
 #endif /* !CONFIG_ACPI */
 
 #ifdef CONFIG_OF
@@ -249,6 +256,9 @@ static int dw_remove(struct platform_device *pdev)
 	struct dw_dma_chip *chip = data->chip;
 	int ret;
 
+	if (ACPI_HANDLE(&pdev->dev))
+		dw_dma_acpi_controller_free(chip->dw);
+
 	if (pdev->dev.of_node)
 		of_dma_controller_free(pdev->dev.of_node);
 
Signature · 1 line
2.23.0.rc1
author reviewer
#8 lore raw

PATCH v2 8/10 dmaengine: dw: platform: Move handle check to dw_dma_acpi_controller_register()

In reply to Andy Shevchenko

Move ACPI handle check to the dw_dma_acpi_controller_register().

While here, convert it to has_acpi_companion() which is recommended way.

---
 drivers/dma/dw/platform.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/dma/dw/platform.c +8 -4
index 44fec1eabccd..b8514d7895d1 100644
@@ -76,6 +76,9 @@ static void dw_dma_acpi_controller_register(struct dw_dma *dw)
 	struct acpi_dma_filter_info *info;
 	int ret;
 
+	if (!has_acpi_companion(dev))
+		return;
+
 	info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
 	if (!info)
 		return;
@@ -93,6 +96,9 @@ static void dw_dma_acpi_controller_free(struct dw_dma *dw)
 {
 	struct device *dev = dw->dma.dev;
 
+	if (!has_acpi_companion(dev))
+		return;
+
 	acpi_dma_controller_free(dev);
 }
 #else /* !CONFIG_ACPI */
@@ -239,8 +245,7 @@ static int dw_probe(struct platform_device *pdev)
 				"could not register of_dma_controller\n");
 	}
 
-	if (ACPI_HANDLE(&pdev->dev))
-		dw_dma_acpi_controller_register(chip->dw);
+	dw_dma_acpi_controller_register(chip->dw);
 
 	return 0;
 
@@ -256,8 +261,7 @@ static int dw_remove(struct platform_device *pdev)
 	struct dw_dma_chip *chip = data->chip;
 	int ret;
 
-	if (ACPI_HANDLE(&pdev->dev))
-		dw_dma_acpi_controller_free(chip->dw);
+	dw_dma_acpi_controller_free(chip->dw);
 
 	if (pdev->dev.of_node)
 		of_dma_controller_free(pdev->dev.of_node);
Signature · 1 line
2.23.0.rc1
author reviewer
#9 lore raw

PATCH v2 9/10 dmaengine: dw: platform: Split ACPI helpers to separate module

In reply to Andy Shevchenko

For better maintenance split ACPI helpers to the separate module.

---
 drivers/dma/dw/Makefile   |  3 ++-
 drivers/dma/dw/acpi.c     | 53 +++++++++++++++++++++++++++++++++++++++
 drivers/dma/dw/internal.h |  8 ++++++
 drivers/dma/dw/platform.c | 52 --------------------------------------
 4 files changed, 63 insertions(+), 53 deletions(-)
 create mode 100644 drivers/dma/dw/acpi.c
drivers/dma/dw/Makefile +2 -1
index 63ed895c09aa..5e69815f3cf1 100644
@@ -3,7 +3,8 @@ obj-$(CONFIG_DW_DMAC_CORE)	+= dw_dmac_core.o
 dw_dmac_core-objs	:= core.o dw.o idma32.o
 
 obj-$(CONFIG_DW_DMAC)		+= dw_dmac.o
-dw_dmac-objs		:= platform.o
+dw_dmac-y			:= platform.o
+dw_dmac-$(CONFIG_ACPI)		+= acpi.o
 
 obj-$(CONFIG_DW_DMAC_PCI)	+= dw_dmac_pci.o
 dw_dmac_pci-objs	:= pci.o
drivers/dma/dw/acpi.c new file +53 -0

53 lines not on this page · raw message

drivers/dma/dw/internal.h +8 -0
index df5c84e2a4fd..acada530aa96 100644
@@ -23,6 +23,14 @@ int do_dw_dma_enable(struct dw_dma_chip *chip);
 
 extern bool dw_dma_filter(struct dma_chan *chan, void *param);
 
+#ifdef CONFIG_ACPI
+void dw_dma_acpi_controller_register(struct dw_dma *dw);
+void dw_dma_acpi_controller_free(struct dw_dma *dw);
+#else /* !CONFIG_ACPI */
+static inline void dw_dma_acpi_controller_register(struct dw_dma *dw) {}
+static inline void dw_dma_acpi_controller_free(struct dw_dma *dw) {}
+#endif /* !CONFIG_ACPI */
+
 struct dw_dma_chip_pdata {
 	const struct dw_dma_platform_data *pdata;
 	int (*probe)(struct dw_dma_chip *chip);
drivers/dma/dw/platform.c +0 -52

64 lines not on this page · raw message

Signature · 1 line
2.23.0.rc1
author reviewer
#10 lore raw

PATCH v2 10/10 dmaengine: dw: platform: Split OF helpers to separate module

In reply to Andy Shevchenko

For better maintenance split OF helpers to the separate module.

---
 drivers/dma/dw/Makefile   |   1 +
 drivers/dma/dw/internal.h |  15 +++++
 drivers/dma/dw/of.c       | 131 ++++++++++++++++++++++++++++++++++++++
 drivers/dma/dw/platform.c | 115 +--------------------------------
 4 files changed, 149 insertions(+), 113 deletions(-)
 create mode 100644 drivers/dma/dw/of.c
drivers/dma/dw/Makefile +1 -0
index 5e69815f3cf1..b6f06699e91a 100644
@@ -5,6 +5,7 @@ dw_dmac_core-objs	:= core.o dw.o idma32.o
 obj-$(CONFIG_DW_DMAC)		+= dw_dmac.o
 dw_dmac-y			:= platform.o
 dw_dmac-$(CONFIG_ACPI)		+= acpi.o
+dw_dmac-$(CONFIG_OF)		+= of.o
 
 obj-$(CONFIG_DW_DMAC_PCI)	+= dw_dmac_pci.o
 dw_dmac_pci-objs	:= pci.o
drivers/dma/dw/internal.h +15 -0
index acada530aa96..2e1c52eefdeb 100644
@@ -31,6 +31,21 @@ static inline void dw_dma_acpi_controller_register(struct dw_dma *dw) {}
 static inline void dw_dma_acpi_controller_free(struct dw_dma *dw) {}
 #endif /* !CONFIG_ACPI */
 
+struct platform_device;
+
+#ifdef CONFIG_OF
+struct dw_dma_platform_data *dw_dma_parse_dt(struct platform_device *pdev);
+void dw_dma_of_controller_register(struct dw_dma *dw);
+void dw_dma_of_controller_free(struct dw_dma *dw);
+#else
+static inline struct dw_dma_platform_data *dw_dma_parse_dt(struct platform_device *pdev)
+{
+	return NULL;
+}
+static inline void dw_dma_of_controller_register(struct dw_dma *dw) {}
+static inline void dw_dma_of_controller_free(struct dw_dma *dw) {}
+#endif
+
 struct dw_dma_chip_pdata {
 	const struct dw_dma_platform_data *pdata;
 	int (*probe)(struct dw_dma_chip *chip);
drivers/dma/dw/of.c new file +131 -0

131 lines not on this page · raw message

drivers/dma/dw/platform.c +2 -113

139 lines not on this page · raw message

Signature · 1 line
2.23.0.rc1
maintainer Applied
#11 lore raw
In reply to Andy Shevchenko
Quoted 9 lines · Andy Shevchenko

On Intel Elkhart Lake the DMA controllers can be provided by Intel® PSE (Programmable Services Engine) and exposed either as PCI or ACPI devices.

To support both schemes here is a patch series.

First two patches fixes minor issues in DMA ACPI layer, patches 3-5 enables Intel Elkhart Lake DMA controllers that exposed as ACPI devices, patch 6 is clean up, patch 7 is fix for possible race on ->remove() stage, patch 8 is follow up clean up and patches 9-10 is a split for better maintenance.

Applied all, thanks

Signature · 1 line
~Vinod
author reviewer
#12 lore raw
Quoted 4 lines · Vinod Koul
Quoted 3 lines · Andy Shevchenko

On Intel Elkhart Lake the DMA controllers can be provided by Intel® PSE (Programmable Services Engine) and exposed either as PCI or ACPI devices.

Quoted 8 lines
Quoted 6 lines

To support both schemes here is a patch series.

First two patches fixes minor issues in DMA ACPI layer, patches 3-5 enables Intel Elkhart Lake DMA controllers that exposed as ACPI devices, patch 6 is clean up, patch 7 is fix for possible race on ->remove() stage, patch 8 is follow up clean up and patches 9-10 is a split for better maintenance.

Applied all, thanks

Thank you!

Though I haven't seen yet them in Linux next. Can we give at least the rest of the time, till the release, to dangle them in Linux next?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#13 lore raw
Quoted 12 lines · Andy Shevchenko
Quoted 11 lines · Vinod Koul
Quoted 9 lines · Andy Shevchenko

On Intel Elkhart Lake the DMA controllers can be provided by Intel® PSE (Programmable Services Engine) and exposed either as PCI or ACPI devices.

To support both schemes here is a patch series.

First two patches fixes minor issues in DMA ACPI layer, patches 3-5 enables Intel Elkhart Lake DMA controllers that exposed as ACPI devices, patch 6 is clean up, patch 7 is fix for possible race on ->remove() stage, patch 8 is follow up clean up and patches 9-10 is a split for better maintenance.

Quoted 6 lines
Quoted 1 line

Applied all, thanks

Thank you!

Though I haven't seen yet them in Linux next. Can we give at least the rest of the time, till the release, to dangle them in Linux next?

Heh, looks like my script failed to push and I failed to notice. I have pushed last night and it should be in linux-next today.

Signature · 1 line
~Vinod
author reviewer
#14 lore raw
Quoted 8 lines · Vinod Koul
Quoted 4 lines · Andy Shevchenko

On Wed, Aug 21, 2019 at 09:41:44AM +0530, Vinod Koul wrote:

Though I haven't seen yet them in Linux next. Can we give at least the rest of the time, till the release, to dangle them in Linux next?

Heh, looks like my script failed to push and I failed to notice. I have pushed last night and it should be in linux-next today.

Thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko