Skip to contentSkip to conversation

dma-mapping: add the missing ARCH_HAS_SYNC_DMA_FOR_CPU_ALL declaration

PATCH In review Christoph Hellwig 5 participants 8 messages Sep 11, 2018 – Sep 25, 2018 5 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma-mapping: add the missing ARCH_HAS_SYNC_DMA_FOR_CPU_ALL declaration

The patch adding the infrastructure failed to actually add the symbol declaration, oops..

Fixes faef87723a ("dma-noncoherent: add a arch_sync_dma_for_cpu_all hook")
---
 kernel/dma/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
kernel/dma/Kconfig +3 -0
index 9bd54304446f..1b1d63b3634b 100644
@@ -23,6 +23,9 @@ config ARCH_HAS_SYNC_DMA_FOR_CPU
 	bool
 	select NEED_DMA_MAP_STATE
 
+config ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
+	bool
+
 config DMA_DIRECT_OPS
 	bool
 	depends on HAS_DMA
Signature · 1 line
2.18.0

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Aby chance to get a review for this?

Quoted 30 lines · Christoph Hellwig

The patch adding the infrastructure failed to actually add the symbol declaration, oops..

Fixes faef87723a ("dma-noncoherent: add a arch_sync_dma_for_cpu_all hook")
---
 kernel/dma/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
kernel/dma/Kconfig +3 -0
index 9bd54304446f..1b1d63b3634b 100644
@@ -23,6 +23,9 @@ config ARCH_HAS_SYNC_DMA_FOR_CPU
 	bool
 	select NEED_DMA_MAP_STATE
 
+config ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
+	bool
+
 config DMA_DIRECT_OPS
 	bool
 	depends on HAS_DMA
Signature · 6 lines
2.18.0

_______________________________________________
iommu mailing list
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

---end quoted text---

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 1 line · Christoph Hellwig

Aby chance to get a review for this?

So without this, the select does nothing, CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL is never defined, and BMIPS gets the static inline stub and never flushes the RAC when it should? I don't know enough MIPS to consider even compile-testing to check it, but that sounds like a legitimate fix to me.

Robin.

Quoted 33 lines · Christoph Hellwig
Quoted 30 lines

The patch adding the infrastructure failed to actually add the symbol declaration, oops..

Fixes faef87723a ("dma-noncoherent: add a arch_sync_dma_for_cpu_all hook")
---
  kernel/dma/Kconfig | 3 +++
  1 file changed, 3 insertions(+)
kernel/dma/Kconfig +3 -0
index 9bd54304446f..1b1d63b3634b 100644
@@ -23,6 +23,9 @@ config ARCH_HAS_SYNC_DMA_FOR_CPU
  	bool
  	select NEED_DMA_MAP_STATE
 
+config ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
+	bool
+
  config DMA_DIRECT_OPS
  	bool
  	depends on HAS_DMA
Signature · 6 lines
2.18.0

_______________________________________________
iommu mailing list
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

---end quoted text---

A message that is not in the archive (sent off-list or not yet received): 00257a79-72cf-15aa-fed9-d75923eed51e-5wv7dgnIgG8@public.gmane.org

#6 lore raw
Quoted 6 lines · Robin Murphy
Quoted 1 line · Christoph Hellwig

Aby chance to get a review for this?

So without this, the select does nothing, CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL is never defined, and BMIPS gets the static inline stub and never flushes the RAC when it should?

Exactly!

#7 lore raw
In reply to Christoph Hellwig

Paul, other mips folks, any comments?

At this point I'm tempted to just move it to 4.20 and add a stable tag given that no one cared so far.

Quoted 30 lines · Christoph Hellwig

The patch adding the infrastructure failed to actually add the symbol declaration, oops..

Fixes faef87723a ("dma-noncoherent: add a arch_sync_dma_for_cpu_all hook")
---
 kernel/dma/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
kernel/dma/Kconfig +3 -0
index 9bd54304446f..1b1d63b3634b 100644
@@ -23,6 +23,9 @@ config ARCH_HAS_SYNC_DMA_FOR_CPU
 	bool
 	select NEED_DMA_MAP_STATE
 
+config ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
+	bool
+
 config DMA_DIRECT_OPS
 	bool
 	depends on HAS_DMA
Signature · 6 lines
2.18.0

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

---end quoted text---

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by Acked-by
#9 lore raw

Hi Christoph,

Quoted 4 lines · Christoph Hellwig

Paul, other mips folks, any comments?

At this point I'm tempted to just move it to 4.20 and add a stable tag given that no one cared so far.

Copying Kevin & Florian as maintainers of the affected BMIPS systems in case they have anything to add.

Quoted 18 lines · Christoph Hellwig
Quoted 17 lines

The patch adding the infrastructure failed to actually add the symbol declaration, oops..

Fixes faef87723a ("dma-noncoherent: add a arch_sync_dma_for_cpu_all hook")
---
 kernel/dma/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
kernel/dma/Kconfig +0 -0
index 9bd54304446f..1b1d63b3634b 100644
@@ -23,6 +23,9 @@ config ARCH_HAS_SYNC_DMA_FOR_CPU
 	bool
 	select NEED_DMA_MAP_STATE
 
Quoted 6 lines

kernel/dma/Kconfig config ARCH_HAS_SYNC_DMA_FOR_CPU · line 31

Quoted 6 lines
kernel/dma/Kconfig +3 -0
+config ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
+	bool
+
 config DMA_DIRECT_OPS
 	bool
 	depends on HAS_DMA

The change looks reasonable to me, so feel free to take your choice of:

My thought would be that it would be ideal to fix in 4.19 since that's where the breakage is, but having said that I don't have much insight into how bad the breakage is for the affected systems.

Thanks,
Paul

#10 lore raw
Quoted 40 lines · Paul Burton

Hi Christoph,

Quoted 4 lines · Christoph Hellwig

Paul, other mips folks, any comments?

At this point I'm tempted to just move it to 4.20 and add a stable tag given that no one cared so far.

Copying Kevin & Florian as maintainers of the affected BMIPS systems in case they have anything to add.

Quoted 2 lines · Christoph Hellwig
Quoted 1 line

The patch adding the infrastructure failed to actually add the

symbol

Quoted 3 lines
Quoted 3 lines

declaration, oops..

Fixes faef87723a ("dma-noncoherent: add a

arch_sync_dma_for_cpu_all hook")

Quoted 13 lines
Quoted 13 lines
---
 kernel/dma/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
kernel/dma/Kconfig +0 -0
index 9bd54304446f..1b1d63b3634b 100644
@@ -23,6 +23,9 @@ config ARCH_HAS_SYNC_DMA_FOR_CPU
 	bool
 	select NEED_DMA_MAP_STATE
 
Quoted 6 lines

kernel/dma/Kconfig config ARCH_HAS_SYNC_DMA_FOR_CPU · line 31

Quoted 6 lines
kernel/dma/Kconfig +3 -0
+config ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
+	bool
+
 config DMA_DIRECT_OPS
 	bool
 	depends on HAS_DMA

The change looks reasonable to me, so feel free to take your choice of:

Quoted 6 lines

My thought would be that it would be ideal to fix in 4.19 since that's where the breakage is, but having said that I don't have much insight into how bad the breakage is for the affected systems.

AFAIR, DMA corruption is typically what you would observe, which could prove difficult if you are not exactly looking for it. In any case, I don't have a BMIPS system running 4.19 right now to exercise this on, but this looks correct:

Signature · 1 line
Florian

A message that is not in the archive (sent off-list or not yet received): 62B54A6B-6E10-4A40-8E61-C1D23A853816-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#12 lore raw
Quoted 6 lines · Florian Fainelli
Quoted 3 lines

My thought would be that it would be ideal to fix in 4.19 since that's where the breakage is, but having said that I don't have much insight into how bad the breakage is for the affected systems.

AFAIR, DMA corruption is typically what you would observe, which could prove difficult if you are not exactly looking for it. In any case, I don't have a BMIPS system running 4.19 right now to exercise this on, but this looks correct:

Well, I originally intended it for 4.19, but without reviews from the affected maintainers I'd fell bad about it. Now that we've got agreement I'll queue it for 4.19.