Re: use generic DMA mapping code in powerpc V4
Great! I owe you a night worth of beers at a conference or if you come anywhere near Innsbruck!
Re: use generic DMA mapping code in powerpc V4
On 12 February 2019 at 8:31PM, Christian Zigotzky wrote: On 12 February 2019 at 4:25PM, Christoph Hellwig wrote: On Tue, Feb 12, 2019 at 01:42:56PM +0100, Christian Zigotzky wrote: On 11 February 2019 at 08:38AM, Christoph Hellwig wrote: On Sun, Feb 10, 2019 at 01:00:20PM +0100, Christian Zigotzky wrote: I tested the whole series today. The kernels boot and the P.A. Semi Ethernet works! :-) Thanks a lot! I also tested it in a virtual e5500 QEMU machine today. Unfortunately the kernel crashes. This looks like a patch I fixed in mainline a while ago, but which the powerpc tree didn't have yet. I've cherry picked this commit ("swiotlb: clear io_tlb_start and io_tlb_end in swiotlb_exit") and added it to the powerpc-dma.6 tree, please retry with that one. Hello Christoph, Have you added it to the powerpc-dma.6 tree yet? The last commit was 4 days ago. I added it, but forgot to push it out. It is there now, sorry: http://git.infradead.org/users/hch/misc.git/commitdiff/2cf0745b7420af4a3e871d5a970a45662dfae69c Hi Christoph Many thanks! Your Git kernel works in a virtual e5500 machine now! :-) I think we have reached the end of testing! All things are working with your DMA updates. I am looking forward to testing your DMA changes in the next merge window again. :-) Cheers Christian Edit: typo
Re: use generic DMA mapping code in powerpc V4
On 12 February 2019 at 4:25PM, Christoph Hellwig wrote: On Tue, Feb 12, 2019 at 01:42:56PM +0100, Christian Zigotzky wrote: On 11 February 2019 at 08:38AM, Christoph Hellwig wrote: On Sun, Feb 10, 2019 at 01:00:20PM +0100, Christian Zigotzky wrote: I tested the whole series today. The kernels boot and the P.A. Semi Ethernet works! :-) Thanks a lot! I also tested it in a virtual e5500 QEMU machine today. Unfortunately the kernel crashes. This looks like a patch I fixed in mainline a while ago, but which the powerpc tree didn't have yet. I've cherry picked this commit ("swiotlb: clear io_tlb_start and io_tlb_end in swiotlb_exit") and added it to the powerpc-dma.6 tree, please retry with that one. Hello Christoph, Have you added it to the powerpc-dma.6 tree yet? The last commit was 4 days ago. I added it, but forgot to push it out. It is there now, sorry: http://git.infradead.org/users/hch/misc.git/commitdiff/2cf0745b7420af4a3e871d5a970a45662dfae69c Hi Christoph Many thanks! Your Git kernel works in a virtual e5500 machine now! :-) I think we have reached the end of testing! All things are working with your DMA updates. I am looking forward to test your DMA changes in the next merge window again. :-) Cheers Christian
Re: use generic DMA mapping code in powerpc V4
On Tue, Feb 12, 2019 at 01:42:56PM +0100, Christian Zigotzky wrote: > On 11 February 2019 at 08:38AM, Christoph Hellwig wrote: >> On Sun, Feb 10, 2019 at 01:00:20PM +0100, Christian Zigotzky wrote: >>> I tested the whole series today. The kernels boot and the P.A. Semi >>> Ethernet works! :-) Thanks a lot! >>> >>> I also tested it in a virtual e5500 QEMU machine today. Unfortunately the >>> kernel crashes. >> This looks like a patch I fixed in mainline a while ago, but which >> the powerpc tree didn't have yet. >> >> I've cherry picked this commit >> ("swiotlb: clear io_tlb_start and io_tlb_end in swiotlb_exit") >> >> and added it to the powerpc-dma.6 tree, please retry with that one. >> > Hello Christoph, > > Have you added it to the powerpc-dma.6 tree yet? The last commit was 4 days > ago. I added it, but forgot to push it out. It is there now, sorry: http://git.infradead.org/users/hch/misc.git/commitdiff/2cf0745b7420af4a3e871d5a970a45662dfae69c
Re: use generic DMA mapping code in powerpc V4
On 11 February 2019 at 08:38AM, Christoph Hellwig wrote: On Sun, Feb 10, 2019 at 01:00:20PM +0100, Christian Zigotzky wrote: I tested the whole series today. The kernels boot and the P.A. Semi Ethernet works! :-) Thanks a lot! I also tested it in a virtual e5500 QEMU machine today. Unfortunately the kernel crashes. This looks like a patch I fixed in mainline a while ago, but which the powerpc tree didn't have yet. I've cherry picked this commit ("swiotlb: clear io_tlb_start and io_tlb_end in swiotlb_exit") and added it to the powerpc-dma.6 tree, please retry with that one. Hello Christoph, Have you added it to the powerpc-dma.6 tree yet? The last commit was 4 days ago. Thanks, Christian
Re: use generic DMA mapping code in powerpc V4
On Sun, Feb 10, 2019 at 01:00:20PM +0100, Christian Zigotzky wrote: > I tested the whole series today. The kernels boot and the P.A. Semi > Ethernet works! :-) Thanks a lot! > > I also tested it in a virtual e5500 QEMU machine today. Unfortunately the > kernel crashes. This looks like a patch I fixed in mainline a while ago, but which the powerpc tree didn't have yet. I've cherry picked this commit ("swiotlb: clear io_tlb_start and io_tlb_end in swiotlb_exit") and added it to the powerpc-dma.6 tree, please retry with that one.
Re: use generic DMA mapping code in powerpc V4
Hi Christoph, Mario successfully tested a kernel from your Git [1] on his T2080rdb today. Link to the log: https://gitlab.com/oshw-powerpc-notebook/T2080customizations/blob/master/kernel/dma_fix/kernel_dma_fix_log.txt He wrote: Please, note that all of the above kernel runs just fine with the T2080rdb, however did not had the time to test extensively (tested: login into MATE graphical desktop environment, used ArctiFox for opening couple of websites, then played Neverball). —— Cheers, Christian [1] http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6
Re: use generic DMA mapping code in powerpc V4
Hi Christoph, On 08 February 2019 at 10:18AM, Christoph Hellwig wrote: On Fri, Feb 08, 2019 at 10:01:46AM +0100, Christian Zigotzky wrote: Hi Christoph, Your new patch fixes the problems with the P.A. Semi Ethernet! :-) Thanks a lot once again for testing! Now can you test with this patch and the whole series? I've updated the powerpc-dma.6 branch to include this fix. I tested the whole series today. The kernels boot and the P.A. Semi Ethernet works! :-) Thanks a lot! I also tested it in a virtual e5500 QEMU machine today. Unfortunately the kernel crashes. Log: [ 54.624330] BUG: Unable to handle kernel data access at 0xc06c008a0013014a [ 54.625640] Faulting instruction address: 0xc0027e7c [ 54.626140] Oops: Kernel access of bad area, sig: 11 [#1] [ 54.626456] BE SMP NR_CPUS=4 QEMU e500 [ 54.626876] Modules linked in: [ 54.627284] CPU: 1 PID: 1876 Comm: systemd-journal Not tainted 5.0.0-rc5-DMA_A1-X5000-54581-gda1d065-dirty #1 [ 54.627819] NIP: c0027e7c LR: c00b5264 CTR: [ 54.628173] REGS: c0007ffeb700 TRAP: 0300 Not tainted (5.0.0-rc5-DMA_A1-X5000-54581-gda1d065-dirty) [ 54.628607] MSR: 80009000 CR: 44008486 XER: [ 54.629023] DEAR: c06c008a0013014a ESR: 0080 IRQMASK: 0 [ 54.629023] GPR00: 5254 c0007ffeb990 c16b2000 c06c008a0013014a [ 54.629023] GPR04: c0007c54f8c0 0058 0006 [ 54.629023] GPR08: 7c54f8c0 006c008a0013014a c0007c86c000 [ 54.629023] GPR12: 28002482 c00038c0 c00078dfaa70 [ 54.629023] GPR16: c00078366c00 005e [ 54.629023] GPR20: c0007c54f8c0 0007 c00078dfa000 [ 54.629023] GPR24: 0047 803f6470 [ 54.629023] GPR28: c0007928d470 c00078801dc0 005e c00078dfa7c0 [ 54.632572] NIP [c0027e7c] .memcpy+0x1fc/0x288 [ 54.632886] LR [c00b5264] .swiotlb_tbl_sync_single+0xb0/0xe4 [ 54.633221] Call Trace: [ 54.633513] [c0007ffeb990] [c0007ffeba70] 0xc0007ffeba70 (unreliable) [ 54.633988] [c0007ffeba00] [c00b41e4] .dma_direct_sync_single_for_cpu+0x58/0x6c [ 54.634436] [c0007ffeba70] [c0788da4] .e1000_clean_rx_irq+0x1bc/0x4c8 [ 54.634857] [c0007ffebb90] [c078667c] .e1000_clean+0x714/0x8d4 [ 54.635263] [c0007ffebcc0] [c0a3f15c] .net_rx_action+0x11c/0x2a4 [ 54.635712] [c0007ffebdb0] [c0c48c20] .__do_softirq+0x150/0x2a8 [ 54.636211] [c0007ffebeb0] [c0064184] .irq_exit+0x6c/0xc4 [ 54.636533] [c0007ffebf20] [c0004124] .__do_irq+0x80/0x94 [ 54.636985] [c0007ffebf90] [c000eca0] .call_do_irq+0x14/0x24 [ 54.637371] [c0007c86fd80] [c00041c0] .do_IRQ+0x88/0xc4 [ 54.637737] [c0007c86fe20] [c0012920] exc_0x500_common+0xd8/0xdc [ 54.638104] Instruction dump: [ 54.638451] e861fff8 4e800020 7cd01120 7ca62850 38e0 28a50010 409f0010 8804 [ 54.638887] 9803 38e70001 409e0010 7c07222e <7c071b2e> 38e70002 409d000c 7c07202e [ 54.639594] ---[ end trace a4861de7e4c199f7 ]--- [ 54.639873] [ 55.640484] Kernel panic - not syncing: Aiee, killing interrupt handler! [ 55.641556] Rebooting in 180 seconds.. - I tested with the following QEMU commands: ./qemu-system-ppc64 -M ppce500 -cpu e5500 -m 2048 -nographic -kernel /home/christian/Downloads/vmlinux-5.0-rc5-2-AmigaOne_X1000_X5000/X5000_and_QEMU_e5500/uImage-5.0 -nic user,model=e1000 -drive format=raw,file=/home/christian/Downloads/MATE_PowerPC_Remix_2017_0.9.img,index=0,if=virtio -append "rw root=/dev/vda" -smp 4 ./qemu-system-ppc64 -M ppce500 -cpu e5500 -m 2048 -kernel /home/christian/Downloads/vmlinux-5.0-rc5-2-AmigaOne_X1000_X5000/X5000_and_QEMU_e5500/uImage-5.0 -drive format=raw,file=/home/christian/Downloads/MATE_PowerPC_Remix_2017_0.9.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 The RC5 of kernel 5.0 boots without any problems in this virtual machine. Cheers, Christian
Re: use generic DMA mapping code in powerpc V4
OK, I will test it. — Christian Sent from my iPhone > On 8. Feb 2019, at 10:18, Christoph Hellwig wrote: > >> On Fri, Feb 08, 2019 at 10:01:46AM +0100, Christian Zigotzky wrote: >> Hi Christoph, >> >> Your new patch fixes the problems with the P.A. Semi Ethernet! :-) > > Thanks a lot once again for testing! > > Now can you test with this patch and the whole series? > > I've updated the powerpc-dma.6 branch to include this fix.
Re: use generic DMA mapping code in powerpc V4
On Fri, Feb 08, 2019 at 10:01:46AM +0100, Christian Zigotzky wrote: > Hi Christoph, > > Your new patch fixes the problems with the P.A. Semi Ethernet! :-) Thanks a lot once again for testing! Now can you test with this patch and the whole series? I've updated the powerpc-dma.6 branch to include this fix.
Re: use generic DMA mapping code in powerpc V4
Hi Christoph, Your new patch fixes the problems with the P.A. Semi Ethernet! :-) Thanks, Christian On 07 February 2019 at 05:34AM, Christian Zigotzky wrote: Hi Christoph, I also didn’t notice the 32-bit DMA mask in your patch. I have to read your patches and descriptions carefully in the future. I will test your new patch at the weekend. Thanks, Christian Sent from my iPhone On 6. Feb 2019, at 16:16, Christoph Hellwig wrote: On Wed, Feb 06, 2019 at 04:15:05PM +0100, Christoph Hellwig wrote: The last good one was 29e7e2287e196f48fe5d2a6e017617723ea979bf ("dma-direct: we might need GFP_DMA for 32-bit dma masks"), if I remember correctly. powerpc/dma: use the dma_direct mapping routines was the one that you said makes the pasemi ethernet stop working. Can you post the dmesg from the failing runs? But I just noticed I sent you a wrong patch - the pasemi ethernet should set a 64-bit DMA mask, not 32-bit. Updated version below, 32-bit would just keep the previous status quo. commit 6c8f88045dee3597b9ce2ea5371eee37073a Author: Christoph Hellwig Date: Mon Feb 4 13:38:22 2019 +0100 pasemi WIP diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c b/drivers/net/ethernet/pasemi/pasemi_mac.c index 8a31a02c9f47..2d7d1589490a 100644 --- a/drivers/net/ethernet/pasemi/pasemi_mac.c +++ b/drivers/net/ethernet/pasemi/pasemi_mac.c @@ -1716,6 +1716,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent) err = -ENODEV; goto out; } +dma_set_mask(>dma_pdev->dev, DMA_BIT_MASK(64)); mac->iob_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa001, NULL); if (!mac->iob_pdev) {
Re: use generic DMA mapping code in powerpc V4
Hi Christoph, I also didn’t notice the 32-bit DMA mask in your patch. I have to read your patches and descriptions carefully in the future. I will test your new patch at the weekend. Thanks, Christian Sent from my iPhone > On 6. Feb 2019, at 16:16, Christoph Hellwig wrote: > >> On Wed, Feb 06, 2019 at 04:15:05PM +0100, Christoph Hellwig wrote: >> The last good one was 29e7e2287e196f48fe5d2a6e017617723ea979bf >> ("dma-direct: we might need GFP_DMA for 32-bit dma masks"), if I >> remember correctly. powerpc/dma: use the dma_direct mapping routines >> was the one that you said makes the pasemi ethernet stop working. >> >> Can you post the dmesg from the failing runs? > > But I just noticed I sent you a wrong patch - the pasemi ethernet > should set a 64-bit DMA mask, not 32-bit. Updated version below, > 32-bit would just keep the previous status quo. > > commit 6c8f88045dee3597b9ce2ea5371eee37073a > Author: Christoph Hellwig > Date: Mon Feb 4 13:38:22 2019 +0100 > >pasemi WIP > > diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c > b/drivers/net/ethernet/pasemi/pasemi_mac.c > index 8a31a02c9f47..2d7d1589490a 100644 > --- a/drivers/net/ethernet/pasemi/pasemi_mac.c > +++ b/drivers/net/ethernet/pasemi/pasemi_mac.c > @@ -1716,6 +1716,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct > pci_device_id *ent) >err = -ENODEV; >goto out; >} > +dma_set_mask(>dma_pdev->dev, DMA_BIT_MASK(64)); > >mac->iob_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa001, NULL); >if (!mac->iob_pdev) {
Re: use generic DMA mapping code in powerpc V4
On Wed, Feb 06, 2019 at 04:15:05PM +0100, Christoph Hellwig wrote: > The last good one was 29e7e2287e196f48fe5d2a6e017617723ea979bf > ("dma-direct: we might need GFP_DMA for 32-bit dma masks"), if I > remember correctly. powerpc/dma: use the dma_direct mapping routines > was the one that you said makes the pasemi ethernet stop working. > > Can you post the dmesg from the failing runs? But I just noticed I sent you a wrong patch - the pasemi ethernet should set a 64-bit DMA mask, not 32-bit. Updated version below, 32-bit would just keep the previous status quo. commit 6c8f88045dee3597b9ce2ea5371eee37073a Author: Christoph Hellwig Date: Mon Feb 4 13:38:22 2019 +0100 pasemi WIP diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c b/drivers/net/ethernet/pasemi/pasemi_mac.c index 8a31a02c9f47..2d7d1589490a 100644 --- a/drivers/net/ethernet/pasemi/pasemi_mac.c +++ b/drivers/net/ethernet/pasemi/pasemi_mac.c @@ -1716,6 +1716,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent) err = -ENODEV; goto out; } + dma_set_mask(>dma_pdev->dev, DMA_BIT_MASK(64)); mac->iob_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa001, NULL); if (!mac->iob_pdev) {
Re: use generic DMA mapping code in powerpc V4
On Wed, Feb 06, 2019 at 02:45:34PM +0100, Christian Zigotzky wrote: > I patched the source code from the Git 'powerpc-dma.6' with your patch > today. Unfortunately the P.A. Semi Ethernet doesn't work with the patched > Git kernel. > > After that I tried it with the patch applied over the working setup again > (powerpc/dma: use the dma_direct mapping routines). Unfortunately after > compiling > and booting, the P.A. Semi Ethernet doesn't work either. The last good one was 29e7e2287e196f48fe5d2a6e017617723ea979bf ("dma-direct: we might need GFP_DMA for 32-bit dma masks"), if I remember correctly. powerpc/dma: use the dma_direct mapping routines was the one that you said makes the pasemi ethernet stop working. Can you post the dmesg from the failing runs?
Re: use generic DMA mapping code in powerpc V4
On 04 February 2019 at 01:38PM, Christoph Hellwig wrote: It seems like the pasemi driver fails to set a DMA mask, but seems otherwise 64-bit DMA capable. The old PPC code didn't verify the dma mask during the map operations, but the x86-derived generic code does. This patch just sets the DMA mask. Olof: does this look ok? The DMA device seems to not directly bound by the net driver, but not really used by anything else in tree either.. diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c b/drivers/net/ethernet/pasemi/pasemi_mac.c index d21041554507..d98bd447c536 100644 --- a/drivers/net/ethernet/pasemi/pasemi_mac.c +++ b/drivers/net/ethernet/pasemi/pasemi_mac.c @@ -1716,6 +1716,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent) err = -ENODEV; goto out; } + dma_set_mask(>dma_pdev->dev, DMA_BIT_MASK(32)); mac->iob_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa001, NULL); if (!mac->iob_pdev) { Hello Christoph, I patched the source code from the Git 'powerpc-dma.6' with your patch today. Unfortunately the P.A. Semi Ethernet doesn't work with the patched Git kernel. After that I tried it with the patch applied over the working setup again (powerpc/dma: use the dma_direct mapping routines). Unfortunately after compiling and booting, the P.A. Semi Ethernet doesn't work either. Cheers, Christian
Re: use generic DMA mapping code in powerpc V4
On Mon, Feb 04, 2019 at 01:13:54PM +0100, Christian Zigotzky wrote: >>> Results: The X1000 and X5000 boot but unfortunately the P.A. Semi Ethernet >>> doesn't work. >> Are there any interesting messages in the boot log? Can you send me >> the dmesg? >> > Here you are: http://www.xenosoft.de/dmesg_X1000_with_DMA_updates.txt It seems like the pasemi driver fails to set a DMA mask, but seems otherwise 64-bit DMA capable. The old PPC code didn't verify the dma mask during the map operations, but the x86-derived generic code does. This patch just sets the DMA mask. Olof: does this look ok? The DMA device seems to not directly bound by the net driver, but not really used by anything else in tree either.. diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c b/drivers/net/ethernet/pasemi/pasemi_mac.c index d21041554507..d98bd447c536 100644 --- a/drivers/net/ethernet/pasemi/pasemi_mac.c +++ b/drivers/net/ethernet/pasemi/pasemi_mac.c @@ -1716,6 +1716,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent) err = -ENODEV; goto out; } + dma_set_mask(>dma_pdev->dev, DMA_BIT_MASK(32)); mac->iob_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa001, NULL); if (!mac->iob_pdev) {
Re: use generic DMA mapping code in powerpc V4
On 04 February 2019 at 08:56AM, Christoph Hellwig wrote: On Sun, Feb 03, 2019 at 05:49:02PM +0100, Christian Zigotzky wrote: OK, next step: b50f42f0fe12965ead395c76bcb6a14f00cdf65b (powerpc/dma: use the dma_direct mapping routines) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout b50f42f0fe12965ead395c76bcb6a14f00cdf65b Results: The X1000 and X5000 boot but unfortunately the P.A. Semi Ethernet doesn't work. Are there any interesting messages in the boot log? Can you send me the dmesg? Here you are: http://www.xenosoft.de/dmesg_X1000_with_DMA_updates.txt -- Christian
Re: use generic DMA mapping code in powerpc V4
On Sun, Feb 03, 2019 at 05:49:02PM +0100, Christian Zigotzky wrote: > OK, next step: b50f42f0fe12965ead395c76bcb6a14f00cdf65b (powerpc/dma: use > the dma_direct mapping routines) > > git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a > > git checkout b50f42f0fe12965ead395c76bcb6a14f00cdf65b > > Results: The X1000 and X5000 boot but unfortunately the P.A. Semi Ethernet > doesn't work. Are there any interesting messages in the boot log? Can you send me the dmesg?
Re: use generic DMA mapping code in powerpc V4
OK, next step: b50f42f0fe12965ead395c76bcb6a14f00cdf65b (powerpc/dma: use the dma_direct mapping routines) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout b50f42f0fe12965ead395c76bcb6a14f00cdf65b Results: The X1000 and X5000 boot but unfortunately the P.A. Semi Ethernet doesn't work. -- Christian On 01 February 2019 at 5:54PM, Christian Zigotzky wrote: Hi Christoph, I will try it at the weekend. Thanks, Christian Sent from my iPhone On 1. Feb 2019, at 09:04, Christoph Hellwig wrote: On Thu, Jan 31, 2019 at 01:48:26PM +0100, Christian Zigotzky wrote: 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. Oh. Can you try with just the next one and then two patches applied over the working setup? That is first: http://git.infradead.org/users/hch/misc.git/commitdiff/b50f42f0fe12965ead395c76bcb6a14f00cdf65b then also with: http://git.infradead.org/users/hch/misc.git/commitdiff/21fe52470a483afbb1726741118abef8602dde4d
Re: use generic DMA mapping code in powerpc V4
Hi Christoph, I will try it at the weekend. Thanks, Christian Sent from my iPhone > On 1. Feb 2019, at 09:04, Christoph Hellwig wrote: > >> On Thu, Jan 31, 2019 at 01:48:26PM +0100, Christian Zigotzky wrote: >> 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. > > Oh. Can you try with just the next one and then two patches applied > over the working setup? That is first: > > http://git.infradead.org/users/hch/misc.git/commitdiff/b50f42f0fe12965ead395c76bcb6a14f00cdf65b > > then also with: > > http://git.infradead.org/users/hch/misc.git/commitdiff/21fe52470a483afbb1726741118abef8602dde4d
Re: use generic DMA mapping code in powerpc V4
On Thu, Jan 31, 2019 at 01:48:26PM +0100, Christian Zigotzky wrote: > 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. Oh. Can you try with just the next one and then two patches applied over the working setup? That is first: http://git.infradead.org/users/hch/misc.git/commitdiff/b50f42f0fe12965ead395c76bcb6a14f00cdf65b then also with: http://git.infradead.org/users/hch/misc.git/commitdiff/21fe52470a483afbb1726741118abef8602dde4d
Re: use generic DMA mapping code in powerpc V4
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 :00:1a.0: overflow 0x0002691bf802+1646 of DMA mask 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: c010395c LR: c0103a30 CTR: c0726f70 [ 17.371775] REGS: c0026900e9a0 TRAP: 0700 Not tainted (5.0.0-rc4-3_A-EON_AmigaOne_X1000_Nemo-54580-g8d7a724-dirty) [ 17.371777] MSR: 90029032 CR: 2400 XER: 2000 [ 17.371786] IRQMASK: 0 GPR00: c0103a30 c0026900ec30 c1923f00 0052 GPR04: c0026f206778 c0026f20d458 0346 GPR08: 0007 0010 GPR12: 22002444 c1b1 GPR16: 10382410 c0026bd9d820 GPR20: c0026919c000 GPR24: 0800 c0026919 c002692a4180 c0026919 GPR28: c00277ada1c8 066e c0026d3c68b0 0802 [ 17.371823] NIP [c010395c] .dma_direct_map_page+0x11c/0x200 [ 17.371827] LR [c0103a30] .dma_direct_map_page+0x1f0/0x200 [ 17.371829] Call Trace: [ 17.371833] [c0026900ec30] [c0103a30] .dma_direct_map_page+0x1f0/0x200 (unreliable) [ 17.371840] [c0026900ecd0] [c099b7ec] .pasemi_mac_replenish_rx_ring+0x12c/0x2a0 [ 17.371846] [c0026900eda0] [c099dc64] .pasemi_mac_open+0x384/0x7c0 [ 17.371853] [c0026900ee40] [c0c6f484] .__dev_open+0x134/0x1e0 [ 17.371858] [c0026900eee0] [c0c6f9ec] .__dev_change_flags+0x1bc/0x210 [ 17.371863] [c0026900ef90] [c0c6fa88] .dev_change_flags+0x48/0xa0 [ 17.371869] [c0026900f030] [c0c8c88c] .do_setlink+0x3dc/0xf60 [ 17.371875] [c0026900f1b0] [c0c8dd84] .__rtnl_newlink+0x5e4/0x900 [ 17.371880] [c0026900f5f0] [c0c8e10c] .rtnl_newlink+0x6c/0xb0 [ 17.371885] [c0026900f680] [c0c89838] .rtnetlink_rcv_msg+0x2e8/0x3d0 [ 17.371891] [c0026900f760] [c0cc0f90] .netlink_rcv_skb+0x120/0x170 [ 17.371896] [c0026900f820] [c0c87318] .rtnetlink_rcv+0x28/0x40 [ 17.371901] [c0026900f8a0] [c0cc03f8] .netlink_unicast+0x208/0x2f0 [ 17.371906] [c0026900f950] [c0cc09a8] .netlink_sendmsg+0x348/0x460 [ 17.371911] [c0026900fa30] [c0c38774] .sock_sendmsg+0x44/0x70 [ 17.371915] [c0026900fab0] [c0c3a79c] .___sys_sendmsg+0x30c/0x320 [ 17.371920] [c0026900fca0] [c0c3c3b4] .__sys_sendmsg+0x74/0xf0 [ 17.371926] [c0026900fd90] [c0cb4da0] .__se_compat_sys_sendmsg+0x40/0x60 [ 17.371932] [c0026900fe20] [c000a21c] system_call+0x5c/0x70 [ 17.371934] Instruction dump: [ 17.371937] 6000 f8610070 3d20 6129fffe 79290020 e8e7 7fa74840 409d00b8 [ 17.371946] 3d420001 892acb59 2f89 419e00b8 <0fe0> 382100a0 3860 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 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
Re: use generic DMA mapping code in powerpc V4
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 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.
Re: use generic DMA mapping code in powerpc V4
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.
Re: use generic DMA mapping code in powerpc V4
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.
Re: use generic DMA mapping code in powerpc V4
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! Cheers, Christian On 28 January 2019 at 5:52PM, Christian Zigotzky wrote: Thanks a lot! I will test it tomorrow. — Christian Sent from my iPhone On 28. Jan 2019, at 17:22, Christoph Hellwig wrote: On Mon, Jan 28, 2019 at 08:04:22AM +0100, Christoph Hellwig wrote: On Sun, Jan 27, 2019 at 02:13:09PM +0100, Christian Zigotzky wrote: Christoph, What shall I do next? I'll need to figure out what went wrong with the new zone selection on powerpc and give you another branch to test. Can you try the new powerpc-dma.6-debug.2 branch: git://git.infradead.org/users/hch/misc.git powerpc-dma.6-debug.2 Gitweb: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6-debug.2
Re: use generic DMA mapping code in powerpc V4
Thanks a lot! I will test it tomorrow. — Christian Sent from my iPhone > On 28. Jan 2019, at 17:22, Christoph Hellwig wrote: > >> On Mon, Jan 28, 2019 at 08:04:22AM +0100, Christoph Hellwig wrote: >>> On Sun, Jan 27, 2019 at 02:13:09PM +0100, Christian Zigotzky wrote: >>> Christoph, >>> >>> What shall I do next? >> >> I'll need to figure out what went wrong with the new zone selection >> on powerpc and give you another branch to test. > > Can you try the new powerpc-dma.6-debug.2 branch: > >git://git.infradead.org/users/hch/misc.git powerpc-dma.6-debug.2 > > Gitweb: > > > http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6-debug.2
Re: use generic DMA mapping code in powerpc V4
On Mon, Jan 28, 2019 at 08:04:22AM +0100, Christoph Hellwig wrote: > On Sun, Jan 27, 2019 at 02:13:09PM +0100, Christian Zigotzky wrote: > > Christoph, > > > > What shall I do next? > > I'll need to figure out what went wrong with the new zone selection > on powerpc and give you another branch to test. Can you try the new powerpc-dma.6-debug.2 branch: git://git.infradead.org/users/hch/misc.git powerpc-dma.6-debug.2 Gitweb: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6-debug.2
Re: use generic DMA mapping code in powerpc V4
On Sun, Jan 27, 2019 at 02:13:09PM +0100, Christian Zigotzky wrote: > Christoph, > > What shall I do next? I'll need to figure out what went wrong with the new zone selection on powerpc and give you another branch to test.
Re: use generic DMA mapping code in powerpc V4
Christoph, What shall I do next? Cheers, Christian On 25 January 2019 at 2:37PM, Christian Zigotzky wrote: Next step just with the first patch: 5c532d07c2f3c3972104de505d06b8d85f403f06 (use powerpc zone selection) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6-debug a git checkout 5c532d07c2f3c3972104de505d06b8d85f403f06 Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6-debug Results: X5000: The kernel detects the SATA hard disk drive and boots without any problems. X1000: The kernel boots and the P.A. Semi Ethernet works! -- Christian On 23 January 2019 at 3:34PM, Christian Zigotzky wrote: Hi Christoph, I also compiled a kernel (zImage) for the X1000 from your Git 'powerpc-dma.6-debug' (both patches) today. It boots and the P.A. Semi Ethernet works! I will test just the first patch tomorrow. Thanks, Christian On 21 January 2019 at 3:38PM, Christian Zigotzky wrote: Hello Christoph, Thanks for your reply. I successfully compiled a kernel (uImage) for the X5000 from your Git 'powerpc-dma.6-debug' (both patches) today. It detects the SATA hard disk drive and boots without any problems.
Re: use generic DMA mapping code in powerpc V4
Next step just with the first patch: 5c532d07c2f3c3972104de505d06b8d85f403f06 (use powerpc zone selection) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6-debug a git checkout 5c532d07c2f3c3972104de505d06b8d85f403f06 Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6-debug Results: X5000: The kernel detects the SATA hard disk drive and boots without any problems. X1000: The kernel boots and the P.A. Semi Ethernet works! -- Christian On 23 January 2019 at 3:34PM, Christian Zigotzky wrote: Hi Christoph, I also compiled a kernel (zImage) for the X1000 from your Git 'powerpc-dma.6-debug' (both patches) today. It boots and the P.A. Semi Ethernet works! I will test just the first patch tomorrow. Thanks, Christian On 21 January 2019 at 3:38PM, Christian Zigotzky wrote: Hello Christoph, Thanks for your reply. I successfully compiled a kernel (uImage) for the X5000 from your Git 'powerpc-dma.6-debug' (both patches) today. It detects the SATA hard disk drive and boots without any problems.
Re: use generic DMA mapping code in powerpc V4
Hi Christoph, I also compiled a kernel (zImage) for the X1000 from your Git 'powerpc-dma.6-debug' (both patches) today. It boots and the P.A. Semi Ethernet works! I will test just the first patch tomorrow. Thanks, Christian On 21 January 2019 at 3:38PM, Christian Zigotzky wrote: Hello Christoph, Thanks for your reply. I successfully compiled a kernel (uImage) for the X5000 from your Git 'powerpc-dma.6-debug' (both patches) today. It detects the SATA hard disk drive and boots without any problems.
Re: use generic DMA mapping code in powerpc V4
Hello Christoph, Thanks for your reply. I successfully compiled a kernel (uImage) for the X5000 from your Git 'powerpc-dma.6-debug' (both patches) today. It detects the SATA hard disk drive and boots without any problems. I will test the first patch in next days. Thanks for your help, Christian On 19 January 2019 at 3:04PM, Christoph Hellwig wrote: On Sat, Jan 19, 2019 at 02:02:22PM +0100, Christoph Hellwig wrote: Interesting. This suggest it is related to the use of ZONE_DMA by the FSL SOCs that your board uses. Let me investigate this a bit more. As a hack to check that theory I've pushed a new commit to the powerpc-dma.6-debug branch to use old powerpc GFP_DMA selection with the new dma direct code: http://git.infradead.org/users/hch/misc.git/commitdiff/5c532d07c2f3c3972104de505d06b8d85f403f06 And another one that drops the addressability checks that powerpc never had: http://git.infradead.org/users/hch/misc.git/commitdiff/18e7629b38465ca98f8e7eed639123a13ac3b669 Can you first test with both patches, and then just with the first in case that worked?
Re: use generic DMA mapping code in powerpc V4
On Sat, Jan 19, 2019 at 02:02:22PM +0100, Christoph Hellwig wrote: > Interesting. This suggest it is related to the use of ZONE_DMA by > the FSL SOCs that your board uses. Let me investigate this a bit more. As a hack to check that theory I've pushed a new commit to the powerpc-dma.6-debug branch to use old powerpc GFP_DMA selection with the new dma direct code: http://git.infradead.org/users/hch/misc.git/commitdiff/5c532d07c2f3c3972104de505d06b8d85f403f06 And another one that drops the addressability checks that powerpc never had: http://git.infradead.org/users/hch/misc.git/commitdiff/18e7629b38465ca98f8e7eed639123a13ac3b669 Can you first test with both patches, and then just with the first in case that worked?
Re: use generic DMA mapping code in powerpc V4
On Sat, Jan 19, 2019 at 12:52:52PM +0100, Christian Zigotzky wrote: > Hi Christoph, > > I have found a small workaround. If I add 'mem=3500M' to the boot arguments > then it detects the SATA hard disk and boots without any problems. > > X5000> setenv bootargs root=/dev/sda2 console=ttyS0,115200 mem=3500M Interesting. This suggest it is related to the use of ZONE_DMA by the FSL SOCs that your board uses. Let me investigate this a bit more.
Re: use generic DMA mapping code in powerpc V4
Hi Christoph, I have found a small workaround. If I add 'mem=3500M' to the boot arguments then it detects the SATA hard disk and boots without any problems. X5000> setenv bootargs root=/dev/sda2 console=ttyS0,115200 mem=3500M Cheers, Christian On 19 January 2019 at 12:40PM, Christian Zigotzky wrote: Hi Christoph, I bought a USB null modem RS-232 serial cable today so I was able to get some SATA error messages. Error messages: [ 13.468538] fsl-sata ffe22.sata: Sata FSL Platform/CSB Driver init [ 13.475106] fsl-sata ffe22.sata: failed to start port 0 (errno=-12) [ 13.481736] fsl-sata ffe221000.sata: Sata FSL Platform/CSB Driver init [ 13.488267] fsl-sata ffe221000.sata: failed to start port 0 (errno=-12) --- errno=-12 = Out of memory Please find attached the complete serial log. Cheers, Christian On 18 January 2019 at 4:06PM, Christian Zigotzky wrote: Hello Christoph, I was able to compile 257002094bc5935dd63207a380d9698ab81f0775 from your Git powerpc-dma.6-debug today. Unfortunately I don't see any error messages (kernel ring buffer) and I don't have a RS232 serial null modem cable to get them. Cheers, Christian
Re: use generic DMA mapping code in powerpc V4
Hi Christoph, I bought a USB null modem RS-232 serial cable today so I was able to get some SATA error messages. Error messages: [ 13.468538] fsl-sata ffe22.sata: Sata FSL Platform/CSB Driver init [ 13.475106] fsl-sata ffe22.sata: failed to start port 0 (errno=-12) [ 13.481736] fsl-sata ffe221000.sata: Sata FSL Platform/CSB Driver init [ 13.488267] fsl-sata ffe221000.sata: failed to start port 0 (errno=-12) --- errno=-12 = Out of memory Please find attached the complete serial log. Cheers, Christian On 18 January 2019 at 4:06PM, Christian Zigotzky wrote: Hello Christoph, I was able to compile 257002094bc5935dd63207a380d9698ab81f0775 from your Git powerpc-dma.6-debug today. Unfortunately I don't see any error messages (kernel ring buffer) and I don't have a RS232 serial null modem cable to get them. Cheers, Christian =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2019.01.19 12:21:05 =~=~=~=~=~=~=~=~=~=~=~= U-Boot 2014.04 (Oct 17 2016 - 08:22:22) CPU0: P5020, Version: 2.0, (0x82200020) Core: e5500, Version: 1.2, (0x80240012) Clock Configuration: CPU0:1995 MHz, CPU1:1995 MHz, CCB:798 MHz, DDR:665 MHz (1330 MT/s data rate) (Asynchronous), LBC:49.875 MHz FMAN1: 498.750 MHz QMAN: 399 MHz PME: 399 MHz L1:D-cache 32 KiB enabled I-cache 32 KiB enabled Reset Configuration Word (RCW): : 0c54 1e1e 0010: 44808c00 ff002000 6800 4500 0020: 0003000f 0030: a000 Board: CYRUS 36-bit Addressing I2C: ready SPI: ready DRAM: Initializingusing SPD Detected UDIMM KHX1600C10D3/4G Detected UDIMM KHX1600C10D3/4G Not enough bank(chip-select) for CS0+CS1 on controller 0, interleaving disabled! Not enough bank(chip-select) for CS0+CS1 on controller 1, interleaving disabled! 6 GiB left unmapped 8 GiB (DDR3, 64-bit, CL=9, ECC off) DDR Controller Interleaving Mode: cache line Local Bus Controller Registers BR0 0xE0001001 OR0 0xFFF00010 BR1 0xE1001001 OR1 0xFFF00010 BR2 0x OR2 0x BR3 0x OR3 0x BR4 0x OR4 0x BR5 0x OR5 0x BR6 0x OR6 0x BR7 0x OR7 0x LBCR 0x4000 LCRR 0x80010004 L2:512 KiB enabled Corenet Platform Cache: 2 MiB enabled SERDES: bank 2 disabled MMC: FSL_SDHC: 0 EEPROM: NXID v0 PCIe1: Root Complex, x4 gen2, regs @ 0xfe20 01:00.0 - 1002:9440 - Display controller PCIe1: Bus 00 - 01 PCIe2: Root Complex, x4 gen2, regs @ 0xfe201000 03:00.0 - 111d:8092 - Bridge device 04:01.0- 111d:8092 - Bridge device 05:00.0 - 12d8:e111 - Bridge device 06:04.0 - 10ec:8139 - Network controller 06:05.0 - 109e:036e - Multimedia device 06:05.1 - 109e:0878 - Multimedia device 04:02.0- 111d:8092 - Bridge device 04:03.0- 111d:8092 - Bridge device 04:08.0- 111d:8092 - Bridge device 04:10.0- 111d:8092 - Bridge device PCIe2: Bus 02 - 0a PCIe3: disabled PCIe4: disabled Looking for VGA PINS: 0xfc000808 videoboot: Booting PCI video card bus 1, function 0, device 0 Begin BIOS POST End BIOS POST Setting VESA Mode Found required VESA mode About to set mode 279 About to get mode Got mode 49431 (0xc117) OK XSize = 1024 YSize = 768 Base =0xe000 mmio_base = 0x8000 bgx = 0xad55ad55 fgx = 0x0 In:serial Out: serial Err: serial ID: NXID v0 SN: 116330018 UID: 442943100191005198d3a080a080 Errata: ÿ "8 Build date: 2015/09/22 10:38:00 CRC: d4925668 SCSI: scanning bus for devices... Found 0 device(s). Net: Initializing Fman MMC read: dev # 0, block # 1130, count 128 ... Fman1: Uploading microcode version 106.1.0 Tuning PHY @ 3 Tuning PHY @ 7 FM1@DTSEC4 [PRIME], FM1@DTSEC5 MMC read: dev # 0, block # 1280, count 512 ... 512 blocks read: OK MMC read: dev # 0, block # 65536, count 131072 ... 131072 blocks read: OK USB0: USB EHCI 1.00 scanning bus 0 for devices... 5 USB Device(s) found USB1: USB EHCI 1.00 scanning bus 1 for devices... ERROR: Invalid USB EP length (9) ERROR: Invalid USB EP length (9) ERROR: Invalid USB EP length (9) 4 USB Device(s) found Timeout poll on interrupt endpoint Failed to get keyboard state from device 0c45:5303 SATA0 (3 Gbps) SATA1 (No RDY) scanning bus for devices... Found 0 device(s). X5000> setenv bootargs root=/dev/sda2 console=ttyS0,115200 X5000> load sata 0:1 100 uImage-5.0 reading uImage-5.0 10687255 bytes read in 75 ms (135.9 MiB/s) X5000> iminfo ## Checking Image at 0100 ... Legacy image found Image Name: Linux-5.0.0-rc2-2_A-EON_A1-X5000 Created: 2019-01-18 14:47:06 UTC Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size:10687191 Bytes = 10.2 MiB Load Address: Entry Point: Verifying Checksum ... OK X5000> load sata 0:1 200 cyrus.dtb reading cyrus.dtb 29244 bytes read in 27 ms (1 MiB/s) X5000>
Re: use generic DMA mapping code in powerpc V4
Hello Christoph, I was able to compile 257002094bc5935dd63207a380d9698ab81f0775 from your Git powerpc-dma.6-debug today. Unfortunately I don't see any error messages (kernel ring buffer) and I don't have a RS232 serial null modem cable to get them. Cheers, Christian
Re: use generic DMA mapping code in powerpc V4
On Fri, Jan 18, 2019 at 01:46:46PM +0100, Christian Zigotzky wrote: > Sorry, it's not possible to patch > '257002094bc5935dd63207a380d9698ab81f0775' with your patch. I also tried it > manually but without any success. Weird: hch@carbon:~/work/linux$ git checkout 257002094bc5935dd63207a380d9698ab81f0775 HEAD is now at 257002094bc5 powerpc/dma: use the dma-direct allocator for coherent platforms hch@carbon:~/work/linux$ patch -p1 < dbg.diff patching file kernel/dma/direct.c I've pushed the result to git://git.infradead.org/users/hch/misc.git as a new powerpc-dma.6-debug branch 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; }
Re: use generic DMA mapping code in powerpc V4
Sorry, it's not possible to patch '257002094bc5935dd63207a380d9698ab81f0775' with your patch. I also tried it manually but without any success. -- Christian On 18 January 2019 at 1:18PM, Christoph Hellwig wrote: On Fri, Jan 18, 2019 at 01:07:54PM +0100, Christian Zigotzky wrote: git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 257002094bc5935dd63207a380d9698ab81f0775 I get the following error message with your patch: Hmm. Did I attached the wrong patch? Here is the one I want and just applied to that revision: 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; }
Re: use generic DMA mapping code in powerpc V4
On Fri, Jan 18, 2019 at 01:07:54PM +0100, Christian Zigotzky wrote: > git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a > > git checkout 257002094bc5935dd63207a380d9698ab81f0775 > > > I get the following error message with your patch: Hmm. Did I attached the wrong patch? Here is the one I want and just applied to that revision: 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; }
Re: use generic DMA mapping code in powerpc V4
git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 257002094bc5935dd63207a380d9698ab81f0775 I get the following error message with your patch: patching file a/kernel/dma/direct.c Hunk #1 FAILED at 118. Hunk #2 FAILED at 139. 2 out of 2 hunks FAILED -- saving rejects to file a/kernel/dma/direct.c.rej -- Christian On 18 January 2019 at 12:28PM, Christoph Hellwig wrote: On Fri, Jan 18, 2019 at 12:10:26PM +0100, Christian Zigotzky wrote: For which commit? On top of 257002094bc5935dd63207a380d9698ab81f0775, that is the first one you identified as breaking the detection of the SATA disks.
Re: use generic DMA mapping code in powerpc V4
On Fri, Jan 18, 2019 at 12:10:26PM +0100, Christian Zigotzky wrote: > For which commit? On top of 257002094bc5935dd63207a380d9698ab81f0775, that is the first one you identified as breaking the detection of the SATA disks.
Re: use generic DMA mapping code in powerpc V4
For which commit? -- Christian On 18 January 2019 at 09:35AM, Christoph Hellwig wrote: Hi Christian, can you check if the debug printks in this patch trigger? 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; }
Re: use generic DMA mapping code in powerpc V4
Hi Christian, can you check if the debug printks in this patch trigger? 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; }
Re: use generic DMA mapping code in powerpc V4
On Thu, Jan 17, 2019 at 10:21:11AM +0100, Christian Zigotzky wrote: > 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). Thanks for bisecting so far, and lets stop here until I manage to resolve the problem. Can you send me the .config and the dtb file for this board?
Re: use generic DMA mapping code in powerpc V4
Hi All, I compiled the fixed '257002094bc5935dd63207a380d9698ab81f0775' (powerpc/dma: use the dma-direct allocator for coherent platforms) today. git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 257002094bc5935dd63207a380d9698ab81f0775 Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 env LANG=C make CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc zImage env LANG=C make CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc uImage 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). Cheers, Christian On 15 January 2019 at 4:17PM, 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.
Re: use generic DMA mapping code in powerpc V4
On Tue, Jan 15, 2019 at 02:56:34PM +0100, Christian Zigotzky wrote: > On 15 January 2019 at 2:35PM, Christoph Hellwig wrote: >> On Tue, Jan 15, 2019 at 11:55:25AM +0100, Christian Zigotzky wrote: >>> Next step: 21074ef03c0816ae158721a78cabe9035938 (powerpc/dma: use the >>> generic direct mapping bypass) >>> >>> git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a >>> >>> git checkout 21074ef03c0816ae158721a78cabe9035938 >>> >>> 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. >> 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.git/commitdiff/257002094bc5935dd63207a380d9698ab81f0775 >> >> which was that one that your compile failed on first. >> >> Thanks again for all your work! >> > Thank you! I tried the commit 240d7ecd7f6fa62e074e8a835e620047954f0b28 > (powerpc/dma: use the dma-direct allocator for coherent platforms) again. > > git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a > > git checkout 240d7ecd7f6fa62e074e8a835e620047954f0b28 > > I modified the 'dma.c' patch because of the undefined references to > '__dma_nommu_free_coherent' and '__dma_nommu_alloc_coherent': 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.
Re: use generic DMA mapping code in powerpc V4
On 15 January 2019 at 2:35PM, Christoph Hellwig wrote: On Tue, Jan 15, 2019 at 11:55:25AM +0100, Christian Zigotzky wrote: Next step: 21074ef03c0816ae158721a78cabe9035938 (powerpc/dma: use the generic direct mapping bypass) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 21074ef03c0816ae158721a78cabe9035938 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. 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.git/commitdiff/257002094bc5935dd63207a380d9698ab81f0775 which was that one that your compile failed on first. Thanks again for all your work! Thank you! I tried the commit 240d7ecd7f6fa62e074e8a835e620047954f0b28 (powerpc/dma: use the dma-direct allocator for coherent platforms) again. git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 240d7ecd7f6fa62e074e8a835e620047954f0b28 I modified the 'dma.c' patch because of the undefined references to '__dma_nommu_free_coherent' and '__dma_nommu_alloc_coherent': --- @@ -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). -- Christian
Re: use generic DMA mapping code in powerpc V4
On Tue, Jan 15, 2019 at 11:55:25AM +0100, Christian Zigotzky wrote: > Next step: 21074ef03c0816ae158721a78cabe9035938 (powerpc/dma: use the > generic direct mapping bypass) > > git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a > > git checkout 21074ef03c0816ae158721a78cabe9035938 > > 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. 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.git/commitdiff/257002094bc5935dd63207a380d9698ab81f0775 which was that one that your compile failed on first. Thanks again for all your work!
Re: use generic DMA mapping code in powerpc V4
Next step: 21074ef03c0816ae158721a78cabe9035938 (powerpc/dma: use the generic direct mapping bypass) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 21074ef03c0816ae158721a78cabe9035938 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: [ 12.698063] pasemi_mac :00:14.3 enp0s20f3: renamed from eth0 [ 16.516966] IPv6: ADDRCONF(NETDEV_UP): enp0s20f3: link is not ready [ 16.521025] pci :00:1a.0: overflow 0x00026a587802+1646 of DMA mask 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: c010395c LR: c0103a30 CTR: [ 16.521062] REGS: c0026a1a29a0 TRAP: 0700 Not tainted (5.0.0-rc2-2_A-EON_AmigaOne_X1000_Nemo-54576-g21074ef-dirty) [ 16.521064] MSR: 9202b032 CR: 22002442 XER: 2000 [ 16.521074] IRQMASK: 0 GPR00: c0103a30 c0026a1a2c30 c1923f00 0052 GPR04: c0026f206778 c0026f20d458 c1ab1178 7063693a30303030 GPR08: 0007 0010 GPR12: 3a30303a31612e30 c1b1 00a79020 00ace140 GPR16: fffdd958 c0026be92220 GPR20: c0026a47 GPR24: 0800 c0026a1c c0026bc69280 c0026a1c GPR28: c00277b1f588 066e c0026d3c68b0 0802 [ 16.52] NIP [c010395c] .dma_direct_map_page+0x11c/0x200 [ 16.521114] LR [c0103a30] .dma_direct_map_page+0x1f0/0x200 [ 16.521116] Call Trace: [ 16.521120] [c0026a1a2c30] [c0103a30] .dma_direct_map_page+0x1f0/0x200 (unreliable) [ 16.521126] [c0026a1a2cd0] [c099b84c] .pasemi_mac_replenish_rx_ring+0x12c/0x2a0 [ 16.521131] [c0026a1a2da0] [c099dcc4] .pasemi_mac_open+0x384/0x7c0 [ 16.521137] [c0026a1a2e40] [c0c6f4e4] .__dev_open+0x134/0x1e0 [ 16.521142] [c0026a1a2ee0] [c0c6fa4c] .__dev_change_flags+0x1bc/0x210 [ 16.521147] [c0026a1a2f90] [c0c6fae8] .dev_change_flags+0x48/0xa0 [ 16.521153] [c0026a1a3030] [c0c8c8ec] .do_setlink+0x3dc/0xf60 [ 16.521158] [c0026a1a31b0] [c0c8dde4] .__rtnl_newlink+0x5e4/0x900 [ 16.521163] [c0026a1a35f0] [c0c8e16c] .rtnl_newlink+0x6c/0xb0 [ 16.521167] [c0026a1a3680] [c0c89898] .rtnetlink_rcv_msg+0x2e8/0x3d0 [ 16.521172] [c0026a1a3760] [c0cc0ff0] .netlink_rcv_skb+0x120/0x170 [ 16.521177] [c0026a1a3820] [c0c87378] .rtnetlink_rcv+0x28/0x40 [ 16.521181] [c0026a1a38a0] [c0cc0458] .netlink_unicast+0x208/0x2f0 [ 16.521186] [c0026a1a3950] [c0cc0a08] .netlink_sendmsg+0x348/0x460 [ 16.521190] [c0026a1a3a30] [c0c387d4] .sock_sendmsg+0x44/0x70 [ 16.521195] [c0026a1a3ab0] [c0c3a7fc] .___sys_sendmsg+0x30c/0x320 [ 16.521199] [c0026a1a3ca0] [c0c3c414] .__sys_sendmsg+0x74/0xf0 [ 16.521204] [c0026a1a3d90] [c0cb4e00] .__se_compat_sys_sendmsg+0x40/0x60 [ 16.521210] [c0026a1a3e20] [c000a21c] system_call+0x5c/0x70 [ 16.521212] Instruction dump: [ 16.521215] 6000 f8610070 3d20 6129fffe 79290020 e8e7 7fa74840 409d00b8 [ 16.521222] 3d420001 892acb59 2f89 419e00b8 <0fe0> 382100a0 3860 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: 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, _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 -- Christian On 15 January 2019 at 09:49AM, Christian Zigotzky wrote: Next step: 63a6e350e037a21e9a88c8b710129bea7049a80f
Re: use generic DMA mapping code in powerpc V4
Next step: 63a6e350e037a21e9a88c8b710129bea7049a80f (powerpc/dma: use the dma_direct mapping routines) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 63a6e350e037a21e9a88c8b710129bea7049a80f Error message: 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 -- Christian On 15 January 2019 at 09:07AM, Christian Zigotzky wrote: Next step: 240d7ecd7f6fa62e074e8a835e620047954f0b28 (powerpc/dma: use the dma-direct allocator for coherent platforms) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 240d7ecd7f6fa62e074e8a835e620047954f0b28 Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 env LANG=C make CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc zImage Error message: 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 -- Christian On 12 January 2019 at 7:14PM, Christian Zigotzky wrote: Next step: 4558b6e1ddf3dcf5a86d6a5d16c2ac1600c7df39 (swiotlb: remove swiotlb_dma_supported) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 4558b6e1ddf3dcf5a86d6a5d16c2ac1600c7df39 Output: You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b HEAD is now at 4558b6e... swiotlb: remove swiotlb_dma_supported Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Results: PASEMI onboard ethernet (X1000) works and the X5000 (P5020 board) boots. I also successfully tested sound, hardware 3D acceleration, Bluetooth, network, booting with a label etc. The uImages work also in a virtual e5500 quad-core QEMU machine. -- Christian On 11 January 2019 at 03:10AM, Christian Zigotzky wrote: Next step: 891dcc1072f1fa27a83da920d88daff6ca08fc02 (powerpc/dma: remove dma_nommu_dma_supported) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 891dcc1072f1fa27a83da920d88daff6ca08fc02 Output: Note: checking out '891dcc1072f1fa27a83da920d88daff6ca08fc02'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b HEAD is now at 891dcc1... powerpc/dma: remove dma_nommu_dma_supported --- Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Results: PASEMI onboard ethernet works and the X5000 (P5020 board) boots. I also successfully tested sound, hardware 3D acceleration, Bluetooth, network, booting with a label etc. The uImages work also in a virtual e5500 quad-core QEMU machine. -- Christian On 09 January 2019 at 10:31AM, Christian Zigotzky wrote: Next step: a64e18ba191ba9102fb174f27d707485ffd9389c (powerpc/dma: remove dma_nommu_get_required_mask) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout a64e18ba191ba9102fb174f27d707485ffd9389c Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Results: PASEMI onboard ethernet works and the X5000 (P5020 board) boots. I also successfully tested sound, hardware 3D acceleration, Bluetooth, network, booting with a label etc. The uImages work also in a virtual e5500 quad-core QEMU machine. -- Christian On 05 January 2019 at 5:03PM, Christian Zigotzky wrote: Next step: c446404b041130fbd9d1772d184f24715cf2362f (powerpc/dma: remove dma_nommu_mmap_coherent) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout c446404b041130fbd9d1772d184f24715cf2362f Output: Note: checking out 'c446404b041130fbd9d1772d184f24715cf2362f'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout
Re: use generic DMA mapping code in powerpc V4
Next step: 240d7ecd7f6fa62e074e8a835e620047954f0b28 (powerpc/dma: use the dma-direct allocator for coherent platforms) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 240d7ecd7f6fa62e074e8a835e620047954f0b28 Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 env LANG=C make CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc zImage Error message: 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 -- Christian On 12 January 2019 at 7:14PM, Christian Zigotzky wrote: Next step: 4558b6e1ddf3dcf5a86d6a5d16c2ac1600c7df39 (swiotlb: remove swiotlb_dma_supported) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 4558b6e1ddf3dcf5a86d6a5d16c2ac1600c7df39 Output: You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b HEAD is now at 4558b6e... swiotlb: remove swiotlb_dma_supported Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Results: PASEMI onboard ethernet (X1000) works and the X5000 (P5020 board) boots. I also successfully tested sound, hardware 3D acceleration, Bluetooth, network, booting with a label etc. The uImages work also in a virtual e5500 quad-core QEMU machine. -- Christian On 11 January 2019 at 03:10AM, Christian Zigotzky wrote: Next step: 891dcc1072f1fa27a83da920d88daff6ca08fc02 (powerpc/dma: remove dma_nommu_dma_supported) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 891dcc1072f1fa27a83da920d88daff6ca08fc02 Output: Note: checking out '891dcc1072f1fa27a83da920d88daff6ca08fc02'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b HEAD is now at 891dcc1... powerpc/dma: remove dma_nommu_dma_supported --- Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Results: PASEMI onboard ethernet works and the X5000 (P5020 board) boots. I also successfully tested sound, hardware 3D acceleration, Bluetooth, network, booting with a label etc. The uImages work also in a virtual e5500 quad-core QEMU machine. -- Christian On 09 January 2019 at 10:31AM, Christian Zigotzky wrote: Next step: a64e18ba191ba9102fb174f27d707485ffd9389c (powerpc/dma: remove dma_nommu_get_required_mask) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout a64e18ba191ba9102fb174f27d707485ffd9389c Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Results: PASEMI onboard ethernet works and the X5000 (P5020 board) boots. I also successfully tested sound, hardware 3D acceleration, Bluetooth, network, booting with a label etc. The uImages work also in a virtual e5500 quad-core QEMU machine. -- Christian On 05 January 2019 at 5:03PM, Christian Zigotzky wrote: Next step: c446404b041130fbd9d1772d184f24715cf2362f (powerpc/dma: remove dma_nommu_mmap_coherent) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout c446404b041130fbd9d1772d184f24715cf2362f Output: Note: checking out 'c446404b041130fbd9d1772d184f24715cf2362f'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b HEAD is now at c446404... powerpc/dma: remove dma_nommu_mmap_coherent - Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Result: PASEMI onboard ethernet works and the X5000 (P5020 board) boots. -- Christian
Re: use generic DMA mapping code in powerpc V4
Next step: 4558b6e1ddf3dcf5a86d6a5d16c2ac1600c7df39 (swiotlb: remove swiotlb_dma_supported) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 4558b6e1ddf3dcf5a86d6a5d16c2ac1600c7df39 Output: You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b HEAD is now at 4558b6e... swiotlb: remove swiotlb_dma_supported Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Results: PASEMI onboard ethernet (X1000) works and the X5000 (P5020 board) boots. I also successfully tested sound, hardware 3D acceleration, Bluetooth, network, booting with a label etc. The uImages work also in a virtual e5500 quad-core QEMU machine. -- Christian On 11 January 2019 at 03:10AM, Christian Zigotzky wrote: Next step: 891dcc1072f1fa27a83da920d88daff6ca08fc02 (powerpc/dma: remove dma_nommu_dma_supported) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 891dcc1072f1fa27a83da920d88daff6ca08fc02 Output: Note: checking out '891dcc1072f1fa27a83da920d88daff6ca08fc02'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b HEAD is now at 891dcc1... powerpc/dma: remove dma_nommu_dma_supported --- Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Results: PASEMI onboard ethernet works and the X5000 (P5020 board) boots. I also successfully tested sound, hardware 3D acceleration, Bluetooth, network, booting with a label etc. The uImages work also in a virtual e5500 quad-core QEMU machine. -- Christian On 09 January 2019 at 10:31AM, Christian Zigotzky wrote: Next step: a64e18ba191ba9102fb174f27d707485ffd9389c (powerpc/dma: remove dma_nommu_get_required_mask) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout a64e18ba191ba9102fb174f27d707485ffd9389c Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Results: PASEMI onboard ethernet works and the X5000 (P5020 board) boots. I also successfully tested sound, hardware 3D acceleration, Bluetooth, network, booting with a label etc. The uImages work also in a virtual e5500 quad-core QEMU machine. -- Christian On 05 January 2019 at 5:03PM, Christian Zigotzky wrote: Next step: c446404b041130fbd9d1772d184f24715cf2362f (powerpc/dma: remove dma_nommu_mmap_coherent) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout c446404b041130fbd9d1772d184f24715cf2362f Output: Note: checking out 'c446404b041130fbd9d1772d184f24715cf2362f'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b HEAD is now at c446404... powerpc/dma: remove dma_nommu_mmap_coherent - Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Result: PASEMI onboard ethernet works and the X5000 (P5020 board) boots. -- Christian
Re: use generic DMA mapping code in powerpc V4
Next step: 891dcc1072f1fa27a83da920d88daff6ca08fc02 (powerpc/dma: remove dma_nommu_dma_supported) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout 891dcc1072f1fa27a83da920d88daff6ca08fc02 Output: Note: checking out '891dcc1072f1fa27a83da920d88daff6ca08fc02'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b HEAD is now at 891dcc1... powerpc/dma: remove dma_nommu_dma_supported --- Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Results: PASEMI onboard ethernet works and the X5000 (P5020 board) boots. I also successfully tested sound, hardware 3D acceleration, Bluetooth, network, booting with a label etc. The uImages work also in a virtual e5500 quad-core QEMU machine. -- Christian On 09 January 2019 at 10:31AM, Christian Zigotzky wrote: Next step: a64e18ba191ba9102fb174f27d707485ffd9389c (powerpc/dma: remove dma_nommu_get_required_mask) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout a64e18ba191ba9102fb174f27d707485ffd9389c Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Results: PASEMI onboard ethernet works and the X5000 (P5020 board) boots. I also successfully tested sound, hardware 3D acceleration, Bluetooth, network, booting with a label etc. The uImages work also in a virtual e5500 quad-core QEMU machine. -- Christian On 05 January 2019 at 5:03PM, Christian Zigotzky wrote: Next step: c446404b041130fbd9d1772d184f24715cf2362f (powerpc/dma: remove dma_nommu_mmap_coherent) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout c446404b041130fbd9d1772d184f24715cf2362f Output: Note: checking out 'c446404b041130fbd9d1772d184f24715cf2362f'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b HEAD is now at c446404... powerpc/dma: remove dma_nommu_mmap_coherent - Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Result: PASEMI onboard ethernet works and the X5000 (P5020 board) boots. -- Christian
Re: use generic DMA mapping code in powerpc V4
Next step: a64e18ba191ba9102fb174f27d707485ffd9389c (powerpc/dma: remove dma_nommu_get_required_mask) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout a64e18ba191ba9102fb174f27d707485ffd9389c Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Results: PASEMI onboard ethernet works and the X5000 (P5020 board) boots. I also successfully tested sound, hardware 3D acceleration, Bluetooth, network, booting with a label etc. The uImages work also in a virtual e5500 quad-core QEMU machine. -- Christian On 05 January 2019 at 5:03PM, Christian Zigotzky wrote: Next step: c446404b041130fbd9d1772d184f24715cf2362f (powerpc/dma: remove dma_nommu_mmap_coherent) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout c446404b041130fbd9d1772d184f24715cf2362f Output: Note: checking out 'c446404b041130fbd9d1772d184f24715cf2362f'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b HEAD is now at c446404... powerpc/dma: remove dma_nommu_mmap_coherent - Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Result: PASEMI onboard ethernet works and the X5000 (P5020 board) boots. -- Christian
Re: use generic DMA mapping code in powerpc V4
Next step: c446404b041130fbd9d1772d184f24715cf2362f (powerpc/dma: remove dma_nommu_mmap_coherent) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout c446404b041130fbd9d1772d184f24715cf2362f Output: Note: checking out 'c446404b041130fbd9d1772d184f24715cf2362f'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b HEAD is now at c446404... powerpc/dma: remove dma_nommu_mmap_coherent - Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Result: PASEMI onboard ethernet works and the X5000 (P5020 board) boots. -- Christian
Re: use generic DMA mapping code in powerpc V4
Hi Christoph, Happy new year for you too. Unfortunately we have some problems with the latest DRM patches. They modified a lot and some graphics cards don’t work anymore. During the holidays we tried to figure out where the problems are but without any success. I will try to test your patches next week. Cheers, Christian Sent from my iPhone > On 3. Jan 2019, at 08:36, Christoph Hellwig wrote: > > Hi Christian, > > happy new year and I hope you had a few restful deays off. > > I've pushed a new tree to: > > 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 > > Which has been rebased to the latests Linus tree, which has a lot of > changes, and has also changed the patch split a bit to aid bisection. > > I think > > > http://git.infradead.org/users/hch/misc.git/commitdiff/c446404b041130fbd9d1772d184f24715cf2362f > > might be a good commit to re-start testing, then bisecting up to the > last commit using git bisect.
Re: use generic DMA mapping code in powerpc V4
Hi Christian, happy new year and I hope you had a few restful deays off. I've pushed a new tree to: 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 Which has been rebased to the latests Linus tree, which has a lot of changes, and has also changed the patch split a bit to aid bisection. I think http://git.infradead.org/users/hch/misc.git/commitdiff/c446404b041130fbd9d1772d184f24715cf2362f might be a good commit to re-start testing, then bisecting up to the last commit using git bisect.
Re: use generic DMA mapping code in powerpc V4
Christoph Hellwig writes: > 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. OK, sorry I couldn't help. I tried powering up my pasemi board last week but it just gives me a couple of status leds and nothing else, the fan never spins up. > I'd still like to get a few bits in earlier, which I will send out > separately now. OK. cheers
Re: use generic DMA mapping code in powerpc V4
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: use generic DMA mapping code in powerpc V4
On Fri, Dec 14, 2018 at 01:00:26PM +0100, Christian Zigotzky wrote: > On 12 December 2018 at 3:15PM, Christoph Hellwig wrote: > > Thanks for bisecting. I've spent some time going over the conversion > > but can't really pinpoint it. I have three little patches that switch > > parts of the code to the generic version. This is on top of the > > last good commmit (977706f9755d2d697aa6f45b4f9f0e07516efeda). > > > > Can you check with whіch one things stop working? > > Hello Christoph, > > Great news! All your patches work! No so great because that means I still have no idea what broke.. > I tested all your patches (including the patch '0004-alloc-free.patch' > today) and the PASEMI onboard ethernet works and the P5020 board boots > without any problems. Thank you for your work! > I have a few days off. That means, I will work less and only for the A-EON > first level Linux support. I can test again on Thursday next week. Enjoy your days off! I think I'll need to prepare something new that is better bisectable, and use that opportunity to reason about the changes a little more.
Re: use generic DMA mapping code in powerpc V4
On 12 December 2018 at 3:15PM, Christoph Hellwig wrote: > Thanks for bisecting. I've spent some time going over the conversion > but can't really pinpoint it. I have three little patches that switch > parts of the code to the generic version. This is on top of the > last good commmit (977706f9755d2d697aa6f45b4f9f0e07516efeda). > > Can you check with whіch one things stop working? Hello Christoph, Great news! All your patches work! I tested all your patches (including the patch '0004-alloc-free.patch' today) and the PASEMI onboard ethernet works and the P5020 board boots without any problems. Thank you for your work! I have a few days off. That means, I will work less and only for the A-EON first level Linux support. I can test again on Thursday next week. Have a nice weekend! Cheers, Christian
Re: use generic DMA mapping code in powerpc V4
On 13 December 2018 at 6:48PM, Christian Zigotzky wrote: On 13 December 2018 at 2:34PM, Christian Zigotzky wrote: On 13 December 2018 at 12:25PM, Christoph Hellwig wrote: On Thu, Dec 13, 2018 at 12:19:26PM +0100, Christian Zigotzky wrote: I tried it again but I get the following error message: 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 Sorry, you need this one liner before all the patches posted last time: 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 Thanks. Result: PASEMI onboard ethernet works and the X5000 (P5020 board) boots with the patch '0001-get_required_mask.patch'. -- Christian Next patch: '0002-swiotlb-dma_supported.patch' for the last good commit (977706f9755d2d697aa6f45b4f9f0e07516efeda). The PASEMI onboard ethernet works and the X5000 (P5020 board) boots. -- Christian Next patch: '0003-nommu-dma_supported.patch' No problems with the PASEMI onboard ethernet and the P5020 board boots. -- Christian
Re: use generic DMA mapping code in powerpc V4
On 13 December 2018 at 2:34PM, Christian Zigotzky wrote: On 13 December 2018 at 12:25PM, Christoph Hellwig wrote: On Thu, Dec 13, 2018 at 12:19:26PM +0100, Christian Zigotzky wrote: I tried it again but I get the following error message: 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 Sorry, you need this one liner before all the patches posted last time: 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 Thanks. Result: PASEMI onboard ethernet works and the X5000 (P5020 board) boots with the patch '0001-get_required_mask.patch'. -- Christian Next patch: '0002-swiotlb-dma_supported.patch' for the last good commit (977706f9755d2d697aa6f45b4f9f0e07516efeda). The PASEMI onboard ethernet works and the X5000 (P5020 board) boots. -- Christian
Re: use generic DMA mapping code in powerpc V4
On 13 December 2018 at 12:25PM, Christoph Hellwig wrote: On Thu, Dec 13, 2018 at 12:19:26PM +0100, Christian Zigotzky wrote: I tried it again but I get the following error message: 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 Sorry, you need this one liner before all the patches posted last time: 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 Thanks. Result: PASEMI onboard ethernet works and the X5000 (P5020 board) boots with the patch '0001-get_required_mask.patch'. -- Christian
Re: use generic DMA mapping code in powerpc V4
On Thu, Dec 13, 2018 at 12:19:26PM +0100, Christian Zigotzky wrote: > I tried it again but I get the following error message: > > 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 Sorry, you need this one liner before all the patches posted last time: 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: use generic DMA mapping code in powerpc V4
On 13 December 2018 at 10:47AM, Christian Zigotzky wrote: On 13 December 2018 at 10:10AM, Christoph Hellwig wrote: On Thu, Dec 13, 2018 at 09:41:50AM +0100, Christian Zigotzky wrote: Today I tried the first patch (0001-get_required_mask.patch) with the last good commit (977706f9755d2d697aa6f45b4f9f0e07516efeda). Unfortunately this patch is already included in the last good commit (977706f9755d2d697aa6f45b4f9f0e07516efeda). I will try the next patch. Hmm, I don't think this is the case. This is my local git log output: commit 83a4b87de6bc6a75b500c9959de88e2157fbcd7c Author: Christoph Hellwig Date: Wed Dec 12 15:07:49 2018 +0100 get_required_mask commit 977706f9755d2d697aa6f45b4f9f0e07516efeda Author: Christoph Hellwig Date: Sat Nov 10 22:34:27 2018 +0100 powerpc/dma: remove dma_nommu_mmap_coherent I've also pushed a git branch with these out to: git://git.infradead.org/users/hch/misc.git powerpc-dma.5-debug Sorry Christioph. I was wrong. The first patch isn't included in the last good commit. I will try it again. I can only test beside my main work. That means it takes longer. -- Christian I tried it again but I get the following error message: 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: use generic DMA mapping code in powerpc V4
On 13 December 2018 at 10:10AM, Christoph Hellwig wrote: On Thu, Dec 13, 2018 at 09:41:50AM +0100, Christian Zigotzky wrote: Today I tried the first patch (0001-get_required_mask.patch) with the last good commit (977706f9755d2d697aa6f45b4f9f0e07516efeda). Unfortunately this patch is already included in the last good commit (977706f9755d2d697aa6f45b4f9f0e07516efeda). I will try the next patch. Hmm, I don't think this is the case. This is my local git log output: commit 83a4b87de6bc6a75b500c9959de88e2157fbcd7c Author: Christoph Hellwig Date: Wed Dec 12 15:07:49 2018 +0100 get_required_mask commit 977706f9755d2d697aa6f45b4f9f0e07516efeda Author: Christoph Hellwig Date: Sat Nov 10 22:34:27 2018 +0100 powerpc/dma: remove dma_nommu_mmap_coherent I've also pushed a git branch with these out to: git://git.infradead.org/users/hch/misc.git powerpc-dma.5-debug Sorry Christioph. I was wrong. The first patch isn't included in the last good commit. I will try it again. I can only test beside my main work. That means it takes longer. -- Christian
Re: use generic DMA mapping code in powerpc V4
On Thu, Dec 13, 2018 at 09:41:50AM +0100, Christian Zigotzky wrote: > Today I tried the first patch (0001-get_required_mask.patch) with the last > good commit (977706f9755d2d697aa6f45b4f9f0e07516efeda). Unfortunately this > patch is already included in the last good commit > (977706f9755d2d697aa6f45b4f9f0e07516efeda). I will try the next patch. Hmm, I don't think this is the case. This is my local git log output: commit 83a4b87de6bc6a75b500c9959de88e2157fbcd7c Author: Christoph Hellwig Date: Wed Dec 12 15:07:49 2018 +0100 get_required_mask commit 977706f9755d2d697aa6f45b4f9f0e07516efeda Author: Christoph Hellwig Date: Sat Nov 10 22:34:27 2018 +0100 powerpc/dma: remove dma_nommu_mmap_coherent I've also pushed a git branch with these out to: git://git.infradead.org/users/hch/misc.git powerpc-dma.5-debug
Re: use generic DMA mapping code in powerpc V4
On 12 December 2018 at 3:39PM, Christian Zigotzky wrote: Hi Christoph, Thanks a lot for your reply. I will test your patches tomorrow. Cheers, Christian Sent from my iPhone On 12. Dec 2018, at 15:15, Christoph Hellwig wrote: Thanks for bisecting. I've spent some time going over the conversion but can't really pinpoint it. I have three little patches that switch parts of the code to the generic version. This is on top of the last good commmit (977706f9755d2d697aa6f45b4f9f0e07516efeda). Can you check with whіch one things stop working? <0001-get_required_mask.patch> <0002-swiotlb-dma_supported.patch> <0003-nommu-dma_supported.patch> <0004-alloc-free.patch> Today I tried the first patch (0001-get_required_mask.patch) with the last good commit (977706f9755d2d697aa6f45b4f9f0e07516efeda). Unfortunately this patch is already included in the last good commit (977706f9755d2d697aa6f45b4f9f0e07516efeda). I will try the next patch. -- Christian
Re: use generic DMA mapping code in powerpc V4
Hi Christoph, Thanks a lot for your reply. I will test your patches tomorrow. Cheers, Christian Sent from my iPhone > On 12. Dec 2018, at 15:15, Christoph Hellwig wrote: > > Thanks for bisecting. I've spent some time going over the conversion > but can't really pinpoint it. I have three little patches that switch > parts of the code to the generic version. This is on top of the > last good commmit (977706f9755d2d697aa6f45b4f9f0e07516efeda). > > Can you check with whіch one things stop working? > > > <0001-get_required_mask.patch> > <0002-swiotlb-dma_supported.patch> > <0003-nommu-dma_supported.patch> > <0004-alloc-free.patch>
Re: use generic DMA mapping code in powerpc V4
Thanks for bisecting. I've spent some time going over the conversion but can't really pinpoint it. I have three little patches that switch parts of the code to the generic version. This is on top of the last good commmit (977706f9755d2d697aa6f45b4f9f0e07516efeda). Can you check with whіch one things stop working? >From 83a4b87de6bc6a75b500c9959de88e2157fbcd7c Mon Sep 17 00:00:00 2001 From: Christoph Hellwig 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 >From c2579a3619575397929781a14895966cbc1d217b Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 12 Dec 2018 15:08:52 +0100 Subject: swiotlb dma_supported --- 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, -- 2.19.2 >From 0105db9e6d8d031b4295116630fd0318fd146737 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 12 Dec 2018 15:10:36 +0100 Subject: nommu dma_supported --- 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, -- 2.19.2 >From 4c5dd4d4a4b4e63be722fd29ada896c5962072b8 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 12 Dec 2018 15:11:38 +0100 Subject: alloc/free --- 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, -- 2.19.2
Re: use generic DMA mapping code in powerpc V4
> On 12. Dec 2018, at 01:47, Benjamin Herrenschmidt > wrote: > >> On Tue, 2018-12-11 at 19:17 +0100, Christian Zigotzky wrote: >> 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). That >> means this is also the bad commit for the P5020 board. > > What are the disks hanging off ? A PCIe device of some sort ? > > Can you send good & bad dmesg logs ? > > Ben. > > Unfortunately not. It doesn’t detect any hard disk. That means the kernel ring buffer won’t save to log files. I don’t have a serial null modem cable for seeing all output. We use SATA disks. I will investigate more in this problem with rollback the files in the bad commit. — Christian
Re: use generic DMA mapping code in powerpc V4
On Tue, 2018-12-11 at 19:17 +0100, Christian Zigotzky wrote: > 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). That > means this is also the bad commit for the P5020 board. What are the disks hanging off ? A PCIe device of some sort ? Can you send good & bad dmesg logs ? Ben.
Re: use generic DMA mapping code in powerpc V4
Next step: 7decbcfc656805603ab97206b3f816f26cd2cf7d (powerpc/dma: use generic direct and swiotlb ops) git checkout 7decbcfc656805603ab97206b3f816f26cd2cf7d We have the bad commit! :-) The PASEMI onboard ethernet doesn't work with this commit anymore. Error messages: [ 367.627623] pci :00:1a.0: dma_direct_map_page: overflow 0x00026bcb5002+110 of device mask bus mask 0 [ 367.627631] pci :00:1a.0: dma_direct_map_page: overflow 0x00026bcb5002+110 of device mask bus mask 0 [ 367.627639] pci :00:1a.0: dma_direct_map_page: overflow 0x00026bcb5002+110 of device mask bus mask 0 [ 367.627647] pci :00:1a.0: dma_direct_map_page: overflow 0x00026bcb5002+110 of device mask bus mask 0 pci :00:1a.0 = 00:1a.0 DMA controller: PA Semi, Inc PWRficient DMA Controller (rev 12) 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). That means this is also the bad commit for the P5020 board. Link to the bad commit: http://git.infradead.org/users/hch/misc.git/commit/7decbcfc656805603ab97206b3f816f26cd2cf7d Link to the Git: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.5 The commit before (977706f9755d2d697aa6f45b4f9f0e07516efeda - powerpc/dma: remove dma_nommu_mmap_coherent) works without any problems. -- Christian
Re: use generic DMA mapping code in powerpc V4
Next step: 977706f9755d2d697aa6f45b4f9f0e07516efeda (powerpc/dma: remove dma_nommu_mmap_coherent) Result: The P5020 board boots and the PASEMI onboard ethernet works. -- Christian On 10 December 2018 at 4:54PM, Christian Zigotzky wrote: Next step: 64ecd2c160bbef31465c4d34efc0f076a2aad4df (powerpc/dma: use phys_to_dma instead of get_dma_offset) The P5020 board boots and the PASEMI onboard ethernet works. -- Christian On 09 December 2018 at 7:26PM, Christian Zigotzky wrote: Next step: c1bfcad4b0cf38ce5b00f7ad880d3a13484c123a (dma-mapping, powerpc: simplify the arch dma_set_mask override) Result: No problems with the PASEMI onboard ethernet and with booting the X5000 (P5020 board). -- Christian On 09 December 2018 at 3:20PM, Christian Zigotzky wrote: Next step: 602307b034734ce77a05da4b99333a2eaf6b6482 (powerpc/fsl_pci: simplify fsl_pci_dma_set_mask) git checkout 602307b034734ce77a05da4b99333a2eaf6b6482 The PASEMI onboard ethernet works and the X5000 boots. -- Christian On 08 December 2018 at 2:47PM, Christian Zigotzky wrote: Next step: e15cd8173ef85e9cc3e2a9c7cc2982f5c1355615 (powerpc/dma: fix an off-by-one in dma_capable) git checkout e15cd8173ef85e9cc3e2a9c7cc2982f5c1355615 The PASEMI onboard ethernet also works with this commit and the X5000 boots without any problems. -- Christian On 08 December 2018 at 11:29AM, Christian Zigotzky wrote: Next step: 7ebc44c535f6bd726d553756d38b137acc718443 (powerpc/dma: remove max_direct_dma_addr) git checkout 7ebc44c535f6bd726d553756d38b137acc718443 OK, the PASEMI onboard ethernet works and the P5020 board boots. -- Christian On 07 December 2018 at 7:33PM, Christian Zigotzky wrote: Next step: 13c1fdec5682b6e13257277fa16aa31f342d167d (powerpc/dma: move pci_dma_dev_setup_swiotlb to fsl_pci.c) git checkout 13c1fdec5682b6e13257277fa16aa31f342d167d Result: The PASEMI onboard ethernet works and the P5020 board boots. — Christian
Re: use generic DMA mapping code in powerpc V4
On Mon, 10 Dec 2018 at 20:49, Benjamin Herrenschmidt wrote: > [snip] > > AGP is a gigantic nightmare :-) It's not just cache coherency issues > (some implementations are coherent, some aren't, Apple's is ... weird). > > Apple has all sort of bugs, and Darwin source code only sheds light on > some of them. Some implementation can only read, not write I think, for > example. There are issues with transfers crossing some boundaries I > beleive, but it's all unclear. > > Apple makes this work with a combination of hacks in the AGP "driver" > and the closed source GPU driver, which we don't see. > > I have given up trying to make that stuff work reliably a decade ago :) > > Cheers, > Ben. That's what I was afraid of… what a mess. At least now I have a definitive answer from one of the original authors of the code, thanks a lot, Ben. :) I have an unresearched belief that AGP support was hacked in the Mac series as an afterthought (weren't they supposed to be PCI/PCI-X only?), and your explanation surely seems to corroborate. :/
Re: use generic DMA mapping code in powerpc V4
On Mon, 2018-12-10 at 20:33 +0100, Christoph Hellwig wrote: > On Mon, Dec 10, 2018 at 05:04:46PM +, Rui Salvaterra wrote: > > Hi, Christoph and Ben, > > > > It just came to my mind (and this is most likely a stupid question, > > but still)… Is there any possibility of these changes having an > > (positive) effect on the long-standing problem of Power Mac machines > > with AGP graphics cards (which have to be limited to PCI transfers, > > otherwise they'll hang, due to coherence issues)? If so, I have a G4 > > machine where I'd gladly test them. > > These patches themselves are not going to affect that directly. > But IFF the problem really is that the AGP needs to be treated as not > cache coherent (I have no idea if that is true) the generic direct > mapping code has full support for a per-device coherent flag, so > support for a non-coherent AGP slot could be implemented relatively > simply. AGP is a gigantic nightmare :-) It's not just cache coherency issues (some implementations are coherent, some aren't, Apple's is ... weird). Apple has all sort of bugs, and Darwin source code only sheds light on some of them. Some implementation can only read, not write I think, for example. There are issues with transfers crossing some boundaries I beleive, but it's all unclear. Apple makes this work with a combination of hacks in the AGP "driver" and the closed source GPU driver, which we don't see. I have given up trying to make that stuff work reliably a decade ago :) Cheers, Ben.
Re: use generic DMA mapping code in powerpc V4
On Mon, 10 Dec 2018 at 19:33, Christoph Hellwig wrote: > > On Mon, Dec 10, 2018 at 05:04:46PM +, Rui Salvaterra wrote: > > Hi, Christoph and Ben, > > > > It just came to my mind (and this is most likely a stupid question, > > but still)… Is there any possibility of these changes having an > > (positive) effect on the long-standing problem of Power Mac machines > > with AGP graphics cards (which have to be limited to PCI transfers, > > otherwise they'll hang, due to coherence issues)? If so, I have a G4 > > machine where I'd gladly test them. > > These patches themselves are not going to affect that directly. > But IFF the problem really is that the AGP needs to be treated as not > cache coherent (I have no idea if that is true) the generic direct > mapping code has full support for a per-device coherent flag, so > support for a non-coherent AGP slot could be implemented relatively > simply. Thanks for the insight, Christoph. Well, the problem[1] is real, and it's been known for a long time, though I can't be sure if it's *only* a coherence issue. If someone who knows the hardware manages to cook up a patch (as hacky is it may be), I'll definitely fire up old my G4 laptop to test it! :) [1] https://bugs.freedesktop.org/show_bug.cgi?id=95017
Re: use generic DMA mapping code in powerpc V4
On Mon, Dec 10, 2018 at 05:04:46PM +, Rui Salvaterra wrote: > Hi, Christoph and Ben, > > It just came to my mind (and this is most likely a stupid question, > but still)… Is there any possibility of these changes having an > (positive) effect on the long-standing problem of Power Mac machines > with AGP graphics cards (which have to be limited to PCI transfers, > otherwise they'll hang, due to coherence issues)? If so, I have a G4 > machine where I'd gladly test them. These patches themselves are not going to affect that directly. But IFF the problem really is that the AGP needs to be treated as not cache coherent (I have no idea if that is true) the generic direct mapping code has full support for a per-device coherent flag, so support for a non-coherent AGP slot could be implemented relatively simply.
Re: use generic DMA mapping code in powerpc V4
On Sat, 8 Dec 2018 at 17:17, Christoph Hellwig wrote: > > On Sun, Dec 02, 2018 at 05:11:02PM +1100, Benjamin Herrenschmidt wrote: > > Talking of which ... Christoph, not sure if we can do something about > > this at the DMA API level or keep hacks but some adapters such as the > > nVidia GPUs have a HW hack we can use to work around their limitations > > in that case. > > > > They have a register that can program a fixed value for the top bits > > that they don't support. > > > > This works fine for any linear mapping with an offset, provided they > > can program the offset in that register and they have enough DMA range > > to cover all memory from that offset. > > > > I can probably get the info about this from them so we can exploit it > > in nouveau. > > I think we can expose the direct mapping offset if people care enough, > we just have to be very careful designing the API. I'll happily leave > that to those that actually want to use it, but I'll gladly help > reviewing it. Hi, Christoph and Ben, It just came to my mind (and this is most likely a stupid question, but still)… Is there any possibility of these changes having an (positive) effect on the long-standing problem of Power Mac machines with AGP graphics cards (which have to be limited to PCI transfers, otherwise they'll hang, due to coherence issues)? If so, I have a G4 machine where I'd gladly test them. Thanks, Rui
Re: use generic DMA mapping code in powerpc V4
Next step: 64ecd2c160bbef31465c4d34efc0f076a2aad4df (powerpc/dma: use phys_to_dma instead of get_dma_offset) The P5020 board boots and the PASEMI onboard ethernet works. -- Christian On 09 December 2018 at 7:26PM, Christian Zigotzky wrote: Next step: c1bfcad4b0cf38ce5b00f7ad880d3a13484c123a (dma-mapping, powerpc: simplify the arch dma_set_mask override) Result: No problems with the PASEMI onboard ethernet and with booting the X5000 (P5020 board). -- Christian On 09 December 2018 at 3:20PM, Christian Zigotzky wrote: Next step: 602307b034734ce77a05da4b99333a2eaf6b6482 (powerpc/fsl_pci: simplify fsl_pci_dma_set_mask) git checkout 602307b034734ce77a05da4b99333a2eaf6b6482 The PASEMI onboard ethernet works and the X5000 boots. -- Christian On 08 December 2018 at 2:47PM, Christian Zigotzky wrote: Next step: e15cd8173ef85e9cc3e2a9c7cc2982f5c1355615 (powerpc/dma: fix an off-by-one in dma_capable) git checkout e15cd8173ef85e9cc3e2a9c7cc2982f5c1355615 The PASEMI onboard ethernet also works with this commit and the X5000 boots without any problems. -- Christian On 08 December 2018 at 11:29AM, Christian Zigotzky wrote: Next step: 7ebc44c535f6bd726d553756d38b137acc718443 (powerpc/dma: remove max_direct_dma_addr) git checkout 7ebc44c535f6bd726d553756d38b137acc718443 OK, the PASEMI onboard ethernet works and the P5020 board boots. -- Christian On 07 December 2018 at 7:33PM, Christian Zigotzky wrote: Next step: 13c1fdec5682b6e13257277fa16aa31f342d167d (powerpc/dma: move pci_dma_dev_setup_swiotlb to fsl_pci.c) git checkout 13c1fdec5682b6e13257277fa16aa31f342d167d Result: The PASEMI onboard ethernet works and the P5020 board boots. — Christian
Re: use generic DMA mapping code in powerpc V4
Next step: c1bfcad4b0cf38ce5b00f7ad880d3a13484c123a (dma-mapping, powerpc: simplify the arch dma_set_mask override) Result: No problems with the PASEMI onboard ethernet and with booting the X5000 (P5020 board). -- Christian On 09 December 2018 at 3:20PM, Christian Zigotzky wrote: Next step: 602307b034734ce77a05da4b99333a2eaf6b6482 (powerpc/fsl_pci: simplify fsl_pci_dma_set_mask) git checkout 602307b034734ce77a05da4b99333a2eaf6b6482 The PASEMI onboard ethernet works and the X5000 boots. -- Christian On 08 December 2018 at 2:47PM, Christian Zigotzky wrote: Next step: e15cd8173ef85e9cc3e2a9c7cc2982f5c1355615 (powerpc/dma: fix an off-by-one in dma_capable) git checkout e15cd8173ef85e9cc3e2a9c7cc2982f5c1355615 The PASEMI onboard ethernet also works with this commit and the X5000 boots without any problems. -- Christian On 08 December 2018 at 11:29AM, Christian Zigotzky wrote: Next step: 7ebc44c535f6bd726d553756d38b137acc718443 (powerpc/dma: remove max_direct_dma_addr) git checkout 7ebc44c535f6bd726d553756d38b137acc718443 OK, the PASEMI onboard ethernet works and the P5020 board boots. -- Christian On 07 December 2018 at 7:33PM, Christian Zigotzky wrote: Next step: 13c1fdec5682b6e13257277fa16aa31f342d167d (powerpc/dma: move pci_dma_dev_setup_swiotlb to fsl_pci.c) git checkout 13c1fdec5682b6e13257277fa16aa31f342d167d Result: The PASEMI onboard ethernet works and the P5020 board boots. — Christian
Re: use generic DMA mapping code in powerpc V4
Next step: 602307b034734ce77a05da4b99333a2eaf6b6482 (powerpc/fsl_pci: simplify fsl_pci_dma_set_mask) git checkout 602307b034734ce77a05da4b99333a2eaf6b6482 The PASEMI onboard ethernet works and the X5000 boots. -- Christian On 08 December 2018 at 2:47PM, Christian Zigotzky wrote: Next step: e15cd8173ef85e9cc3e2a9c7cc2982f5c1355615 (powerpc/dma: fix an off-by-one in dma_capable) git checkout e15cd8173ef85e9cc3e2a9c7cc2982f5c1355615 The PASEMI onboard ethernet also works with this commit and the X5000 boots without any problems. -- Christian On 08 December 2018 at 11:29AM, Christian Zigotzky wrote: Next step: 7ebc44c535f6bd726d553756d38b137acc718443 (powerpc/dma: remove max_direct_dma_addr) git checkout 7ebc44c535f6bd726d553756d38b137acc718443 OK, the PASEMI onboard ethernet works and the P5020 board boots. -- Christian On 07 December 2018 at 7:33PM, Christian Zigotzky wrote: Next step: 13c1fdec5682b6e13257277fa16aa31f342d167d (powerpc/dma: move pci_dma_dev_setup_swiotlb to fsl_pci.c) git checkout 13c1fdec5682b6e13257277fa16aa31f342d167d Result: The PASEMI onboard ethernet works and the P5020 board boots. — Christian
Re: use generic DMA mapping code in powerpc V4
On Sun, Dec 02, 2018 at 05:11:02PM +1100, Benjamin Herrenschmidt wrote: > Talking of which ... Christoph, not sure if we can do something about > this at the DMA API level or keep hacks but some adapters such as the > nVidia GPUs have a HW hack we can use to work around their limitations > in that case. > > They have a register that can program a fixed value for the top bits > that they don't support. > > This works fine for any linear mapping with an offset, provided they > can program the offset in that register and they have enough DMA range > to cover all memory from that offset. > > I can probably get the info about this from them so we can exploit it > in nouveau. I think we can expose the direct mapping offset if people care enough, we just have to be very careful designing the API. I'll happily leave that to those that actually want to use it, but I'll gladly help reviewing it.
Re: use generic DMA mapping code in powerpc V4
On Sun, Dec 02, 2018 at 05:11:02PM +1100, Benjamin Herrenschmidt wrote: > Talking of which ... Christoph, not sure if we can do something about > this at the DMA API level or keep hacks but some adapters such as the > nVidia GPUs have a HW hack we can use to work around their limitations > in that case. > > They have a register that can program a fixed value for the top bits > that they don't support. > > This works fine for any linear mapping with an offset, provided they > can program the offset in that register and they have enough DMA range > to cover all memory from that offset. > > I can probably get the info about this from them so we can exploit it > in nouveau. I think we can expose the direct mapping offset if people care enough, we just have to be very careful designing the API. I'll happily leave that to those that actually want to use it, but I'll gladly help reviewing it.
Re: use generic DMA mapping code in powerpc V4
Just as a warning: this series now has some conflicts with the dma mapping tree due to the ->mapping_error removal, and there might be some bigger ones if the direct calls for the direct mapping code series goes ahead. None of them affect the early part of the series that do not touch the actual dma_map_ops instances, though.
Re: use generic DMA mapping code in powerpc V4
Next step: e15cd8173ef85e9cc3e2a9c7cc2982f5c1355615 (powerpc/dma: fix an off-by-one in dma_capable) git checkout e15cd8173ef85e9cc3e2a9c7cc2982f5c1355615 The PASEMI onboard ethernet also works with this commit and the X5000 boots without any problems. -- Christian On 08 December 2018 at 11:29AM, Christian Zigotzky wrote: Next step: 7ebc44c535f6bd726d553756d38b137acc718443 (powerpc/dma: remove max_direct_dma_addr) git checkout 7ebc44c535f6bd726d553756d38b137acc718443 OK, the PASEMI onboard ethernet works and the P5020 board boots. -- Christian On 07 December 2018 at 7:33PM, Christian Zigotzky wrote: Next step: 13c1fdec5682b6e13257277fa16aa31f342d167d (powerpc/dma: move pci_dma_dev_setup_swiotlb to fsl_pci.c) git checkout 13c1fdec5682b6e13257277fa16aa31f342d167d Result: The PASEMI onboard ethernet works and the P5020 board boots. — Christian
Re: use generic DMA mapping code in powerpc V4
On Tue, 2018-11-27 at 08:42 +0100, Christoph Hellwig wrote: > Any comments? I'd like to at least get the ball moving on the easy > bits. So I had to cleanup some dust but it works on G5 with and without iommu and 32-bit powermacs at least. We're doing more tests, hopefully mpe can dig out some PASemi and NXP/FSL HW as well. I'll try to review & ack the patches over the next few days too. Cheers, Ben. > On Wed, Nov 14, 2018 at 09:22:40AM +0100, Christoph Hellwig wrote: > > Hi all, > > > > this series switches the powerpc port to use the generic swiotlb and > > noncoherent dma ops, and to use more generic code for the coherent > > direct mapping, as well as removing a lot of dead code. > > > > As this series is very large and depends on the dma-mapping tree I've > > also published a git tree: > > > > git://git.infradead.org/users/hch/misc.git powerpc-dma.4 > > > > Gitweb: > > > > > > http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.4 > > > > Changes since v3: > > - rebase on the powerpc fixes tree > > - add a new patch to actually make the baseline amigaone config > >configure without warnings > > - only use ZONE_DMA for 64-bit embedded CPUs, on pseries an IOMMU is > >always present > > - fix compile in mem.c for one configuration > > - drop the full npu removal for now, will be resent separately > > - a few git bisection fixes > > > > The changes since v1 are to big to list and v2 was not posted in public. > > > > ___ > > iommu mailing list > > io...@lists.linux-foundation.org > > https://lists.linuxfoundation.org/mailman/listinfo/iommu > ---end quoted text---
Re: use generic DMA mapping code in powerpc V4
On Tue, 2018-11-27 at 08:42 +0100, Christoph Hellwig wrote: > Any comments? I'd like to at least get the ball moving on the easy > bits. I completely missed your posting of V4 ! I was wondering what was taking you so long :) I'll give it a spin & send acks over the next 2 or 3 days. Cheers, Ben. > On Wed, Nov 14, 2018 at 09:22:40AM +0100, Christoph Hellwig wrote: > > Hi all, > > > > this series switches the powerpc port to use the generic swiotlb and > > noncoherent dma ops, and to use more generic code for the coherent > > direct mapping, as well as removing a lot of dead code. > > > > As this series is very large and depends on the dma-mapping tree I've > > also published a git tree: > > > > git://git.infradead.org/users/hch/misc.git powerpc-dma.4 > > > > Gitweb: > > > > > > http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.4 > > > > Changes since v3: > > - rebase on the powerpc fixes tree > > - add a new patch to actually make the baseline amigaone config > >configure without warnings > > - only use ZONE_DMA for 64-bit embedded CPUs, on pseries an IOMMU is > >always present > > - fix compile in mem.c for one configuration > > - drop the full npu removal for now, will be resent separately > > - a few git bisection fixes > > > > The changes since v1 are to big to list and v2 was not posted in public. > > > > ___ > > iommu mailing list > > io...@lists.linux-foundation.org > > https://lists.linuxfoundation.org/mailman/listinfo/iommu > ---end quoted text---
Re: use generic DMA mapping code in powerpc V4
Next step: 7ebc44c535f6bd726d553756d38b137acc718443 (powerpc/dma: remove max_direct_dma_addr) git checkout 7ebc44c535f6bd726d553756d38b137acc718443 OK, the PASEMI onboard ethernet works and the P5020 board boots. -- Christian On 07 December 2018 at 7:33PM, Christian Zigotzky wrote: Next step: 13c1fdec5682b6e13257277fa16aa31f342d167d (powerpc/dma: move pci_dma_dev_setup_swiotlb to fsl_pci.c) git checkout 13c1fdec5682b6e13257277fa16aa31f342d167d Result: The PASEMI onboard ethernet works and the P5020 board boots. — Christian
Re: use generic DMA mapping code in powerpc V4
Next step: 13c1fdec5682b6e13257277fa16aa31f342d167d (powerpc/dma: move pci_dma_dev_setup_swiotlb to fsl_pci.c) git checkout 13c1fdec5682b6e13257277fa16aa31f342d167d Result: The PASEMI onboard ethernet works and the X5000 boots. — Christian Sent from my iPhone > On 7. Dec 2018, at 14:45, Christian Zigotzky wrote: > >> On 06 December 2018 at 11:55AM, Christian Zigotzky wrote: >>> On 05 December 2018 at 3:05PM, Christoph Hellwig wrote: >>> >>> Thanks. Can you try a few stepping points in the tree? >>> >>> First just with commit 7fd3bb05b73beea1f9840b505aa09beb9c75a8c6 >>> (the first one) applied? >>> >>> Second with all commits up to 5da11e49df21f21dac25a2491aa788307bdacb6b >>> >>> And if that still works with commits up to >>> c1bfcad4b0cf38ce5b00f7ad880d3a13484c123a >>> >> Hi Christoph, >> >> I undid the commit 7fd3bb05b73beea1f9840b505aa09beb9c75a8c6 with the >> following command: >> >> git checkout 7fd3bb05b73beea1f9840b505aa09beb9c75a8c6 >> >> Result: PASEMI onboard ethernet works again and the P5020 board boots. >> >> I will test the other commits in the next days. >> >> @All >> It is really important, that you also test Christoph's work on your PASEMI >> and NXP boards. Could you please help us with solving the issues? >> >> 'git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.5 a' >> >> Thanks, >> Christian >> >> > Today I tested the commit 5da11e49df21f21dac25a2491aa788307bdacb6b. > > git checkout 5da11e49df21f21dac25a2491aa788307bdacb6b > > The PASEMI onboard ethernet works and the P5020 board boots. > > -- Christian >
Re: use generic DMA mapping code in powerpc V4
On 06 December 2018 at 11:55AM, Christian Zigotzky wrote: On 05 December 2018 at 3:05PM, Christoph Hellwig wrote: Thanks. Can you try a few stepping points in the tree? First just with commit 7fd3bb05b73beea1f9840b505aa09beb9c75a8c6 (the first one) applied? Second with all commits up to 5da11e49df21f21dac25a2491aa788307bdacb6b And if that still works with commits up to c1bfcad4b0cf38ce5b00f7ad880d3a13484c123a Hi Christoph, I undid the commit 7fd3bb05b73beea1f9840b505aa09beb9c75a8c6 with the following command: git checkout 7fd3bb05b73beea1f9840b505aa09beb9c75a8c6 Result: PASEMI onboard ethernet works again and the P5020 board boots. I will test the other commits in the next days. @All It is really important, that you also test Christoph's work on your PASEMI and NXP boards. Could you please help us with solving the issues? 'git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.5 a' Thanks, Christian Today I tested the commit 5da11e49df21f21dac25a2491aa788307bdacb6b. git checkout 5da11e49df21f21dac25a2491aa788307bdacb6b The PASEMI onboard ethernet works and the P5020 board boots. -- Christian
Re: use generic DMA mapping code in powerpc V4
Good to know. Sorry because of the email. Sent from my iPhone > On 6. Dec 2018, at 20:36, Christoph Hellwig wrote: > >> On Thu, Dec 06, 2018 at 06:10:54PM +0100, Christian Zigotzky wrote: >> Please don’t merge this code. We are still testing and trying to figure out >> where the problems are in the code. > > The ones I sent pings for were either tested successfully by you > (the zone change) or are trivial cleanups that don't affect your setup.
Re: use generic DMA mapping code in powerpc V4
On Thu, Dec 06, 2018 at 06:10:54PM +0100, Christian Zigotzky wrote: > Please don’t merge this code. We are still testing and trying to figure out > where the problems are in the code. The ones I sent pings for were either tested successfully by you (the zone change) or are trivial cleanups that don't affect your setup.
Re: use generic DMA mapping code in powerpc V4
Please don’t merge this code. We are still testing and trying to figure out where the problems are in the code. — Christian Sent from my iPhone > On 6. Dec 2018, at 11:55, Christian Zigotzky wrote: > >> On 05 December 2018 at 3:05PM, Christoph Hellwig wrote: >> >> Thanks. Can you try a few stepping points in the tree? >> >> First just with commit 7fd3bb05b73beea1f9840b505aa09beb9c75a8c6 >> (the first one) applied? >> >> Second with all commits up to 5da11e49df21f21dac25a2491aa788307bdacb6b >> >> And if that still works with commits up to >> c1bfcad4b0cf38ce5b00f7ad880d3a13484c123a >> > Hi Christoph, > > I undid the commit 7fd3bb05b73beea1f9840b505aa09beb9c75a8c6 with the > following command: > > git checkout 7fd3bb05b73beea1f9840b505aa09beb9c75a8c6 > > Result: PASEMI onboard ethernet works again and the P5020 board boots. > > I will test the other commits in the next days. > > @All > It is really important, that you also test Christoph's work on your PASEMI > and NXP boards. Could you please help us with solving the issues? > > 'git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.5 a' > > Thanks, > Christian >
Re: use generic DMA mapping code in powerpc V4
On 04 December 2018 at 3:24PM, Christoph Hellwig wrote: On Tue, Dec 04, 2018 at 10:53:39AM +0100, Christian Zigotzky wrote: I don't know why this kernel doesn't recognize the hard disks connected to my physical P5020 board and why the onboard ethernet on my PASEMI board doesn't work. (dma_direct_map_page: overflow) Do you know if this actually works for the baseline before my patches? E.g. with commit 721c01ba8b46ddb5355bd6e6b3bbfdabfdf01e97 ? Hi Christoph, Thanks for your reply. I undid all dma mapping commits with the following command: git checkout 721c01ba8b46ddb5355bd6e6b3bbfdabfdf01e97 After that I compiled the kernels with this code for my P5020 board (Cyrus) and for my PASEMI board (Nemo) today. Result: PASEMI onboard ethernet works again and the P5020 board boots. It seems the dma mapping commits are the problem. @All Could you please test Christoph's kernel on your PASEMI and NXP boards? Download: 'git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.5 a' Thanks, Christian
Re: use generic DMA mapping code in powerpc V4
On 04 December 2018 at 3:24PM, Christoph Hellwig wrote: On Tue, Dec 04, 2018 at 10:53:39AM +0100, Christian Zigotzky wrote: I don't know why this kernel doesn't recognize the hard disks connected to my physical P5020 board and why the onboard ethernet on my PASEMI board doesn't work. (dma_direct_map_page: overflow) Do you know if this actually works for the baseline before my patches? E.g. with commit 721c01ba8b46ddb5355bd6e6b3bbfdabfdf01e97 ? Hi Christoph, Thanks for your reply. I undid all dma mapping commits with the following command: git checkout 721c01ba8b46ddb5355bd6e6b3bbfdabfdf01e97 After that I compiled the kernels with this code for my P5020 board (Cyrus) and for my PASEMI board (Nemo) today. Result: PASEMI onboard ethernet works again and the P5020 board boots. It seems the dma mapping commits are the problem. @All Could you please test Christoph's kernel on your PASEMI and NXP boards? Download: 'git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.5 a' Thanks, Christian
Re: use generic DMA mapping code in powerpc V4
On Wed, Nov 28, 2018 at 10:05:19PM +1100, Michael Ellerman wrote: > Is the plan that you take these via the dma-mapping tree or that they go > via powerpc? In principle either way is fine with me. If it goes through the powerpc tree we might run into a few minor conflicts with the dma-mapping tree depending on how some of the current discussions go.