Page 3 of 19

Re: Kernel 4.21

Posted: Thu Dec 13, 2018 10:35 am
by xeno74
xeno74 wrote:Today I tried the first patch with the last good commit (977706f9755d2d697aa6f45b4f9f0e07516efeda).

0001-get_required_mask.patch

Code: Select all

>From 83a4b87de6bc6a75b500c9959de88e2157fbcd7c Mon Sep 17 00:00:00 2001
From: Christoph Hellwig <[email protected]>
Date: Wed, 12 Dec 2018 15:07:49 +0100
Subject: get_required_mask

---
 arch/powerpc/kernel/dma-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c
index 5b15e53ee43d..2e682004959f 100644
--- a/arch/powerpc/kernel/dma-iommu.c
+++ b/arch/powerpc/kernel/dma-iommu.c
@@ -152,7 +152,7 @@ u64 dma_iommu_get_required_mask(struct device *dev)
 		return 0;
 
 	if (dev_is_pci(dev)) {
-		u64 bypass_mask = dma_nommu_get_required_mask(dev);
+		u64 bypass_mask = dma_direct_get_required_mask(dev);
 
 		if (dma_iommu_bypass_supported(dev, bypass_mask))
 			return bypass_mask;
-- 
2.19.2
Unfortunately this patch is already included in the last good commit (977706f9755d2d697aa6f45b4f9f0e07516efeda).
I was wrong. This patch isn't included in the last good commit. I tried it again but I get the following error message:

Code: Select all

MODPOST vmlinux.o
arch/powerpc/kernel/dma-iommu.o: In function `.dma_iommu_get_required_mask':
(.text+0x274): undefined reference to `.dma_direct_get_required_mask'
make: *** [vmlinux] Error 1

Re: Kernel 4.21

Posted: Thu Dec 13, 2018 12:31 pm
by xeno74
FYI:
Christoph Hellwig wrote: Sorry, you need this one liner before all the patches posted last time:

Code: Select all

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index d8819e3a1eb1..7e78c2798f2f 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -154,6 +154,7 @@ config PPC
 	select CLONE_BACKWARDS
 	select DCACHE_WORD_ACCESS		if PPC64 && CPU_LITTLE_ENDIAN
 	select DYNAMIC_FTRACE			if FUNCTION_TRACER
+	select DMA_DIRECT_OPS
 	select EDAC_ATOMIC_SCRUB
 	select EDAC_SUPPORT
 	select GENERIC_ATOMIC64			if PPC32

Re: Kernel 4.21

Posted: Thu Dec 13, 2018 2:31 pm
by xeno74
xeno74 wrote:Today I tried the first patch with the last good commit (977706f9755d2d697aa6f45b4f9f0e07516efeda).

0001-get_required_mask.patch

Code: Select all

>From 83a4b87de6bc6a75b500c9959de88e2157fbcd7c Mon Sep 17 00:00:00 2001
From: Christoph Hellwig <[email protected]>
Date: Wed, 12 Dec 2018 15:07:49 +0100
Subject: get_required_mask

---
 arch/powerpc/kernel/dma-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c
index 5b15e53ee43d..2e682004959f 100644
--- a/arch/powerpc/kernel/dma-iommu.c
+++ b/arch/powerpc/kernel/dma-iommu.c
@@ -152,7 +152,7 @@ u64 dma_iommu_get_required_mask(struct device *dev)
 		return 0;
 
 	if (dev_is_pci(dev)) {
-		u64 bypass_mask = dma_nommu_get_required_mask(dev);
+		u64 bypass_mask = dma_direct_get_required_mask(dev);
 
 		if (dma_iommu_bypass_supported(dev, bypass_mask))
 			return bypass_mask;
-- 
2.19.2
Result: PASEMI onboard ethernet works and the X5000 (P5020 board) boots.

Re: Kernel 4.21

Posted: Thu Dec 13, 2018 6:32 pm
by xeno74
Next patch: 0002-swiotlb-dma_supported.patch for the last good commit (977706f9755d2d697aa6f45b4f9f0e07516efeda).

Code: Select all

 arch/powerpc/kernel/dma-swiotlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c
index aa11625c6691..52ee531c1a0d 100644
--- a/arch/powerpc/kernel/dma-swiotlb.c
+++ b/arch/powerpc/kernel/dma-swiotlb.c
@@ -36,7 +36,7 @@ const struct dma_map_ops powerpc_swiotlb_dma_ops = {
 	.free = __dma_nommu_free_coherent,
 	.map_sg = swiotlb_map_sg_attrs,
 	.unmap_sg = swiotlb_unmap_sg_attrs,
-	.dma_supported = swiotlb_dma_supported,
+	.dma_supported = dma_direct_supported,
 	.map_page = swiotlb_map_page,
 	.unmap_page = swiotlb_unmap_page,
 	.sync_single_for_cpu = swiotlb_sync_single_for_cpu,
The PASEMI onboard ethernet works and the X5000 (P5020 board) boots.

Re: Kernel 4.21

Posted: Thu Dec 13, 2018 10:50 pm
by xeno74
Next patch: 0003-nommu-dma_supported.patch

Code: Select all

 arch/powerpc/kernel/dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
index a6590aa77181..f53d11d35230 100644
--- a/arch/powerpc/kernel/dma.c
+++ b/arch/powerpc/kernel/dma.c
@@ -179,7 +179,7 @@ const struct dma_map_ops dma_nommu_ops = {
 	.alloc				= __dma_nommu_alloc_coherent,
 	.free				= __dma_nommu_free_coherent,
 	.map_sg				= dma_nommu_map_sg,
-	.dma_supported			= dma_nommu_dma_supported,
+	.dma_supported			= dma_direct_supported,
 	.map_page			= dma_nommu_map_page,
 #ifdef CONFIG_NOT_COHERENT_CACHE
 	.sync_single_for_cpu 		= dma_nommu_sync_single,
No problems with the PASEMI onboard ethernet and the P5020 board boots.

Re: Kernel 4.21

Posted: Fri Dec 14, 2018 12:40 pm
by xeno74
Next patch: 0004-alloc-free.patch

Code: Select all

arch/powerpc/kernel/dma.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
index f53d11d35230..d3db6d879559 100644
--- a/arch/powerpc/kernel/dma.c
+++ b/arch/powerpc/kernel/dma.c
@@ -176,8 +176,13 @@ static inline void dma_nommu_sync_single(struct device *dev,
 #endif
 
 const struct dma_map_ops dma_nommu_ops = {
+#ifdef CONFIG_NOT_COHERENT_CACHE
 	.alloc				= __dma_nommu_alloc_coherent,
 	.free				= __dma_nommu_free_coherent,
+#else
+	.alloc				= dma_direct_alloc,
+	.free				= dma_direct_free,
+#endif
 	.map_sg				= dma_nommu_map_sg,
 	.dma_supported			= dma_direct_supported,
 	.map_page			= dma_nommu_map_page,
Result: The PASEMI onboard ethernet works and the P5020 board boots!

Re: Kernel 4.21

Posted: Sun Dec 16, 2018 7:01 pm
by xeno74
FYI:
Christoph Hellwig wrote: FYI, given that we are one week before the expected 4.20 release
date and I haven't found the bug plaging Christians setups I think
we need to defer most of this to the next merge window.

I'd still like to get a few bits in earlier, which I will send out
separately now.

Re: Kernel 4.21

Posted: Fri Dec 21, 2018 9:21 pm
by xeno74

Re: Kernel 4.21

Posted: Wed Dec 26, 2018 9:40 pm
by xeno74
Hi All,

The Linux 4.21 kernel merge window is open for merging. Linus Torvalds has added a lot of new source code to the Linux Git. I created the first alpha today.

New:
Download: vmlinux-4.21-alpha1-AmigaOne_X1000_X5000.tar.gz

Image

Please test it.

Thanks,
Christian

Re: Kernel 4.21

Posted: Wed Dec 26, 2018 10:41 pm
by Skateman
And here it is.... running smooth on the AmigaOne X5000 :-)

Image

The bigger picture... http://www.skateman.nl/wp-content/uploa ... 223708.png