Kernel 5.0

AmigaOne X1000 platform specific issues related to Linux only.
User avatar
xeno74
Posts: 9348
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.0

Post by xeno74 »

Next step: 63a6e350e037a21e9a88c8b710129bea7049a80f (powerpc/dma: use the dma_direct mapping routines)

Code: Select all

git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a

Code: Select all

git checkout 63a6e350e037a21e9a88c8b710129bea7049a80f
Link to the Git: powerpc-dma.6

Error message:

Code: Select all

arch/powerpc/kernel/dma.o:(.data.rel.ro+0x0): undefined reference to `__dma_nommu_alloc_coherent'
arch/powerpc/kernel/dma.o:(.data.rel.ro+0x8): undefined reference to `__dma_nommu_free_coherent'
Makefile:1027: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9348
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.0

Post by xeno74 »

Next step: 21074ef03c0816ae158721a78cabe9035938dddd (powerpc/dma: use the generic direct mapping bypass)

Code: Select all

git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a

Code: Select all

git checkout 21074ef03c0816ae158721a78cabe9035938dddd
Link to the Git: powerpc-dma.6

I was able to compile the kernel for the AmigaOne X1000 (Nemo board with PA Semi PA6T-1682M SoC). It boots but the PA Semi onboard ethernet doesn't work.

dmesg:

Code: Select all

[   12.698063] pasemi_mac 0000:00:14.3 enp0s20f3: renamed from eth0
[   16.516966] IPv6: ADDRCONF(NETDEV_UP): enp0s20f3: link is not ready
[   16.521025] pci 0000:00:1a.0: overflow 0x000000026a587802+1646 of DMA mask ffffffff bus mask 0
[   16.521047] WARNING: CPU: 0 PID: 2318 at kernel/dma/direct.c:43 .dma_direct_map_page+0x11c/0x200
[   16.521049] Modules linked in:
[   16.521056] CPU: 0 PID: 2318 Comm: NetworkManager Not tainted 5.0.0-rc2-2_A-EON_AmigaOne_X1000_Nemo-54576-g21074ef-dirty #1
[   16.521059] NIP:  c00000000010395c LR: c000000000103a30 CTR: 0000000000000000
[   16.521062] REGS: c00000026a1a29a0 TRAP: 0700   Not tainted  (5.0.0-rc2-2_A-EON_AmigaOne_X1000_Nemo-54576-g21074ef-dirty)
[   16.521064] MSR:  900000000202b032 <SF,HV,VEC,EE,FP,ME,IR,DR,RI>  CR: 22002442  XER: 20000000
[   16.521074] IRQMASK: 0 
               GPR00: c000000000103a30 c00000026a1a2c30 c000000001923f00 0000000000000052 
               GPR04: c00000026f206778 c00000026f20d458 c000000001ab1178 7063693a30303030 
               GPR08: 0000000000000007 0000000000000000 0000000000000000 0000000000000010 
               GPR12: 3a30303a31612e30 c000000001b10000 0000000000a79020 0000000000ace140 
               GPR16: 00000000fffdd958 0000000000000000 0000000000000000 c00000026be92220 
               GPR20: 0000000000000000 c00000026a470000 0000000000000000 0000000000000000 
               GPR24: 0000000000000800 c00000026a1c0000 c00000026bc69280 c00000026a1c0000 
               GPR28: c000000277b1f588 000000000000066e c00000026d3c68b0 0000000000000802 
[   16.521111] NIP [c00000000010395c] .dma_direct_map_page+0x11c/0x200
[   16.521114] LR [c000000000103a30] .dma_direct_map_page+0x1f0/0x200
[   16.521116] Call Trace:
[   16.521120] [c00000026a1a2c30] [c000000000103a30] .dma_direct_map_page+0x1f0/0x200 (unreliable)
[   16.521126] [c00000026a1a2cd0] [c00000000099b84c] .pasemi_mac_replenish_rx_ring+0x12c/0x2a0
[   16.521131] [c00000026a1a2da0] [c00000000099dcc4] .pasemi_mac_open+0x384/0x7c0
[   16.521137] [c00000026a1a2e40] [c000000000c6f4e4] .__dev_open+0x134/0x1e0
[   16.521142] [c00000026a1a2ee0] [c000000000c6fa4c] .__dev_change_flags+0x1bc/0x210
[   16.521147] [c00000026a1a2f90] [c000000000c6fae8] .dev_change_flags+0x48/0xa0
[   16.521153] [c00000026a1a3030] [c000000000c8c8ec] .do_setlink+0x3dc/0xf60
[   16.521158] [c00000026a1a31b0] [c000000000c8dde4] .__rtnl_newlink+0x5e4/0x900
[   16.521163] [c00000026a1a35f0] [c000000000c8e16c] .rtnl_newlink+0x6c/0xb0
[   16.521167] [c00000026a1a3680] [c000000000c89898] .rtnetlink_rcv_msg+0x2e8/0x3d0
[   16.521172] [c00000026a1a3760] [c000000000cc0ff0] .netlink_rcv_skb+0x120/0x170
[   16.521177] [c00000026a1a3820] [c000000000c87378] .rtnetlink_rcv+0x28/0x40
[   16.521181] [c00000026a1a38a0] [c000000000cc0458] .netlink_unicast+0x208/0x2f0
[   16.521186] [c00000026a1a3950] [c000000000cc0a08] .netlink_sendmsg+0x348/0x460
[   16.521190] [c00000026a1a3a30] [c000000000c387d4] .sock_sendmsg+0x44/0x70
[   16.521195] [c00000026a1a3ab0] [c000000000c3a7fc] .___sys_sendmsg+0x30c/0x320
[   16.521199] [c00000026a1a3ca0] [c000000000c3c414] .__sys_sendmsg+0x74/0xf0
[   16.521204] [c00000026a1a3d90] [c000000000cb4e00] .__se_compat_sys_sendmsg+0x40/0x60
[   16.521210] [c00000026a1a3e20] [c00000000000a21c] system_call+0x5c/0x70
[   16.521212] Instruction dump:
[   16.521215] 60000000 f8610070 3d20ffff 6129fffe 79290020 e8e70000 7fa74840 409d00b8 
[   16.521222] 3d420001 892acb59 2f890000 419e00b8 <0fe00000> 382100a0 3860ffff e8010010 
[   16.521231] ---[ end trace 2129e4121bbdd0e9 ]---
I wasn't able to compile it for the AmigaOne X5000 (Cyrus+ board with Qoriq P5020 SoC). Error message:

Code: Select all

  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CC      arch/powerpc/sysdev/fsl_pci.o
arch/powerpc/sysdev/fsl_pci.c: In function 'fsl_pci_dma_set_mask':
arch/powerpc/sysdev/fsl_pci.c:142:21: error: 'dma_nommu_ops' undeclared (first use in this function)
   set_dma_ops(dev, &dma_nommu_ops);
                     ^
arch/powerpc/sysdev/fsl_pci.c:142:21: note: each undeclared identifier is reported only once for each function it appears in
scripts/Makefile.build:276: recipe for target 'arch/powerpc/sysdev/fsl_pci.o' failed
make[2]: *** [arch/powerpc/sysdev/fsl_pci.o] Error 1
scripts/Makefile.build:492: recipe for target 'arch/powerpc/sysdev' failed
make[1]: *** [arch/powerpc/sysdev] Error 2
Makefile:1049: recipe for target 'arch/powerpc' failed
make: *** [arch/powerpc] Error 2
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9348
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.0

Post by xeno74 »

Back to the step: 240d7ecd7f6fa62e074e8a835e620047954f0b28 (powerpc/dma: use the dma-direct allocator for coherent platforms)

Code: Select all

git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a

Code: Select all

git checkout 240d7ecd7f6fa62e074e8a835e620047954f0b28
Link to the Git: powerpc-dma.6

I modified the dma.c patch because of the undefined references to '__dma_nommu_free_coherent' and '__dma_nommu_alloc_coherent':

Code: Select all

@@ -163,8 +99,13 @@ static inline void dma_nommu_sync_single(struct device *dev,
 #endif
 
 const struct dma_map_ops dma_nommu_ops = {
+       .alloc                          = dma_direct_alloc,
+       .free                           = dma_direct_free,
        .map_sg                         = dma_nommu_map_sg,
        .unmap_sg                       = dma_nommu_unmap_sg,
        .dma_supported                  = dma_direct_supported,
The X1000 boots and the PASEMI onboard ethernet works! X5000 (P5020 board): U-Boot loads the kernel and the dtb file. Then the kernel starts but it doesn't find any hard disks (partitions).
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9348
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.0

Post by xeno74 »

FYI
Christoph Hellwig wrote: Thanks. But we are exactly missing the steps that are relevant. I've
pushed a fixed up powerpc-dma.6 tree, which will only change starting from the first commit that didn't link.

The first commit that changed from the old one is this one:

http://git.infradead.org/users/hch/misc ... 8ab81f0775

which was that one that your compile failed on first.

Thanks again for all your work!
Christoph Hellwig wrote: So 257002094bc5935dd63207a380d9698ab81f0775 above is the fixed version for the commit - this switched the ifdef in dma.c around that I had inverted. Can you try that one instead? And then move on with the commits after it in the updated powerpc-dma.6 branch - they are identical to the original branch except for carrying this fix forward.
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9348
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.0

Post by xeno74 »

Please test the RC2.

Thanks
xeno74 wrote:Hi All,

Here is the RC2 of kernel 5.0 for testing.

New:
Please note: I tried to compile the RC2 without the latest DRM updates for the ATI FireMV 2250 and ATI FirePro 2260 from the latest Git kernel today.
Unfortunately there are so many new dependencies because of many new small and big DRM fixes so I wasn't able to remove the first DRM updates today.
The ATI FireMV 2250 and ATI FirePro 2260 work alone without any problems in a X5000 but they don't work with a HD7xxx together anymore.
Ace doesn't have any error messages for us so it is difficult for us to report it to the developers.

Download: vmlinux-5.0-rc2-AmigaOne_X1000_X5000.tar.gz

Screenshot of Fienix with the RC2 of kernel 5.0 connected to a Leopard server:

Image

Please test it.

Thanks,
Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
tbreeden
Posts: 160
Joined: Sat Jun 18, 2011 12:57 am
Location: Charlottesville, VA, USA
Contact:

Re: Kernel 5.0

Post by tbreeden »

Download: vmlinux-5.0-rc2-AmigaOne_X1000_X5000.tar.gz
Please test it.
kernel 5.0-rc2 looks to be good on my X1000 Ubuntu :) \

tom
Screenshot at 2019-01-17 02-19-59.png
User avatar
xeno74
Posts: 9348
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.0

Post by xeno74 »

tbreeden wrote:
Download: vmlinux-5.0-rc2-AmigaOne_X1000_X5000.tar.gz
Please test it.
kernel 5.0-rc2 looks to be good on my X1000 Ubuntu :) \

tom
Many thanks for testing! :-)

-- Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9348
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.0

Post by xeno74 »

Next step: 257002094bc5935dd63207a380d9698ab81f0775 (powerpc/dma: use the dma-direct allocator for coherent platforms)

Code: Select all

git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a

Code: Select all

git checkout 257002094bc5935dd63207a380d9698ab81f0775
Link to the Git: powerpc-dma.6

env LANG=C make CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc zImage

The X1000 boots and the PASEMI onboard ethernet works!

Bad news for the X5000 (P5020 board). U-Boot loads the kernel and the dtb file. Then the kernel starts but it doesn't find any hard disks (partitions).
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9348
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.0

Post by xeno74 »

FYI *** Update ***: use generic DMA mapping code in powerpc V4

-- Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9348
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.0

Post by xeno74 »

FYI:
Christoph Hellwig wrote: Hi Christian,

can you check if the debug printks in this patch trigger?
Patch:

Code: Select all

diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index 355d16acee6d..e46c9b64ec0d 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -118,8 +118,11 @@ struct page *__dma_direct_alloc_pages(struct device *dev, size_t size,
 			page = NULL;
 		}
 	}
-	if (!page)
+	if (!page) {
 		page = alloc_pages_node(dev_to_node(dev), gfp, page_order);
+		if (!page)
+			pr_warn("failed to allocate memory with gfp 0x%x\n", gfp);
+	}
 
 	if (page && !dma_coherent_ok(dev, page_to_phys(page), size)) {
 		__free_pages(page, page_order);
@@ -139,6 +142,10 @@ struct page *__dma_direct_alloc_pages(struct device *dev, size_t size,
 		}
 	}
 
+	if (!page) {
+		pr_warn("failed to allocate DMA memory!\n");
+		dump_stack();
+	}
 	return page;
 }
Christoph Hellwig wrote: On top of 257002094bc5935dd63207a380d9698ab81f0775, that is the first
one you identified as breaking the detection of the SATA disks.
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
Post Reply