Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1488097 > unrolled thread
| Started by | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| First post | 2016-09-21 14:50 +0200 |
| Last post | 2016-09-21 14:50 +0200 |
| Articles | 7 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH v3 0/9] dmaengine: ti drivers: enable COMPILE_TESTing Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-09-21 14:50 +0200
[PATCH v3 4/9] dmaengine/ARM: omap-dma: Fix the DMAengine compile test on non OMAP configs Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-09-21 14:50 +0200
[PATCH v3 1/9] dmaengine: edma: Add missing MODULE_DEVICE_TABLE() for of_device_id structs Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-09-21 14:50 +0200
[PATCH v3 7/9] dmaengine: edma: enable COMPILE_TEST Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-09-21 14:50 +0200
[PATCH v3 2/9] dmaengine: edma: Fix of_device_id data parameter usage (legacy vs TPCC) Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-09-21 14:50 +0200
[PATCH v3 9/9] dmaengine: ti-dma-crossbar: enable COMPILE_TEST Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-09-21 14:50 +0200
[PATCH v3 6/9] dmaengine: ti-dma-crossbar: Fix of_device_id data parameter usage Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-09-21 14:50 +0200
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-09-21 14:50 +0200 |
| Subject | [PATCH v3 0/9] dmaengine: ti drivers: enable COMPILE_TESTing |
| Message-ID | <sjP8l-BV-3@gated-at.bofh.it> |
Hi,
Changes since v2:
- Instead of converting to use enum for the of_device_id data parameter the two
patch for edma and ti-dma-crossbar is using pointers to u32 variables to make
sure that the code compile (and in theory work) on all architectures.
- fixed issue in the ti-dma-crossbar driver I have made with the enum change to
not handle the DMA offset parameters correctly.
Changes since v1:
- added the compiler warning message to ti-dma-crossbar enum type patch
- moved the Kconfig patches at the end of the seris
The following series will enable unconditional COMPILE_TEST coverage for the
following drivers: omap-dma, edma and ti-dma-crossbar
The series includes fixes noticed when compiling the drivers for x86_64 and
aarch64.
Replaces the patch Vinod sent to enable partial compile testing for omap-dma:
http://www.spinics.net/lists/dmaengine/msg11025.html
Regards,
Peter
---
Peter Ujfalusi (9):
dmaengine: edma: Add missing MODULE_DEVICE_TABLE() for of_device_id
structs
dmaengine: edma: Fix of_device_id data parameter usage (legacy vs
TPCC)
dmaengine: edma: Use correct type for of_find_property() third
parameter
dmaengine/ARM: omap-dma: Fix the DMAengine compile test on non OMAP
configs
dmaengine: ti-dma-crossbar: Correct type for of_find_property() third
parameter
dmaengine: ti-dma-crossbar: Fix of_device_id data parameter usage
dmaengine: edma: enable COMPILE_TEST
dmaengine: omap-dma: enable COMPILE_TEST
dmaengine: ti-dma-crossbar: enable COMPILE_TEST
drivers/dma/Kconfig | 8 ++++----
drivers/dma/edma.c | 16 +++++++++++-----
drivers/dma/ti-dma-crossbar.c | 30 +++++++++++++++++++-----------
include/linux/omap-dma.h | 19 +++++++++++++++++++
4 files changed, 53 insertions(+), 20 deletions(-)
--
2.10.0
[toc] | [next] | [standalone]
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-09-21 14:50 +0200 |
| Subject | [PATCH v3 4/9] dmaengine/ARM: omap-dma: Fix the DMAengine compile test on non OMAP configs |
| Message-ID | <sjP8l-BV-13@gated-at.bofh.it> |
| In reply to | #1488097 |
The DMAengine driver for omap-dma use three function calls from the
plat-omap legacy driver. When the DMAengine driver is built when ARCH_OMAP
is not set, the compilation will fail due to missing symbols.
Add empty inline functions to allow the DMAengine driver to be compiled
with COMPILE_TEST.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
include/linux/omap-dma.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h
index 1d99b61adc65..290081620b3e 100644
--- a/include/linux/omap-dma.h
+++ b/include/linux/omap-dma.h
@@ -297,6 +297,7 @@ struct omap_system_dma_plat_info {
#define dma_omap15xx() __dma_omap15xx(d)
#define dma_omap16xx() __dma_omap16xx(d)
+#if defined(CONFIG_ARCH_OMAP)
extern struct omap_system_dma_plat_info *omap_get_plat_info(void);
extern void omap_set_dma_priority(int lch, int dst_port, int priority);
@@ -355,4 +356,22 @@ static inline int omap_lcd_dma_running(void)
}
#endif
+#else /* CONFIG_ARCH_OMAP */
+
+static inline struct omap_system_dma_plat_info *omap_get_plat_info(void)
+{
+ return NULL;
+}
+
+static inline int omap_request_dma(int dev_id, const char *dev_name,
+ void (*callback)(int lch, u16 ch_status, void *data),
+ void *data, int *dma_ch)
+{
+ return -ENODEV;
+}
+
+static inline void omap_free_dma(int ch) { }
+
+#endif /* CONFIG_ARCH_OMAP */
+
#endif /* __LINUX_OMAP_DMA_H */
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-09-21 14:50 +0200 |
| Subject | [PATCH v3 1/9] dmaengine: edma: Add missing MODULE_DEVICE_TABLE() for of_device_id structs |
| Message-ID | <sjP8l-BV-21@gated-at.bofh.it> |
| In reply to | #1488097 |
The MODULE_DEVICE_TABLE() were missing from the driver for the of_device_id
structures.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/dma/edma.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 3d277fa76c1a..c2098a4b4dcf 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -274,11 +274,13 @@ static const struct of_device_id edma_of_ids[] = {
},
{}
};
+MODULE_DEVICE_TABLE(of, edma_of_ids);
static const struct of_device_id edma_tptc_of_ids[] = {
{ .compatible = "ti,edma3-tptc", },
{}
};
+MODULE_DEVICE_TABLE(of, edma_tptc_of_ids);
static inline unsigned int edma_read(struct edma_cc *ecc, int offset)
{
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-09-21 14:50 +0200 |
| Subject | [PATCH v3 7/9] dmaengine: edma: enable COMPILE_TEST |
| Message-ID | <sjP8m-BV-29@gated-at.bofh.it> |
| In reply to | #1488097 |
To get more coverage, enable COMPILE_TEST for this driver. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> --- drivers/dma/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index fe2dbb811e19..4348249b943a 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -515,7 +515,7 @@ config TI_DMA_CROSSBAR config TI_EDMA bool "TI EDMA support" - depends on ARCH_DAVINCI || ARCH_OMAP || ARCH_KEYSTONE + depends on ARCH_DAVINCI || ARCH_OMAP || ARCH_KEYSTONE || COMPILE_TEST select DMA_ENGINE select DMA_VIRTUAL_CHANNELS select TI_DMA_CROSSBAR if ARCH_OMAP -- 2.10.0
[toc] | [prev] | [next] | [standalone]
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-09-21 14:50 +0200 |
| Subject | [PATCH v3 2/9] dmaengine: edma: Fix of_device_id data parameter usage (legacy vs TPCC) |
| Message-ID | <sjP8l-BV-17@gated-at.bofh.it> |
| In reply to | #1488097 |
Use pointers to static constant variables for eDMA binding
type (legacy vs TPCC).
Fixes the following warning when compiling the driver for 64bit
architectures (x86_64 for example):
drivers/dma/edma.c:2185:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
if (match && (u32)match->data == EDMA_BINDING_TPCC)
^
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/dma/edma.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index c2098a4b4dcf..87c58710ae31 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -263,14 +263,19 @@ static const struct edmacc_param dummy_paramset = {
#define EDMA_BINDING_LEGACY 0
#define EDMA_BINDING_TPCC 1
+static const u32 edma_binding_type[] = {
+ [EDMA_BINDING_LEGACY] = EDMA_BINDING_LEGACY,
+ [EDMA_BINDING_TPCC] = EDMA_BINDING_TPCC,
+};
+
static const struct of_device_id edma_of_ids[] = {
{
.compatible = "ti,edma3",
- .data = (void *)EDMA_BINDING_LEGACY,
+ .data = &edma_binding_type[EDMA_BINDING_LEGACY],
},
{
.compatible = "ti,edma3-tpcc",
- .data = (void *)EDMA_BINDING_TPCC,
+ .data = &edma_binding_type[EDMA_BINDING_TPCC],
},
{}
};
@@ -2184,7 +2189,7 @@ static int edma_probe(struct platform_device *pdev)
const struct of_device_id *match;
match = of_match_node(edma_of_ids, node);
- if (match && (u32)match->data == EDMA_BINDING_TPCC)
+ if (match && (*(u32*)match->data) == EDMA_BINDING_TPCC)
legacy_mode = false;
info = edma_setup_info_from_dt(dev, legacy_mode);
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-09-21 14:50 +0200 |
| Subject | [PATCH v3 9/9] dmaengine: ti-dma-crossbar: enable COMPILE_TEST |
| Message-ID | <sjP8l-BV-27@gated-at.bofh.it> |
| In reply to | #1488097 |
To get more coverage, enable COMPILE_TEST for this driver. When compile testing eDMA or omap-dma, select also the ti-dma-crossbar so it is also covered by the compile testing. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> --- drivers/dma/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index 84647d6cb2f4..1c11628062ad 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -133,7 +133,7 @@ config DMA_OMAP depends on ARCH_OMAP || COMPILE_TEST select DMA_ENGINE select DMA_VIRTUAL_CHANNELS - select TI_DMA_CROSSBAR if SOC_DRA7XX + select TI_DMA_CROSSBAR if (SOC_DRA7XX || COMPILE_TEST) config DMA_SA11X0 tristate "SA-11x0 DMA support" @@ -518,7 +518,7 @@ config TI_EDMA depends on ARCH_DAVINCI || ARCH_OMAP || ARCH_KEYSTONE || COMPILE_TEST select DMA_ENGINE select DMA_VIRTUAL_CHANNELS - select TI_DMA_CROSSBAR if ARCH_OMAP + select TI_DMA_CROSSBAR if (ARCH_OMAP || COMPILE_TEST) default n help Enable support for the TI EDMA controller. This DMA -- 2.10.0
[toc] | [prev] | [next] | [standalone]
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-09-21 14:50 +0200 |
| Subject | [PATCH v3 6/9] dmaengine: ti-dma-crossbar: Fix of_device_id data parameter usage |
| Message-ID | <sjP8m-BV-31@gated-at.bofh.it> |
| In reply to | #1488097 |
Use pointers to static constant variables for crossbar type and for DMA
offset configuration.
Fixes compiler warnings on 64bit architectures:
drivers/dma/ti-dma-crossbar.c: In function ‘ti_dra7_xbar_probe’:
drivers/dma/ti-dma-crossbar.c:398:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
xbar->dma_offset = (u32)match->data;
^
drivers/dma/ti-dma-crossbar.c: In function ‘ti_dma_xbar_probe’:
drivers/dma/ti-dma-crossbar.c:431:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
switch ((u32)match->data) {
^
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/dma/ti-dma-crossbar.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/drivers/dma/ti-dma-crossbar.c b/drivers/dma/ti-dma-crossbar.c
index e4f3bd1ae264..9103b1260797 100644
--- a/drivers/dma/ti-dma-crossbar.c
+++ b/drivers/dma/ti-dma-crossbar.c
@@ -18,15 +18,19 @@
#define TI_XBAR_DRA7 0
#define TI_XBAR_AM335X 1
+static const u32 ti_xbar_type[] = {
+ [TI_XBAR_DRA7] = TI_XBAR_DRA7,
+ [TI_XBAR_AM335X] = TI_XBAR_AM335X,
+};
static const struct of_device_id ti_dma_xbar_match[] = {
{
.compatible = "ti,dra7-dma-crossbar",
- .data = (void *)TI_XBAR_DRA7,
+ .data = &ti_xbar_type[TI_XBAR_DRA7],
},
{
.compatible = "ti,am335x-edma-crossbar",
- .data = (void *)TI_XBAR_AM335X,
+ .data = &ti_xbar_type[TI_XBAR_AM335X],
},
{},
};
@@ -190,9 +194,6 @@ static int ti_am335x_xbar_probe(struct platform_device *pdev)
#define TI_DRA7_XBAR_OUTPUTS 127
#define TI_DRA7_XBAR_INPUTS 256
-#define TI_XBAR_EDMA_OFFSET 0
-#define TI_XBAR_SDMA_OFFSET 1
-
struct ti_dra7_xbar_data {
void __iomem *iomem;
@@ -280,18 +281,25 @@ static void *ti_dra7_xbar_route_allocate(struct of_phandle_args *dma_spec,
return map;
}
+#define TI_XBAR_EDMA_OFFSET 0
+#define TI_XBAR_SDMA_OFFSET 1
+static const u32 ti_dma_offset[] = {
+ [TI_XBAR_EDMA_OFFSET] = 0,
+ [TI_XBAR_SDMA_OFFSET] = 1,
+};
+
static const struct of_device_id ti_dra7_master_match[] = {
{
.compatible = "ti,omap4430-sdma",
- .data = (void *)TI_XBAR_SDMA_OFFSET,
+ .data = &ti_dma_offset[TI_XBAR_SDMA_OFFSET],
},
{
.compatible = "ti,edma3",
- .data = (void *)TI_XBAR_EDMA_OFFSET,
+ .data = &ti_dma_offset[TI_XBAR_EDMA_OFFSET],
},
{
.compatible = "ti,edma3-tpcc",
- .data = (void *)TI_XBAR_EDMA_OFFSET,
+ .data = &ti_dma_offset[TI_XBAR_EDMA_OFFSET],
},
{},
};
@@ -395,7 +403,7 @@ static int ti_dra7_xbar_probe(struct platform_device *pdev)
xbar->dmarouter.dev = &pdev->dev;
xbar->dmarouter.route_free = ti_dra7_xbar_free;
- xbar->dma_offset = (u32)match->data;
+ xbar->dma_offset = *(u32*)match->data;
mutex_init(&xbar->mutex);
platform_set_drvdata(pdev, xbar);
@@ -428,7 +436,7 @@ static int ti_dma_xbar_probe(struct platform_device *pdev)
if (unlikely(!match))
return -EINVAL;
- switch ((u32)match->data) {
+ switch (*(u32*)match->data) {
case TI_XBAR_DRA7:
ret = ti_dra7_xbar_probe(pdev);
break;
--
2.10.0
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web