Skip to contentSkip to conversation

dmaengine: shdma: fix a build failure on platforms with no DMA support

PATCH Superseded Guennadi Liakhovetski 6 participants 10 messages May 30, 2013 – Jul 10, 2013

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: shdma: fix a build failure on platforms with no DMA support

On platforms with no support for the shdma dmaengine driver build is currently failing with

drivers/built-in.o: In function `sh_mobile_sdhi_probe':
drivers/mmc/host/sh_mobile_sdhi.c:170: undefined reference to`shdma_chan_filter'

Fix the breakage by defining shdma_chan_filter to NULL in such configurations.

---

This is for "next." Compile-tested only. I'll test it on hardware next week, but I don't think it shall break anything.

 include/linux/sh_dma.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/linux/sh_dma.h +4 -0
index b64d6be..1fd8a20 100644
@@ -99,6 +99,10 @@ struct sh_dmae_pdata {
 #define CHCR_TE	0x00000002
 #define CHCR_IE	0x00000004
 
+#if IS_ENABLED(CONFIG_SH_DMAE)
 bool shdma_chan_filter(struct dma_chan *chan, void *arg);
+#else
+#define shdma_chan_filter NULL
+#endif
 
 #endif
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 1/1 dmaengine: shdma: fix a build failure on platforms with no DMA support

Quoted 23 lines · Guennadi Liakhovetski

On platforms with no support for the shdma dmaengine driver build is currently failing with

drivers/built-in.o: In function `sh_mobile_sdhi_probe':
drivers/mmc/host/sh_mobile_sdhi.c:170: undefined reference to`shdma_chan_filter'

Fix the breakage by defining shdma_chan_filter to NULL in such configurations.

---

This is for "next." Compile-tested only. I'll test it on hardware next week, but I don't think it shall break anything.

 include/linux/sh_dma.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/linux/sh_dma.h +0 -0
index b64d6be..1fd8a20 100644

include/linux/sh_dma.h struct sh_dmae_pdata { · line 105

Quoted 7 lines
include/linux/sh_dma.h +3 -0
@@ -99,6 +99,10 @@ struct sh_dmae_pdata {
 #define CHCR_TE	0x00000002
 #define CHCR_IE	0x00000004
 
+#if IS_ENABLED(CONFIG_SH_DMAE)
 bool shdma_chan_filter(struct dma_chan *chan, void *arg);
+#else
+#define shdma_chan_filter NULL

Would this not be better as a
#else
static inline bool shdma_chan_filter(struct dma_chan *chan, void *arg)

{
    return false;
}

#endif

Otherwise runtime will call a NULL pointer

Quoted 3 lines
include/linux/sh_dma.h +1 -0
+#endif
 
 #endif
Signature · 2 lines
------------------
Dan Murphy
#2 lore raw

PATCH 1/1 dmaengine: shdma: fix a build failure on platforms with no DMA support

Quoted 34 lines · Dan Murphy
Quoted 23 lines · Guennadi Liakhovetski

On platforms with no support for the shdma dmaengine driver build is currently failing with

drivers/built-in.o: In function `sh_mobile_sdhi_probe':
drivers/mmc/host/sh_mobile_sdhi.c:170: undefined reference to`shdma_chan_filter'

Fix the breakage by defining shdma_chan_filter to NULL in such configurations.

---

This is for "next." Compile-tested only. I'll test it on hardware next week, but I don't think it shall break anything.

 include/linux/sh_dma.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/linux/sh_dma.h +0 -0
index b64d6be..1fd8a20 100644

include/linux/sh_dma.h struct sh_dmae_pdata { · line 105

Quoted 7 lines
include/linux/sh_dma.h +3 -0
@@ -99,6 +99,10 @@ struct sh_dmae_pdata {
 #define CHCR_TE	0x00000002
 #define CHCR_IE	0x00000004
 
+#if IS_ENABLED(CONFIG_SH_DMAE)
 bool shdma_chan_filter(struct dma_chan *chan, void *arg);
+#else
+#define shdma_chan_filter NULL

Would this not be better as a
#else
static inline bool shdma_chan_filter(struct dma_chan *chan, void *arg)

Quoted 10 lines
{
    return false;
}

#endif

Otherwise runtime will call a NULL pointer

Quoted 3 lines
include/linux/sh_dma.h +1 -0
+#endif
 
 #endif

Hi Guennadi,

thanks for this. I will wait for a refresh (as we discussed earlier today). Can I confirm that this is a fix for v3.10? If so, could ou note that when you post your revised patch?

Thanks

#3 lore raw

PATCH 1/1 dmaengine: shdma: fix a build failure on platforms with no DMA support

On Thu, May 30, 2013 at 7:44 PM, Simon Horman <[email protected]> wrote:

[...]

Quoted 3 lines

thanks for this. I will wait for a refresh (as we discussed earlier today). Can I confirm that this is a fix for v3.10? If so, could ou note that when you post your revised patch?

Any progress on this patch?

The SH-mobile defconfigs are still all failing in linux-next.

Kevin

#4 lore raw

PATCH 1/1 dmaengine: shdma: fix a build failure on platforms with no DMA support

Hi Vinod

Quoted 11 lines · Kevin Hilman

On Thu, May 30, 2013 at 7:44 PM, Simon Horman <[email protected]> wrote:

[...]

Quoted 3 lines

thanks for this. I will wait for a refresh (as we discussed earlier today). Can I confirm that this is a fix for v3.10? If so, could ou note that when you post your revised patch?

Any progress on this patch?

The SH-mobile defconfigs are still all failing in linux-next.

In

https://patchwork.kernel.org/patch/2640061/

I proposed a simple immediate fix for this problem. Arnd at the same time developed an alternative solution:

https://patchwork.kernel.org/patch/2644121/
https://patchwork.kernel.org/patch/2644111/

Which, I think, is a much larger change and isn't suitable as a bug-fix this late in the release cycle. Instead those patches address other issues with the shdma drivers, which might need to be carefully studied and solutions have to be found, which, however, would require more work and need a longer time. What is your opinion on this? Would you agree to apply v2 of this patch, as referenced above or would you prefer a different solution?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

#5 lore raw

PATCH 1/1 dmaengine: shdma: fix a build failure on platforms with no DMA support

Quoted 12 lines · Guennadi Liakhovetski

Hi Vinod

Quoted 8 lines · Kevin Hilman

On Thu, May 30, 2013 at 7:44 PM, Simon Horman <[email protected]> wrote:

[...]

Quoted 3 lines

thanks for this. I will wait for a refresh (as we discussed earlier today). Can I confirm that this is a fix for v3.10? If so, could ou note that when you post your revised patch?

Quoted 7 lines
Quoted 3 lines

Any progress on this patch?

The SH-mobile defconfigs are still all failing in linux-next.

In

https://patchwork.kernel.org/patch/2640061/

And you havent CC maintainers on this patch, so I dont have it!

Quoted 6 lines

I proposed a simple immediate fix for this problem. Arnd at the same time developed an alternative solution:

https://patchwork.kernel.org/patch/2644121/
https://patchwork.kernel.org/patch/2644111/

Reading these patches I agree with Arnd that client drivers should not depend on dma slave drivers. Existing issue need to be fixed

Arnd, Have you merged these changes?

--
~Vinod

Quoted 15 lines

Which, I think, is a much larger change and isn't suitable as a bug-fix this late in the release cycle. Instead those patches address other issues with the shdma drivers, which might need to be carefully studied and solutions have to be found, which, however, would require more work and need a longer time. What is your opinion on this? Would you agree to apply v2 of this patch, as referenced above or would you prefer a different solution?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

#6 lore raw

PATCH 1/1 dmaengine: shdma: fix a build failure on platforms with no DMA support

Quoted 25 lines · Vinod Koul
Quoted 12 lines · Guennadi Liakhovetski

Hi Vinod

Quoted 8 lines · Kevin Hilman

On Thu, May 30, 2013 at 7:44 PM, Simon Horman <[email protected]> wrote:

[...]

Quoted 3 lines

thanks for this. I will wait for a refresh (as we discussed earlier today). Can I confirm that this is a fix for v3.10? If so, could ou note that when you post your revised patch?

Quoted 7 lines
Quoted 3 lines

Any progress on this patch?

The SH-mobile defconfigs are still all failing in linux-next.

In

https://patchwork.kernel.org/patch/2640061/

And you havent CC maintainers on this patch, so I dont have it!

Quoted 4 lines

I proposed a simple immediate fix for this problem. Arnd at the same time developed an alternative solution:

Quoted 6 lines
Quoted 2 lines

https://patchwork.kernel.org/patch/2644121/
https://patchwork.kernel.org/patch/2644111/

Reading these patches I agree with Arnd that client drivers should not depend on dma slave drivers. Existing issue need to be fixed

Arnd, Have you merged these changes?

Looks like we now have breakage in linux-next for this again (new breakage due to the header file move being applied by you on Friday, Vinod? Are you planning on sending the code in for 3.11? If not, you shouldn't apply patches right now).

bockw_defconfig, kota2_defconfig, marzen_defconfig and others are currently broken.

-Olof

#7 lore raw

PATCH 1/1 dmaengine: shdma: fix a build failure on platforms with no DMA support

Quoted 31 lines · Olof Johansson
Quoted 30 lines · Vinod Koul
Quoted 12 lines · Guennadi Liakhovetski

Hi Vinod

Quoted 8 lines · Kevin Hilman

On Thu, May 30, 2013 at 7:44 PM, Simon Horman <[email protected]> wrote:

[...]

Quoted 3 lines

thanks for this. I will wait for a refresh (as we discussed earlier today). Can I confirm that this is a fix for v3.10? If so, could ou note that when you post your revised patch?

Quoted 7 lines
Quoted 3 lines

Any progress on this patch?

The SH-mobile defconfigs are still all failing in linux-next.

In

https://patchwork.kernel.org/patch/2640061/

And you havent CC maintainers on this patch, so I dont have it!

Quoted 6 lines

I proposed a simple immediate fix for this problem. Arnd at the same time developed an alternative solution:

https://patchwork.kernel.org/patch/2644121/
https://patchwork.kernel.org/patch/2644111/

Reading these patches I agree with Arnd that client drivers should not depend on dma slave drivers. Existing issue need to be fixed

Quoted 6 lines
Quoted 1 line

Arnd, Have you merged these changes?

Looks like we now have breakage in linux-next for this again (new breakage due to the header file move being applied by you on Friday, Vinod? Are you planning on sending the code in for 3.11? If not, you shouldn't apply patches right now).

Well they were already in my tree since 18th June. (tree was rebased to fixup for pull on friday) and now these are in Linus's tree.

Can we have a fix for breakage for now sent to linus for now and then address the proper way to do this?

~Vinod

#8 lore raw

PATCH 1/1 dmaengine: shdma: fix a build failure on platforms with no DMA support

Quoted 38 lines · Vinod Koul
Quoted 31 lines · Olof Johansson
Quoted 30 lines · Vinod Koul
Quoted 12 lines · Guennadi Liakhovetski

Hi Vinod

Quoted 8 lines · Kevin Hilman

On Thu, May 30, 2013 at 7:44 PM, Simon Horman <[email protected]> wrote:

[...]

Quoted 3 lines

thanks for this. I will wait for a refresh (as we discussed earlier today). Can I confirm that this is a fix for v3.10? If so, could ou note that when you post your revised patch?

Quoted 7 lines
Quoted 3 lines

Any progress on this patch?

The SH-mobile defconfigs are still all failing in linux-next.

In

https://patchwork.kernel.org/patch/2640061/

And you havent CC maintainers on this patch, so I dont have it!

Quoted 6 lines

I proposed a simple immediate fix for this problem. Arnd at the same time developed an alternative solution:

https://patchwork.kernel.org/patch/2644121/
https://patchwork.kernel.org/patch/2644111/

Reading these patches I agree with Arnd that client drivers should not depend on dma slave drivers. Existing issue need to be fixed

Quoted 6 lines
Quoted 1 line

Arnd, Have you merged these changes?

Looks like we now have breakage in linux-next for this again (new breakage due to the header file move being applied by you on Friday, Vinod? Are you planning on sending the code in for 3.11? If not, you shouldn't apply patches right now).

Quoted 5 lines

Well they were already in my tree since 18th June. (tree was rebased to fixup for pull on friday) and now these are in Linus's tree.

Can we have a fix for breakage for now sent to linus for now and then address the proper way to do this?

That is my preferred approach.

I will repost the patch at the link
https://patchwork.kernel.org/patch/2640061/ above, rebased for the header file rename.

Vinod, can you take things from there?

#9 lore raw

PATCH 1/1 dmaengine: shdma: fix a build failure on platforms with no DMA support

In reply to Vinod Koul
Quoted 13 lines · Vinod Koul
Quoted 12 lines · Guennadi Liakhovetski

Hi Vinod

Quoted 8 lines · Kevin Hilman

On Thu, May 30, 2013 at 7:44 PM, Simon Horman <[email protected]> wrote:

[...]

Quoted 3 lines

thanks for this. I will wait for a refresh (as we discussed earlier today). Can I confirm that this is a fix for v3.10? If so, could ou note that when you post your revised patch?

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

Any progress on this patch?

The SH-mobile defconfigs are still all failing in linux-next.

In

https://patchwork.kernel.org/patch/2640061/

And you havent CC maintainers on this patch, so I dont have it!

Ouch, sorry, no idea how I managed not to CC you, my apologies!

Quoted 7 lines
Quoted 5 lines

I proposed a simple immediate fix for this problem. Arnd at the same time developed an alternative solution:

https://patchwork.kernel.org/patch/2644121/
https://patchwork.kernel.org/patch/2644111/

Reading these patches I agree with Arnd that client drivers should not depend on dma slave drivers. Existing issue need to be fixed

I'm not arguing against that. My point is the following: also Arnd's patches have to deal with the fact, that the filter function has to be in files, which will be compiled with SHDMA enabled or disabled in .config. He solves this problem by adding #ifdef's to each .c file. Whereas I think it's better to add just one such #ifdef to the header. The actual issue of DMA client driver dependency on a specific dmaengine controller driver is a different (though related) problem and should be addressed separately.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/