Re: use generic DMA mapping code in powerpc V4

From: Christian Zigotzky
Date: Thu Jan 31 2019 - 07:48:39 EST


Hi Christoph,

I compiled kernels for the X5000 and X1000 from your branch 'powerpc-dma.6' today.

Gitweb: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6

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

The X1000 and X5000 boot but unfortunately the P.A. Semi Ethernet doesn't work.

Error messages (X1000):

[ÂÂ 17.371736] pci 0000:00:1a.0: overflow 0x00000002691bf802+1646 of DMA mask ffffffff bus mask 0
[ÂÂ 17.371760] WARNING: CPU: 0 PID: 2496 at kernel/dma/direct.c:43 .dma_direct_map_page+0x11c/0x200
[ÂÂ 17.371762] Modules linked in:
[ÂÂ 17.371769] CPU: 0 PID: 2496 Comm: NetworkManager Not tainted 5.0.0-rc4-3_A-EON_AmigaOne_X1000_Nemo-54580-g8d7a724-dirty #2
[ÂÂ 17.371772] NIP:Â c00000000010395c LR: c000000000103a30 CTR: c000000000726f70
[ÂÂ 17.371775] REGS: c00000026900e9a0 TRAP: 0700ÂÂ Not tainted (5.0.0-rc4-3_A-EON_AmigaOne_X1000_Nemo-54580-g8d7a724-dirty)
[ÂÂ 17.371777] MSR:Â 9000000000029032 <SF,HV,EE,ME,IR,DR,RI> CR: 24002222Â XER: 20000000
[ÂÂ 17.371786] IRQMASK: 0
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ GPR00: c000000000103a30 c00000026900ec30 c000000001923f00 0000000000000052
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ GPR04: c00000026f206778 c00000026f20d458 0000000000000000 0000000000000346
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ GPR08: 0000000000000007 0000000000000000 0000000000000000 0000000000000010
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ GPR12: 0000000022002444 c000000001b10000 0000000000000000 0000000000000000
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ GPR16: 0000000010382410 0000000000000000 0000000000000000 c00000026bd9d820
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ GPR20: 0000000000000000 c00000026919c000 0000000000000000 0000000000000000
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ GPR24: 0000000000000800 c000000269190000 c0000002692a4180 c000000269190000
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ GPR28: c000000277ada1c8 000000000000066e c00000026d3c68b0 0000000000000802
[ÂÂ 17.371823] NIP [c00000000010395c] .dma_direct_map_page+0x11c/0x200
[ÂÂ 17.371827] LR [c000000000103a30] .dma_direct_map_page+0x1f0/0x200
[ÂÂ 17.371829] Call Trace:
[ÂÂ 17.371833] [c00000026900ec30] [c000000000103a30] .dma_direct_map_page+0x1f0/0x200 (unreliable)
[ÂÂ 17.371840] [c00000026900ecd0] [c00000000099b7ec] .pasemi_mac_replenish_rx_ring+0x12c/0x2a0
[ÂÂ 17.371846] [c00000026900eda0] [c00000000099dc64] .pasemi_mac_open+0x384/0x7c0
[ÂÂ 17.371853] [c00000026900ee40] [c000000000c6f484] .__dev_open+0x134/0x1e0
[ÂÂ 17.371858] [c00000026900eee0] [c000000000c6f9ec] .__dev_change_flags+0x1bc/0x210
[ÂÂ 17.371863] [c00000026900ef90] [c000000000c6fa88] .dev_change_flags+0x48/0xa0
[ÂÂ 17.371869] [c00000026900f030] [c000000000c8c88c] .do_setlink+0x3dc/0xf60
[ÂÂ 17.371875] [c00000026900f1b0] [c000000000c8dd84] .__rtnl_newlink+0x5e4/0x900
[ÂÂ 17.371880] [c00000026900f5f0] [c000000000c8e10c] .rtnl_newlink+0x6c/0xb0
[ÂÂ 17.371885] [c00000026900f680] [c000000000c89838] .rtnetlink_rcv_msg+0x2e8/0x3d0
[ÂÂ 17.371891] [c00000026900f760] [c000000000cc0f90] .netlink_rcv_skb+0x120/0x170
[ÂÂ 17.371896] [c00000026900f820] [c000000000c87318] .rtnetlink_rcv+0x28/0x40
[ÂÂ 17.371901] [c00000026900f8a0] [c000000000cc03f8] .netlink_unicast+0x208/0x2f0
[ÂÂ 17.371906] [c00000026900f950] [c000000000cc09a8] .netlink_sendmsg+0x348/0x460
[ÂÂ 17.371911] [c00000026900fa30] [c000000000c38774] .sock_sendmsg+0x44/0x70
[ÂÂ 17.371915] [c00000026900fab0] [c000000000c3a79c] .___sys_sendmsg+0x30c/0x320
[ÂÂ 17.371920] [c00000026900fca0] [c000000000c3c3b4] .__sys_sendmsg+0x74/0xf0
[ÂÂ 17.371926] [c00000026900fd90] [c000000000cb4da0] .__se_compat_sys_sendmsg+0x40/0x60
[ÂÂ 17.371932] [c00000026900fe20] [c00000000000a21c] system_call+0x5c/0x70
[ÂÂ 17.371934] Instruction dump:
[ÂÂ 17.371937] 60000000 f8610070 3d20ffff 6129fffe 79290020 e8e70000 7fa74840 409d00b8
[ÂÂ 17.371946] 3d420001 892acb59 2f890000 419e00b8 <0fe00000> 382100a0 3860ffff e8010010
[ÂÂ 17.371954] ---[ end trace a81f3c344f625f76 ]---
[ÂÂ 17.396654] IPv6: ADDRCONF(NETDEV_UP): enp0s20f3: link is not ready

--------

Additionally, Xorg doesn't start on a virtual e5500 QEMU machine anymore. I tested with the following QEMU command:

./qemu-system-ppc64 -M ppce500 -cpu e5500 -m 2048 -kernel /home/christian/Downloads/vmlinux-5.0-rc4-3-AmigaOne_X1000_X5000/X5000_and_QEMU_e5500/uImage-5.0 -drive format=raw,file=/home/christian/Downloads/Fienix-Beta120418.img,index=0,if=virtio -nic user,model=e1000 -append "rw root=/dev/vda" -device virtio-vga -device virtio-mouse-pci -device virtio-keyboard-pci -usb -soundhw es1370 -smp 4

Cheers,
Christian


On 30 January 2019 at 05:40AM, Christian Zigotzky wrote:
Hi Christoph,

Thanks a lot for the updates. I will test the full branch tomorrow.

Cheers,
Christian

Sent from my iPhone

On 29. Jan 2019, at 17:34, Christoph Hellwig <hch@xxxxxx> wrote:

On Tue, Jan 29, 2019 at 05:14:11PM +0100, Christoph Hellwig wrote:
On Tue, Jan 29, 2019 at 04:03:32PM +0100, Christian Zigotzky wrote:
Hi Christoph,

I compiled kernels for the X5000 and X1000 from your new branch
'powerpc-dma.6-debug.2' today. The kernels boot and the P.A. Semi Ethernet
works!
Thanks for testing! I'll prepare a new series that adds the other
patches on top of this one.
And that was easier than I thought - we just had a few patches left
in powerpc-dma.6, so I've rebased that branch on top of
powerpc-dma.6-debug.2:

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

Gitweb:

http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6

I hope the other patches are simple enough, so just testing the full
branch checkout should be fine for now.