Page 3 of 18

Re: Kernel 4.7

Posted: Thu May 26, 2016 7:15 am
by xeno74
Hi All,

Aneesh Kumar K.V (IBM Corporation) has dropped the WIMG bits and created PowerISA 3.0 defines instead.

Code: Select all

-             size, _PAGE_NO_CACHE|_PAGE_GUARDED);
+             size, pgprot_val(pgprot_noncached(__pgprot(0))));
Unfortunately the new defines don't work with our Nemo board. The problem is the initialization of the SB600 southbridge.

I'm in touch with Aneesh but I am not sure if we can fix the problem. It is possible to revert these changes in the git source code but I don't know how long we can remove these changes.

Sorry,

Christian

Re: Kernel 4.7

Posted: Fri May 27, 2016 9:14 am
by xeno74
Hi All,

I haven't got any suitable solutions to solve our problems with the kernel 4.7. Therefore I have learnt a little bit about the problematic code.

I hope, I understand it correctly. I believe ioremap is used by the kernel to map device control registers (i.e. SB600 pci device control).

Map means to assign a virtual address to a physical address.

__ioremap_at = Low level function to establish the page tables for an IO mapping. Is this an allocation?

A page table is the data structure used by a virtual memory system in a Linux system to store the mapping between virtual addresses and physical addresses.

PTE = Page Table Entry

I understand that our SB600 patch only use the following options:

_PAGE_NO_CACHE = Caching is not desirable

_PAGE_GUARDED = Guarded page tables are tree-structured like conventional multilevel tables and support mixed page sizes.

I figured out that a lot of source code were rewrote for this part. _PAGE_GUARDED doesn't exist anymore. I deleted _PAGE_GUARDED from the patch and I compiled the kernel 4.6 again. It boots. That means, the kernel doesn't need _PAGE_GUARDED. That means something is wrong with _PAGE_NO_CACHE. In the new source code it still exists but it's not the same. Our focus is therefore on _PAGE_NO_CACHE.

But .... _PAGE_NO_CACHE only means no caching. More not. Something is wrong in the new source code because the old source code for the mapping works without any problems. The problem can't be the SB600 patch because we only use _PAGE_NO_CACHE and this only an option.

Cheers,

Christian

Re: Kernel 4.7

Posted: Fri May 27, 2016 10:32 pm
by xeno74
Hi All,

I downloaded the latest git version with the following command today.

Code: Select all

git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux-git
After that I tested our latest Nemo patch 4.7-1 with patch -p0 < nemo_4.7-1.patch. It works without any problems.

Fantastic, I don't need to create a new patch for the latest git version.

I tried to compile it and got of course the following error message:

Code: Select all

arch/powerpc/kernel/pci-common.c: In function ‘pci_process_bridge_OF_ranges’:
arch/powerpc/kernel/pci-common.c:732:59: error: ‘_PAGE_GUARDED’ undeclared (first use in this function)
                                range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);
                                                           ^
arch/powerpc/kernel/pci-common.c:732:59: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [arch/powerpc/kernel/pci-common.o] Fehler 1
make: *** [arch/powerpc/kernel] Fehler 2
I deleted _PAGE_GUARDED because I figured out, that the kernel 4.6 boots without it.

Code: Select all

		__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
                               range.size, _PAGE_NO_CACHE);
Then it compiled without any problems. Unfortunately it doesn't boot.

Then I replaced _PAGE_NO_CACHE with pgprot_val(pgprot_noncached(__pgprot(0))));

Code: Select all

	__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
                               range.size, pgprot_val(pgprot_noncached(__pgprot(0))));
Afterwards it compiled too but it doesn't boot either.

I removed the powerpc-4.7-1 commit with:

Code: Select all

git revert c04a5880299eab3da8c10547db96ea9cdffd44a6 -m 1
Result: 199 files changed, 3405 insertions(+), 7173 deletions(-)

Then I was able to patch the kernel sources with our latest Nemo patch 4.7-1.

It boots without the commit powerpc-4.7-1. I tested a lot of things with the latest git version and it works without any problems.

Test results:

1) Hardware 3D acceleration works (tested with DOOM 3 and SuperTuxKart 0.8.1-2)
2) Sound works (MP3 files, web radio etc)
3) LAN works (Realtek RTL-8139)
4) WLAN works (FRITZ!WLAN USB Stick N)
5) "PR" KVM works (QEMU guest: Mac OS X 10.4.11 Tiger)
6) Compiz works
7) HD YouTube videos work
8) Internal CF card works

I tested the latest git kernel with Debian Sid and ubuntu MATE 16.10.

I released it as alpha4.

Download: vmlinux-4.7-alpha4-AmigaONE_X1000.tar.gz

Image

Please test it.

Cheers,

Christian

Re: Kernel 4.7

Posted: Sat May 28, 2016 3:14 am
by kilaueabart
I don't know if it really counts as a test or not, but I just booted MATE 16.04 with kernel 4.7 and so far see no difference.

日本語 and 한국말 still work. Printers > Properties > Print test page still works perfectly. Ctrl+P from applications still blurs the colors, but I didn't expect a new kernel to fix that.

What else should I try, as tests?

Re: Kernel 4.7

Posted: Sat May 28, 2016 7:03 am
by xeno74
kilaueabart wrote:I don't know if it really counts as a test or not, but I just booted MATE 16.04 with kernel 4.7 and so far see no difference.

日本語 and 한국말 still work. Printers > Properties > Print test page still works perfectly. Ctrl+P from applications still blurs the colors, but I didn't expect a new kernel to fix that.

What else should I try, as tests?
Thanks a lot for testing! :-) Which graphics card is installed in your X1000?

Re: Kernel 4.7

Posted: Sat May 28, 2016 7:58 am
by kilaueabart
I have Radeon HD 5450.

I had heard mention of some game called Super Tux Kart or something like that, so after I posted my success with kernel 4.7 I installed it and tried to run it. Screen went black, to music, and I couldn't hang around, so I left it to see if anything would happen--maybe it was just getting ready to run. An hour later, the music was still going, and still a black screen.

I rebooted, planning to give the game another try. And found myself back in my "no login" May 6 situation. Even using kernel 4.1.21, booting stops at a screen with the Ubuntu logo at the bottom, without bringing up the logon thing. Ctrl^Alt^F1 brings up a CLI (but at least once it changed almost immediately to tty1). But I don't know how to do much from Terminal or that other CLI.

The new whole-disk image install had been working really nice for a couple weeks!

Re: Kernel 4.7

Posted: Sat May 28, 2016 11:46 am
by xeno74

Re: Kernel 4.7

Posted: Sat May 28, 2016 10:45 pm
by kilaueabart
If "http://permalink.gmane.org/gmane.linux. ... vel/122019" was a hint to me, thanks, but I am completely baffled.

Re: Kernel 4.7

Posted: Sun May 29, 2016 7:44 am
by xeno74
kilaueabart wrote:If "http://permalink.gmane.org/gmane.linux. ... vel/122019" was a hint to me, thanks, but I am completely baffled.
No, it's not for you. It's an explanation of the commit powerpc-4.7-1.

Re: Kernel 4.7

Posted: Mon May 30, 2016 9:43 am
by xeno74
Hi All,

I downloaded the RC1 with the following command today.

Code: Select all

git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux-git
Then I removed the powerpc-4.7-1 commit with:

Code: Select all

git revert c04a5880299eab3da8c10547db96ea9cdffd44a6 -m 1
Result: 199 files changed, 3405 insertions(+), 7173 deletions(-)

After that I was able to patch the kernel sources with our latest Nemo patch 4.7-1 with patch -p0 < nemo_4.7-1.patch. It works without any problems.

It boots without the commit powerpc-4.7-1. I tested a lot of things with the RC1 and it works fantastic.

Test results:
  1. Hardware 3D acceleration works with an AMD Radeon HD6870 (tested with DOOM 3 and SuperTuxKart 0.8.1-2)
  2. Sound works (MP3 files, web radio etc)
  3. LAN works (Realtek RTL-8139)
  4. WLAN works (FRITZ!WLAN USB Stick N)
  5. "PR" KVM works (QEMU guest: Mac OS X 10.4.11 Tiger)
  6. Compiz works
  7. YouTube HD videos work with ViewTube
  8. Internal CF card works
  9. pas_shutdown works
I tested the RC1 with Debian Sid, openSUSE Tumbleweed PPC64, and ubuntu MATE 16.10.

Download: vmlinux-4.7-rc1-AmigaONE_X1000.tar.gz

New:
Impressive: The latest openSUSE Tumbleweed PPC64 with kernel 4.7-rc1 and my first S.u.S.E Linux with kernel 2.0.30 (S.u.S.E Linux 5.0 from 1997 on QEMU i386) together:

Image

Just for info:

We are trying to solve the issue with the commit powerpc-4.7-1.
Aneesh Kumar K.V wrote: I am not sure reverting that commit is going to help us debug this more. We
need to understand what is the expected WIMG bits and what we are
mapping with in non-working case. Without that info i doubt we will be able to make much
progress.

-aneesh
Adrian Cox wrote: I'm not able to help much here, I'm afraid. I don't have a Nemo board at the moment, and it's been a few years. From memory all the peripherals required standard uncached and guarded mappings on Nemo.

The difficult bit that usually breaks on kernel upgrades is not the WIMG settings, but the PCI probing routine. The SB600 doesn't follow normal PCIe address decoding rules, as in its original use as an AMD south bridge it was designed to appear as if it were integrated into the north bridge.

--
Adrian
Darren Stevens wrote: Before everybody gets too involved, from what I've seen with my tests today
the kernel is crashing long before it gets to the pci-common code.

I've attached 2 boot logs, one from a 4.4 kernel I've been working on, and
from a build of the latest git.

You can see from this that the 4.7 kernel hangs right after the booting linux
via __start(), whereas in the 4.4 there's about 29 lines of output before it
gets to the Initialised io_base_virt printk in our patch.

The last time we had a hang this early in the boot it turned out to be a
problem in head_64.S, I think there is something else wrong in the commit
Christian has identified

I will see if this is something I can fix, but it may need better low level
knowledge of PPC hardware than I have.

Regards
Darren
I replaced the file head_64.S with the old one from kernel 4.6 yesterday. Additionally I use

Code: Select all

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
                               range.size, pgprot_val(pgprot_noncached(__pgprot(0))));
It compiled without any problems but unfortunately it doesn't boot. Our Sam460ex has also problems with the commit powerpc-4.7-1.
Julian Margetson wrote: Hi Christian,

I am also having a problem with _PAGE_NO_CACHE on Sam460ex.

Regards
Julian

drivers/gpu/drm/drm_vm.c: In function ‘drm_dma_prot’:
drivers/gpu/drm/drm_vm.c:83:6: error: invalid operands to binary | (have ‘pgprot_t {aka struct <anonymous>}’ and ‘int’)
tmp |= _PAGE_NO_CACHE;
^
scripts/Makefile.build:289: recipe for target 'drivers/gpu/drm/drm_vm.o' failed
make[3]: *** [drivers/gpu/drm/drm_vm.o] Error 1
scripts/Makefile.build:440: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:440: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:985: recipe for target 'drivers' failed
make: *** [drivers] Error 2
Aneesh Kumar K.V wrote: That is because that usage is wrong based on type. _PAGE_NO_CACHE is not
of type pgprot_t. What you really need there is

tmp = __pgprot(pgprot_val(tmp) | _PAGE_NO_CACHE);

or a better option would be

tmp = pgprot_noncached_wc(tmp);

-aneesh
Julian Margetson wrote: tmp = pgprot_noncached_wc(tmp);

compiles but I then run in to the following

CC drivers/gpu/drm/drm_scatter.o
drivers/gpu/drm/drm_scatter.c: In function ‘drm_vmalloc_dma’:
drivers/gpu/drm/drm_scatter.c:44:49: error: invalid operands to binary | (have ‘pgprot_t {aka struct <anonymous>}’ and ‘int’)
return __vmalloc(size, GFP_KERNEL, PAGE_KERNEL | _PAGE_NO_CACHE);
^
drivers/gpu/drm/drm_scatter.c:48:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
scripts/Makefile.build:289: recipe for target 'drivers/gpu/drm/drm_scatter.o' failed
make[3]: *** [drivers/gpu/drm/drm_scatter.o] Error 1
scripts/Makefile.build:440: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:440: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:985: recipe for target 'drivers' failed
make: *** [drivers] Error 2
Please test the RC1.

Thanks in advance,

Christian