dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 01/12] dmaengine: acpi: Set up DMA mask based on CSRT
@ 2019-08-06  9:40 Andy Shevchenko
  2019-08-06  9:40 ` [PATCH v1 02/12] dmaengine: acpi: Move index to struct acpi_dma_spec Andy Shevchenko
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: Andy Shevchenko @ 2019-08-06  9:40 UTC (permalink / raw)
  To: Vinod Koul, dmaengine, Viresh Kumar; +Cc: Andy Shevchenko

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.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/dma/acpi-dma.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/dma/acpi-dma.c b/drivers/dma/acpi-dma.c
index 30243f5c0710..4d66ee059808 100644
--- a/drivers/dma/acpi-dma.c
+++ b/drivers/dma/acpi-dma.c
@@ -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;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-08-20 11:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-06  9:40 [PATCH v1 01/12] dmaengine: acpi: Set up DMA mask based on CSRT Andy Shevchenko
2019-08-06  9:40 ` [PATCH v1 02/12] dmaengine: acpi: Move index to struct acpi_dma_spec Andy Shevchenko
2019-08-06  9:40 ` [PATCH v1 03/12] dmaengine: acpi: Provide consumer device to ->acpi_dma_xlate() Andy Shevchenko
2019-08-06  9:40 ` [PATCH v1 04/12] dmaengine: acpi: Add kernel doc parameter descriptions Andy Shevchenko
2019-08-06  9:40 ` [PATCH v1 05/12] dmaengine: dw: Export struct dw_dma_chip_pdata for wider use Andy Shevchenko
2019-08-06  9:40 ` [PATCH v1 06/12] dmaengine: dw: platform: Use struct dw_dma_chip_pdata Andy Shevchenko
2019-08-06  9:40 ` [PATCH v1 07/12] dmaengine: dw: platform: Enable iDMA 32-bit on Intel Elkhart Lake Andy Shevchenko
2019-08-14 14:44   ` Andy Shevchenko
2019-08-20 11:13     ` Vinod Koul
2019-08-06  9:40 ` [PATCH v1 08/12] dmaengine: dw: platform: Use devm_platform_ioremap_resource() Andy Shevchenko
2019-08-06  9:40 ` [PATCH v1 09/12] dmaengine: dw: platform: Switch to acpi_dma_controller_register() Andy Shevchenko
2019-08-06  9:40 ` [PATCH v1 10/12] dmaengine: dw: platform: Move handle check to dw_dma_acpi_controller_register() Andy Shevchenko
2019-08-06  9:40 ` [PATCH v1 11/12] dmaengine: dw: platform: Split ACPI helpers to separate module Andy Shevchenko
2019-08-06  9:40 ` [PATCH v1 12/12] dmaengine: dw: platform: Split OF " Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).